summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-26 14:24:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-27 08:20:14 +0200
commit1cf751c787f135597b4151c5a7d9c4afe69ede9c (patch)
tree0e6d96f8262daef5e1a2527f4e268bbaab725634
parentcca4d9ab39499562614f0f778a2fffe5a40fde88 (diff)
make WB_LINESPACING a bool field on Toolbox
Change-Id: If9332993a4917b00c230d2a3693daf8c5d3f5559 Reviewed-on: https://gerrit.libreoffice.org/53521 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--cui/source/customize/cfg.cxx3
-rw-r--r--framework/source/uielement/addonstoolbarwrapper.cxx3
-rw-r--r--framework/source/uielement/toolbarmanager.cxx3
-rw-r--r--framework/source/uielement/toolbarwrapper.cxx3
-rw-r--r--include/tools/wintypes.hxx1
-rw-r--r--include/vcl/toolbox.hxx5
-rw-r--r--reportdesign/source/ui/dlg/AddField.cxx2
-rw-r--r--reportdesign/source/ui/dlg/Condition.cxx2
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx2
-rw-r--r--vcl/source/window/toolbox.cxx15
10 files changed, 23 insertions, 16 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index fb1195c73b39..6070a7be05ee 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2910,7 +2910,8 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow,
aTbSize = pTbSymbol->LogicToPixel(Size(160, 80), MapMode(MapUnit::MapAppFont));
pTbSymbol->set_width_request(aTbSize.Width());
pTbSymbol->set_height_request(aTbSize.Height());
- pTbSymbol->SetStyle(pTbSymbol->GetStyle() | WB_SCROLL | WB_LINESPACING);
+ pTbSymbol->SetStyle(pTbSymbol->GetStyle() | WB_SCROLL);
+ pTbSymbol->SetLineSpacing(true);
typedef std::unordered_map< OUString, bool > ImageInfo;
diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx
index 9062c4b72c13..379f2a4d16be 100644
--- a/framework/source/uielement/addonstoolbarwrapper.cxx
+++ b/framework/source/uielement/addonstoolbarwrapper.cxx
@@ -111,9 +111,10 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
if ( pWindow )
{
- sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
+ sal_uLong nStyles = WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
pToolBar = VclPtr<ToolBox>::Create( pWindow, nStyles );
+ pToolBar->SetLineSpacing(true);
pToolBarManager = new AddonsToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
m_xToolBarManager.set( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
}
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index ea77c92a70a8..cae4dacd7295 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1552,7 +1552,8 @@ IMPL_LINK( ToolBarManager, MenuButton, ToolBox*, pToolBar, void )
assert( !m_aOverflowManager.is() );
- VclPtrInstance<ToolBox> pOverflowToolBar( pToolBar, WB_LINESPACING | WB_BORDER | WB_SCROLL );
+ VclPtrInstance<ToolBox> pOverflowToolBar( pToolBar, WB_BORDER | WB_SCROLL );
+ pOverflowToolBar->SetLineSpacing(true);
pOverflowToolBar->SetOutStyle( pToolBar->GetOutStyle() );
m_aOverflowManager.set( new ToolBarManager( m_xContext, m_xFrame, OUString(), pOverflowToolBar ) );
m_aOverflowManager->FillOverflowToolbar( pToolBar );
diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx
index 9d99ea280c14..951fb3bacec7 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -149,9 +149,10 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments )
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xParentWindow );
if ( pWindow )
{
- sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
+ sal_uLong nStyles = WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
pToolBar = VclPtr<ToolBox>::Create( pWindow, nStyles );
+ pToolBar->SetLineSpacing(true);
pToolBarManager = new ToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
m_xToolBarManager.set( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
pToolBar->WillUsePopupMode( bPopupMode );
diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx
index f80334966b76..b9e7d007fc55 100644
--- a/include/tools/wintypes.hxx
+++ b/include/tools/wintypes.hxx
@@ -208,7 +208,6 @@ WinBits const WB_SIMPLEMODE = 0x20000000;
WinBits const WB_SCALE = 0x08000000;
// Window-Bits for ToolBox
-WinBits const WB_LINESPACING = 0x01000000;
WinBits const WB_SCROLL = 0x02000000;
// Window-Bits for SplitWindow
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 2018be7986d4..74db39f4af55 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -147,7 +147,8 @@ private:
mbDragging:1,
mbIsKeyEvent:1,
mbChangingHighlight:1,
- mbImagesMirrored:1;
+ mbImagesMirrored:1,
+ mbLineSpacing:1;
WindowAlign meAlign;
WindowAlign meDockAlign;
ButtonType meButtonType;
@@ -518,6 +519,8 @@ public:
void statusChanged(const css::frame::FeatureStateEvent& rEvent);
void SetToolBoxTextPosition( ToolBoxTextPosition ePosition );
+
+ void SetLineSpacing(bool b) { mbLineSpacing = b; }
};
inline void ToolBox::CheckItem( sal_uInt16 nItemId, bool bCheck )
diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx
index 0299f5cabe94..46b8850ac552 100644
--- a/reportdesign/source/ui/dlg/AddField.cxx
+++ b/reportdesign/source/ui/dlg/AddField.cxx
@@ -167,7 +167,7 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent ,const uno::Reference< bea
SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
SetMinOutputSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
- m_aActions->SetStyle(m_aActions->GetStyle()|WB_LINESPACING);
+ m_aActions->SetLineSpacing(true);
m_aActions->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
m_aActions->SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction));
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx
index 0d76f42744ff..5a934f9bd0fa 100644
--- a/reportdesign/source/ui/dlg/Condition.cxx
+++ b/reportdesign/source/ui/dlg/Condition.cxx
@@ -128,7 +128,7 @@ Condition::Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction,
get(m_pAddCondition, "addButton");
get(m_pRemoveCondition, "removeButton");
- m_pActions->SetStyle(m_pActions->GetStyle()|WB_LINESPACING);
+ m_pActions->SetLineSpacing(true);
m_pCondLHS->GrabFocus();
m_pConditionType->SetSelectHdl( LINK( this, Condition, OnTypeSelected ) );
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index afd90c6d54be..816c5df9dcce 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -845,7 +845,7 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl
m_pHelpWindow->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
- m_pToolBox->SetStyle(m_pToolBox->GetStyle()|WB_LINESPACING);
+ m_pToolBox->SetLineSpacing(true);
m_pToolBox->SetSelectHdl(LINK(this, OGroupsSortingDialog, OnFormatAction));
checkButtons(0);
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 458c7c6e9566..a90b1d4814e4 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -373,7 +373,7 @@ void ToolBox::ImplDrawGradientBackground(vcl::RenderContext& rRenderContext)
}
}
- if (mnWinStyle & WB_LINESPACING)
+ if (mbLineSpacing)
{
if (mbHorz)
{
@@ -691,7 +691,7 @@ Size ToolBox::ImplCalcSize( ImplToolItems::size_type nCalcLines, sal_uInt16 nCal
else
aSize.setHeight( nCalcLines * mnMaxItemHeight );
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
aSize.AdjustHeight((nCalcLines-1)*TB_LINESPACING );
if ( mnWinStyle & WB_BORDER )
@@ -709,7 +709,7 @@ Size ToolBox::ImplCalcSize( ImplToolItems::size_type nCalcLines, sal_uInt16 nCal
{
aSize.setWidth( nCalcLines * mnMaxItemWidth );
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
aSize.AdjustWidth((nCalcLines-1)*TB_LINESPACING );
if ( mnWinStyle & WB_BORDER )
@@ -882,7 +882,7 @@ ToolBox::ImplToolItems::size_type ToolBox::ImplCalcLines( long nToolSize ) const
if ( mnWinStyle & WB_BORDER )
nToolSize -= TB_BORDER_OFFSET2*2;
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
{
nLineHeight += TB_LINESPACING;
nToolSize += TB_LINESPACING;
@@ -1133,6 +1133,7 @@ void ToolBox::ImplInitToolBoxData()
mbIsKeyEvent = false;
mbChangingHighlight = false;
mbImagesMirrored = false;
+ mbLineSpacing = false;
meButtonType = ButtonType::SYMBOLONLY;
meAlign = WindowAlign::Top;
meDockAlign = WindowAlign::Top;
@@ -1875,7 +1876,7 @@ Size ToolBox::ImplGetOptimalFloatingSize()
aSz.setHeight( nBorderY + nLineHeight * nLines );
// line space when more than one line
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
aSz.AdjustHeight((nLines-1)*TB_LINESPACING );
aSz.setWidth( nBorderX + maxX );
@@ -2210,7 +2211,7 @@ void ToolBox::ImplFormat( bool bResize )
if ( mbHorz )
{
nX = nLeft;
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
nY += nLineSize+TB_LINESPACING;
else
nY += nLineSize;
@@ -2218,7 +2219,7 @@ void ToolBox::ImplFormat( bool bResize )
else
{
nY = nTop;
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
nX += nLineSize+TB_LINESPACING;
else
nX += nLineSize;