diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index bd64166..6c04ff4 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -2492,7 +2492,23 @@ 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 default(aero) theme,small + // icons), 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 tdf#83099. + 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->maCalcRect.Top() = 0; // workaround for Windows7 with default(aero) theme,small icons + } } else it->maCalcRect.Top() = nY+(nLineSize-aCurrentItemSize.Height())/2; @@ -2516,6 +2532,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();