diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index bd64166..8ff4c02 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -2492,7 +2492,18 @@ void ToolBox::ImplFormat( bool bResize ) // items here. ( Note: assume mnMaxItemHeight is // equal to the LineSize when multibar has a single // line size ) - it->maCalcRect.Top() = it->maRect.Top() ? it->maRect.Top() : ( nY + ( mnMaxItemHeight-aCurrentItemSize.Height())/2 ); + // 1. But on Windows7(with Aero), it->maRect.Top() + // is always 0, probably.Unfortunately mnMaxItemHeight + // isn't updated immediately when the calc bar is + // expanded. We need to consider these. Please refer + // tdf83099. + if ( it->maRect.Top() ) { + it->maCalcRect.Top() = it->maRect.Top(); + } else if ( mnMaxItemHeight >= aCurrentItemSize.Height() ) { + it->maCalcRect.Top() = nY + ( mnMaxItemHeight-aCurrentItemSize.Height())/2; + } else { + it->maRect.Top() = 0; // workaround for Windows7 with Aero + } } else it->maCalcRect.Top() = nY+(nLineSize-aCurrentItemSize.Height())/2; @@ -2516,6 +2527,9 @@ void ToolBox::ImplFormat( bool bResize ) if ( it->mbShowWindow ) { Point aPos( it->maCalcRect.Left(), it->maCalcRect.Top() ); + + assert( it->maCalcRect.Top() >= 0 ); + it->mpWindow->SetPosPixel( aPos ); if ( !mbCustomizeMode ) it->mpWindow->Show();