diff options
author | Noel Power <noel.power@novell.com> | 2011-12-14 10:49:10 +0000 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2011-12-14 11:02:26 +0000 |
commit | cefd323936db42b3414c01c4a6dfe1550b364ed3 (patch) | |
tree | dce40ef007ad79431ddd8caf04a022374a80b37f /vcl | |
parent | f33773c414f8ed6b470e66da6cf83716989c488e (diff) |
stop formulabar controls being repositioned vertically in multiline mode
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/toolbox.hxx | 11 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 6 |
2 files changed, 9 insertions, 8 deletions
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx index 8b39005b3fb5..039a0e33d496 100644 --- a/vcl/inc/vcl/toolbox.hxx +++ b/vcl/inc/vcl/toolbox.hxx @@ -160,12 +160,11 @@ enum ToolBoxButtonSize { TOOLBOX_BUTTONSIZE_DONTCARE, TOOLBOX_BUTTONSIZE_SMALL, // used for internal sizing calculations enum FloatingSizeMode { FSMODE_AUTO, FSMODE_FAVOURWIDTH, FSMODE_FAVOURHEIGHT }; -// TBX_LAYOUT_NORMAL - traditional layout, items are centered in the toolbar -// TBX_LAYOUT_TOP - special mode (currently used for calc input/formula bar) -// where items are aligned with the top of highest item -// ( currently only valid for docked, single line, horizontal -// toolbars ) -enum ToolBoxLayoutMode { TBX_LAYOUT_NORMAL, TBX_LAYOUT_TOP }; +// TBX_LAYOUT_NORMAL - traditional layout, items are centered in the toolbar +// TBX_LAYOUT_LOCKVERT - special mode (currently used for calc input/formula +// bar) where item's vertical position is locked, e.g. +// toolbox is prevented from centering the items +enum ToolBoxLayoutMode { TBX_LAYOUT_NORMAL, TBX_LAYOUT_LOCKVERT }; // ----------- // - ToolBox - // ----------- diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index af88334a0ce3..2a0a0893054a 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -2719,8 +2719,10 @@ void ToolBox::ImplFormat( sal_Bool bResize ) if ( mbHorz ) { it->maCalcRect.Left() = nX; - if ( meLayoutMode == TBX_LAYOUT_TOP && mnLines == 1 ) - it->maCalcRect.Top() = nY/2; + // if special TBX_LAYOUT_LOCKVERT lock vertical position + // don't recalulate the vertical position of the item + if ( meLayoutMode == TBX_LAYOUT_LOCKVERT && mnLines == 1 ) + it->maCalcRect.Top() = it->maRect.Top(); else it->maCalcRect.Top() = nY+(nLineSize-aCurrentItemSize.Height())/2; it->maCalcRect.Right() = nX+aCurrentItemSize.Width()-1; |