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 10:51:02 +0000 |
commit | a9e338a1cd445be29be199f3f9f292062d5c1938 (patch) | |
tree | f054636312373eb27e5dffc17c3ac6a1cc36bde1 /vcl | |
parent | 5539e6cbf3bfcb67ebf5986d1c04e65277896df1 (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 287d069ec4e7..c750eec1f08f 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 36b42e0035e2..217cac0776c7 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; |