diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-02 13:54:34 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-09-05 08:21:46 +0200 |
commit | a1cd62bcd589a7c1050e327f4cb0ad95f9ea19d1 (patch) | |
tree | 4564ea2be6311b5e44e67d9036bafab0c501ccb8 /sfx2 | |
parent | 256654c26fa0d474891809d30d0004c3d87a5841 (diff) |
convert ToolBoxButtonSize to scoped enum
Change-Id: I365b0e34361eb339b04e5f4792f54eff5bf582a5
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/notebookbar/BigToolBox.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/notebookbar/NotebookbarToolBox.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarToolBox.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 2 |
4 files changed, 10 insertions, 22 deletions
diff --git a/sfx2/source/notebookbar/BigToolBox.cxx b/sfx2/source/notebookbar/BigToolBox.cxx index 8848cba41f52..a271f04df4ad 100644 --- a/sfx2/source/notebookbar/BigToolBox.cxx +++ b/sfx2/source/notebookbar/BigToolBox.cxx @@ -41,7 +41,7 @@ BigToolBox::BigToolBox(vcl::Window* pParent) SvtMiscOptions aMiscOptions; aMiscOptions.RemoveListenerLink(LINK(this, SidebarToolBox, ChangedIconSizeHandler)); - SetToolboxButtonSize(TOOLBOX_BUTTONSIZE_LARGE); + SetToolboxButtonSize(ToolBoxButtonSize::Large); SetButtonType(ButtonType::SYMBOLTEXT); SetToolBoxTextPosition(ToolBoxTextPosition::Bottom); } diff --git a/sfx2/source/notebookbar/NotebookbarToolBox.cxx b/sfx2/source/notebookbar/NotebookbarToolBox.cxx index 37662a845315..08223436e064 100644 --- a/sfx2/source/notebookbar/NotebookbarToolBox.cxx +++ b/sfx2/source/notebookbar/NotebookbarToolBox.cxx @@ -30,18 +30,12 @@ public: NotebookbarToolBox(vcl::Window* pParentWindow) : sfx2::sidebar::SidebarToolBox(pParentWindow) { - ToolBoxButtonSize eSize = TOOLBOX_BUTTONSIZE_SMALL; - - SvtMiscOptions aMiscOptions; - - sal_uInt16 nSize = GetIconSize(); - if (nSize <= TOOLBOX_BUTTONSIZE_LARGE) - eSize = static_cast<ToolBoxButtonSize>(nSize); - + ToolBoxButtonSize eSize = ToolBoxButtonSize::Small; + eSize = GetIconSize(); SetToolboxButtonSize(eSize); } - virtual sal_uInt16 GetIconSize() const override + virtual ToolBoxButtonSize GetIconSize() const override { SvtMiscOptions aMiscOptions; return aMiscOptions.GetNotebookbarIconSize(); diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx index 29c82ff3f18c..02d91653a8da 100644 --- a/sfx2/source/sidebar/SidebarToolBox.cxx +++ b/sfx2/source/sidebar/SidebarToolBox.cxx @@ -64,14 +64,12 @@ SidebarToolBox::SidebarToolBox (vcl::Window* pParentWindow) SetBackground(Wallpaper()); SetPaintTransparent(true); - ToolBoxButtonSize eSize = TOOLBOX_BUTTONSIZE_SMALL; + ToolBoxButtonSize eSize = ToolBoxButtonSize::Small; SvtMiscOptions aMiscOptions; aMiscOptions.AddListenerLink(LINK(this, SidebarToolBox, ChangedIconSizeHandler)); - sal_uInt16 nSize = GetIconSize(); - if (nSize <= TOOLBOX_BUTTONSIZE_LARGE) - eSize = static_cast<ToolBoxButtonSize>(nSize); + eSize = GetIconSize(); SetToolboxButtonSize(eSize); @@ -117,7 +115,7 @@ void SidebarToolBox::dispose() ToolBox::dispose(); } -sal_uInt16 SidebarToolBox::GetIconSize() const +ToolBoxButtonSize SidebarToolBox::GetIconSize() const { SvtMiscOptions aMiscOptions; return aMiscOptions.GetSidebarIconSize(); @@ -268,13 +266,9 @@ IMPL_LINK_NOARG_TYPED(SidebarToolBox, ChangedIconSizeHandler, LinkParamNone*, vo { SolarMutexGuard g; - ToolBoxButtonSize eSize = TOOLBOX_BUTTONSIZE_SMALL; + ToolBoxButtonSize eSize = GetIconSize(); - sal_uInt16 nSize = GetIconSize(); - if(nSize <= TOOLBOX_BUTTONSIZE_LARGE) - eSize = static_cast<ToolBoxButtonSize>(nSize); - - bool bBigImages(eSize == TOOLBOX_BUTTONSIZE_LARGE); + bool bBigImages(eSize == ToolBoxButtonSize::Large); SetToolboxButtonSize(eSize); for (auto const& it : maControllers) diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index e17f67e67b3e..f11745844bdc 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -597,7 +597,7 @@ Reference< css::awt::XWindow > SAL_CALL SfxToolBoxControl::createItemWindow( con bool SfxToolBoxControl::hasBigImages() const { - return (GetToolBox().GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE); + return (GetToolBox().GetToolboxButtonSize() == ToolBoxButtonSize::Large); } void SfxToolBoxControl::SetPopupWindow( SfxPopupWindow* pWindow ) |