[Libreoffice-commits] core.git: extensions/source forms/source framework/source include/sfx2 include/svtools include/vcl sfx2/source svtools/source vcl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 2 08:55:57 UTC 2020


 extensions/source/bibliography/toolbar.cxx          |    9 -
 extensions/source/bibliography/toolbar.hxx          |    1 
 forms/source/solar/control/navtoolbar.cxx           |    1 
 framework/source/uielement/addonstoolbarwrapper.cxx |    1 
 framework/source/uielement/toolbarmanager.cxx       |    1 
 framework/source/uielement/toolbarwrapper.cxx       |    2 
 include/sfx2/sfxsids.hrc                            |    1 
 include/svtools/miscopt.hxx                         |    3 
 include/vcl/toolbox.hxx                             |    7 -
 sfx2/source/appl/appcfg.cxx                         |   12 --
 sfx2/source/dialog/titledockwin.cxx                 |    1 
 sfx2/source/sidebar/PanelTitleBar.cxx               |    1 
 svtools/source/config/miscopt.cxx                   |   63 ------------
 vcl/source/window/menubarwindow.cxx                 |    2 
 vcl/source/window/toolbox.cxx                       |  101 +++-----------------
 vcl/source/window/toolbox2.cxx                      |   21 ----
 16 files changed, 24 insertions(+), 203 deletions(-)

New commits:
commit a0eab90bd1f7fc31978da3f7be0ec86781baf8bc
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 31 22:01:06 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Nov 2 09:55:20 2020 +0100

    toolbox always has flat style
    
    ever since
        commit c1cd6af623e86b5b1b45f9d09dc17d6fbb907f02
        Author: Jens-Heiner Rechtien <hr at openoffice.org>
        Date:   Mon May 10 14:51:02 2004 +0000
        INTEGRATION: CWS nwf (1.64.66); FILE MERGED
        2004/03/31 09:28:33 ssa 1.64.66.1: #i25130# force flat toolbox buttons
    
    except for a completely and utterly undocumented hack of a registry key,
    introduced in
        commit 736dc0956a50315ec72ad126406556657a750d37
        Author: Rüdiger Timm <rt at openoffice.org>
        Date:   Thu Apr 17 14:19:46 2003 +0000
        INTEGRATION: CWS vcl08 (1.57.2.4.18); FILE MERGED
        2003/04/14 17:46:27 ssa 1.57.2.4.18.1: #108699# disabled flat toolbox buttons not exported anymore
    
    which only seems to apply to Windows.
    
    So just remove this.
    
    Change-Id: Idf315b8c89c3119883a5e6880d003d379fe6faec
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105155
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index 12f6cb5cb2df..61e583e238ec 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -232,13 +232,10 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink)
     , nSelMenuItem(0)
     , aLayoutManager(aLink)
     , nSymbolsSize(SFX_SYMBOLS_SIZE_SMALL)
-    , nOutStyle(0)
 {
     SvtMiscOptions aSvtMiscOptions;
     nSymbolsSize = aSvtMiscOptions.GetCurrentSymbolsSize();
-    nOutStyle  = aSvtMiscOptions.GetToolboxStyle();
 
-    SetOutStyle(TOOLBOX_STYLE_FLAT);
     xSource->Show();
     pLbSource->connect_changed(LINK( this, BibToolBar, SelHdl));
 
@@ -570,12 +567,6 @@ IMPL_LINK_NOARG( BibToolBar, OptionsChanged_Impl, LinkParamNone*, void )
         nSymbolsSize = eSymbolsSize;
         bRebuildToolBar = true;
     }
-    else if ( nOutStyle != SvtMiscOptions().GetToolboxStyle() )
-    {
-        nOutStyle = SvtMiscOptions().GetToolboxStyle();
-        SetOutStyle( nOutStyle );
-        bRebuildToolBar = true;
-    }
 
     if ( bRebuildToolBar )
         RebuildToolbar();
diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx
index e4aa8b852b02..afd1bd3ace38 100644
--- a/extensions/source/bibliography/toolbar.hxx
+++ b/extensions/source/bibliography/toolbar.hxx
@@ -154,7 +154,6 @@ class BibToolBar:   public ToolBox
         OUString                aQueryField;
         Link<void*,void>        aLayoutManager;
         sal_Int16               nSymbolsSize;
-        sal_Int16               nOutStyle;
 
         sal_uInt16              nTBC_SOURCE;
         sal_uInt16              nTBC_QUERY;
diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx
index 755502d6d409..07480edc690b 100644
--- a/forms/source/solar/control/navtoolbar.cxx
+++ b/forms/source/solar/control/navtoolbar.cxx
@@ -232,7 +232,6 @@ namespace frm
     void NavigationToolBar::implInit( )
     {
         m_pToolbar = VclPtr<ImplNavToolBar>::Create( this );
-        m_pToolbar->SetOutStyle( TOOLBOX_STYLE_FLAT );
         m_pToolbar->Show();
 
         // need the SfxApplication for retrieving information about our
diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx
index 04193ac336c0..f2b56cee1526 100644
--- a/framework/source/uielement/addonstoolbarwrapper.cxx
+++ b/framework/source/uielement/addonstoolbarwrapper.cxx
@@ -118,7 +118,6 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument
         {
             // Fill toolbar with container contents
             pToolBarManager->FillAddonToolbar( m_aConfigData );
-            pToolBar->SetOutStyle( SvtMiscOptions().GetToolboxStyle() );
             pToolBar->EnableCustomize();
             ::Size aActSize( pToolBar->GetSizePixel() );
             ::Size aSize( pToolBar->CalcWindowSizePixel() );
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 13e0efca691e..2dceb5bb1116 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1619,7 +1619,6 @@ IMPL_LINK( ToolBarManager, MenuButton, ToolBox*, pToolBar, void )
 
     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 28367830c9f7..8e26d09b8982 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -158,7 +158,6 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments )
         {
             // Fill toolbar with container contents
             pToolBarManager->FillToolbar( m_xConfigData );
-            pToolBar->SetOutStyle( SvtMiscOptions().GetToolboxStyle() );
             pToolBar->EnableCustomize();
             ::Size aActSize( pToolBar->GetSizePixel() );
             ::Size aSize( pToolBar->CalcWindowSizePixel() );
@@ -173,7 +172,6 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments )
         m_bPersistent = false;
         if ( pToolBar && pToolBarManager )
         {
-            pToolBar->SetOutStyle( SvtMiscOptions().GetToolboxStyle() );
             pToolBar->EnableCustomize();
             ::Size aActSize( pToolBar->GetSizePixel() );
             ::Size aSize( pToolBar->CalcWindowSizePixel() );
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 88472346951c..38b5fe7fe875 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -499,7 +499,6 @@ class SvxSearchItem;
 
 #define SID_ATTR_METRIC                 TypedWhichId<SfxUInt16Item>(SID_OPTIONS_START +  8)
 #define SID_ATTR_DEFTABSTOP             (SID_OPTIONS_START + 14)
-#define SID_ATTR_BUTTON_OUTSTYLE3D      (SID_OPTIONS_START + 62)
 #define SID_ATTR_BUTTON_BIGSIZE         (SID_OPTIONS_START + 63)
 #define SID_ATTR_QUICKLAUNCHER          (SID_OPTIONS_START + 74)
 #define SID_ATTR_YEAR2000               (SID_OPTIONS_START + 87)
diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx
index a295aca97c0f..68396d39ea33 100644
--- a/include/svtools/miscopt.hxx
+++ b/include/svtools/miscopt.hxx
@@ -70,9 +70,6 @@ class SVT_DLLPUBLIC SvtMiscOptions final : public utl::detail::Options
         void        SetIconTheme(const OUString&);
         bool        IconThemeWasSetAutomatically();
 
-        sal_Int16   GetToolboxStyle() const;
-        void        SetToolboxStyle( sal_Int16 nStyle );
-
     private:
 
         /*-****************************************************************************************************
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 8546e3870418..98d60ba1d73b 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -43,8 +43,6 @@ class  PopupMenu;
 class VclMenuEvent;
 class StyleSettings;
 
-constexpr sal_uInt16 TOOLBOX_STYLE_FLAT = 0x0004;
-
 // item ids in the custom menu may not exceed this constant
 constexpr sal_uInt16 TOOLBOX_MENUITEM_START = 0x1000;
 
@@ -117,7 +115,6 @@ private:
     tools::Long                mnActivateCount;
     Degree10            mnImagesRotationAngle;
     sal_uInt16          mnLastFocusItemId;
-    sal_uInt16          mnOutStyle;
     sal_uInt16          mnHighItemId;
     sal_uInt16          mnCurItemId;
     sal_uInt16          mnDownItemId;
@@ -216,7 +213,6 @@ private:
 
 public:
     SAL_DLLPRIVATE void            ImplFloatControl( bool bStart, FloatingWindow* pWindow );
-    SAL_DLLPRIVATE void            ImplDisableFlatButtons();
 
     SAL_DLLPRIVATE int ImplGetDragWidth() const;
     static SAL_DLLPRIVATE int ImplGetDragWidth( const vcl::RenderContext& rRenderContext,
@@ -442,9 +438,6 @@ public:
     // read configuration to determine locking behaviour
     static bool         AlwaysLocked();
 
-    void                SetOutStyle( sal_uInt16 nNewStyle );
-    sal_uInt16          GetOutStyle() const { return mnOutStyle; }
-
     void                EnableCustomize( bool bEnable = true );
     bool                IsCustomize() const { return mbCustomize; }
 
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 0e72b08f566f..c9495eea5d16 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -127,11 +127,6 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
         {
             switch(nWhich)
             {
-                case SID_ATTR_BUTTON_OUTSTYLE3D :
-                    if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_OUTSTYLE3D ),
-                              aMiscOptions.GetToolboxStyle() != TOOLBOX_STYLE_FLAT)))
-                        bRet = true;
-                    break;
                 case SID_ATTR_BUTTON_BIGSIZE :
                 {
                     if( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_BIGSIZE ), aMiscOptions.AreCurrentSymbolsLarge() ) ) )
@@ -451,13 +446,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
     SvtMiscOptions aMiscOptions;
     std::shared_ptr< comphelper::ConfigurationChanges > batch(
         comphelper::ConfigurationChanges::create());
-    if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_OUTSTYLE3D), true, &pItem) )
-    {
-        DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) !=  nullptr, "BoolItem expected");
-        sal_uInt16 nOutStyle =
-            static_cast<const SfxBoolItem *>(pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT;
-        aMiscOptions.SetToolboxStyle( nOutStyle );
-    }
 
     if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), true, &pItem) )
     {
diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
index 104abcc9e294..7483ee8d193d 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -45,7 +45,6 @@ namespace sfx2
         SetBackground( Wallpaper() );
 
         m_aToolbox->SetSelectHdl( LINK( this, TitledDockingWindow, OnToolboxItemSelected ) );
-        m_aToolbox->SetOutStyle( TOOLBOX_STYLE_FLAT );
         m_aToolbox->SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetDialogColor() ) );
         m_aToolbox->Show();
         impl_resetToolBox();
diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx
index 1369f1a03606..db45394c9306 100644
--- a/sfx2/source/sidebar/PanelTitleBar.cxx
+++ b/sfx2/source/sidebar/PanelTitleBar.cxx
@@ -95,7 +95,6 @@ void PanelTitleBar::SetMoreOptionsCommand(const OUString& rsCommandName,
             VCLUnoHelper::GetInterface(maToolBox.get()),
             0, true));
     maToolBox->SetController(mnMenuItemIndex, xController);
-    maToolBox->SetOutStyle(TOOLBOX_STYLE_FLAT);
     maToolBox->SetQuickHelpText(
         mnMenuItemIndex,
         SfxResId(SFX_STR_SIDEBAR_MORE_OPTIONS));
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index 09cbfb832dcd..8eee18dd42ed 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -46,16 +46,14 @@ using namespace ::com::sun::star;
 // PROPERTYHANDLE defines must be sequential from zero for Commit/Load
 #define PROPERTYNAME_SYMBOLSET              "SymbolSet"
 #define PROPERTYHANDLE_SYMBOLSET                0
-#define PROPERTYNAME_TOOLBOXSTYLE           "ToolboxStyle"
-#define PROPERTYHANDLE_TOOLBOXSTYLE             1
 #define PROPERTYNAME_ICONTHEME              "SymbolStyle"
-#define PROPERTYHANDLE_SYMBOLSTYLE              2
+#define PROPERTYHANDLE_SYMBOLSTYLE              1
 #define PROPERTYNAME_DISABLEUICUSTOMIZATION "DisableUICustomization"
-#define PROPERTYHANDLE_DISABLEUICUSTOMIZATION   3
+#define PROPERTYHANDLE_DISABLEUICUSTOMIZATION   2
 #define PROPERTYNAME_SIDEBARICONSIZE        "SidebarIconSize"
-#define PROPERTYHANDLE_SIDEBARICONSIZE          4
+#define PROPERTYHANDLE_SIDEBARICONSIZE          3
 #define PROPERTYNAME_NOTEBOOKBARICONSIZE    "NotebookbarIconSize"
-#define PROPERTYHANDLE_NOTEBOOKBARICONSIZE      5
+#define PROPERTYHANDLE_NOTEBOOKBARICONSIZE      4
 
 class SvtMiscOptions_Impl : public ConfigItem
 {
@@ -68,8 +66,6 @@ private:
     ToolBoxButtonSize m_nNotebookbarIconSize;
     bool        m_bIsNotebookbarIconSizeRO;
     bool        m_bIsSymbolsStyleRO;
-    sal_Int16   m_nToolboxStyle;
-    bool        m_bIsToolboxStyleRO;
     bool        m_bDisableUICustomization;
     bool        m_bIconThemeWasSetAutomatically;
 
@@ -141,13 +137,6 @@ public:
         bool IconThemeWasSetAutomatically()
         {return m_bIconThemeWasSetAutomatically;}
 
-        // translate to VCL settings ( "0" = 3D, "1" = FLAT )
-        sal_Int16 GetToolboxStyle() const
-        { return m_nToolboxStyle ? TOOLBOX_STYLE_FLAT : 0; }
-
-        // translate from VCL settings
-        void SetToolboxStyle( sal_Int16 nStyle );
-
         void AddListenerLink( const Link<LinkParamNone*,void>& rLink );
         void RemoveListenerLink( const Link<LinkParamNone*,void>& rLink );
         void CallListeners();
@@ -182,8 +171,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
     , m_nNotebookbarIconSize( ToolBoxButtonSize::DontCare )
     , m_bIsNotebookbarIconSizeRO( false )
     , m_bIsSymbolsStyleRO( false )
-    , m_nToolboxStyle( 1 )
-    , m_bIsToolboxStyleRO( false )
     , m_bIconThemeWasSetAutomatically( false )
 {
     // Use our static list of configuration keys to get his values.
@@ -239,16 +226,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
                 break;
             }
 
-            case PROPERTYHANDLE_TOOLBOXSTYLE :
-            {
-                if( !(seqValues[nProperty] >>= m_nToolboxStyle) )
-                {
-                    OSL_FAIL("Wrong type of \"Misc\\ToolboxStyle\"!" );
-                }
-                m_bIsToolboxStyleRO = seqRO[nProperty];
-                break;
-            }
-
             case PROPERTYHANDLE_SYMBOLSTYLE :
             {
                 OUString aIconTheme;
@@ -326,13 +303,6 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames )
                                                                 m_nNotebookbarIconSize = static_cast<ToolBoxButtonSize>(nTmp);
                                                         }
                                                     break;
-            case PROPERTYHANDLE_TOOLBOXSTYLE        :   {
-                                                            if( !(seqValues[nProperty] >>= m_nToolboxStyle) )
-                                                            {
-                                                                OSL_FAIL("Wrong type of \"Misc\\ToolboxStyle\"!" );
-                                                            }
-                                                        }
-                                                    break;
             case PROPERTYHANDLE_SYMBOLSTYLE         :   {
                                                             OUString aIconTheme;
                                                             if (seqValues[nProperty] >>= aIconTheme)
@@ -366,13 +336,6 @@ void SvtMiscOptions_Impl::CallListeners()
         elem.Call( nullptr );
 }
 
-void SvtMiscOptions_Impl::SetToolboxStyle( sal_Int16 nStyle )
-{
-    m_nToolboxStyle = nStyle ? 1 : 0;
-    SetModified();
-    CallListeners();
-}
-
 void SvtMiscOptions_Impl::SetSymbolsSize( sal_Int16 nSet )
 {
     m_nSymbolsSize = nSet;
@@ -468,13 +431,6 @@ void SvtMiscOptions_Impl::ImplCommit()
                 break;
             }
 
-            case PROPERTYHANDLE_TOOLBOXSTYLE :
-            {
-                if ( !m_bIsToolboxStyleRO )
-                    seqValues[nProperty] <<= m_nToolboxStyle;
-                break;
-            }
-
             case PROPERTYHANDLE_SYMBOLSTYLE :
             {
                 if ( !m_bIsSymbolsStyleRO ) {
@@ -509,7 +465,6 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames()
     return Sequence<OUString>
     {
         PROPERTYNAME_SYMBOLSET,
-        PROPERTYNAME_TOOLBOXSTYLE,
         PROPERTYNAME_ICONTHEME,
         PROPERTYNAME_DISABLEUICUSTOMIZATION,
         PROPERTYNAME_SIDEBARICONSIZE,
@@ -616,16 +571,6 @@ bool SvtMiscOptions::DisableUICustomization() const
     return m_pImpl->DisableUICustomization();
 }
 
-sal_Int16 SvtMiscOptions::GetToolboxStyle() const
-{
-    return m_pImpl->GetToolboxStyle();
-}
-
-void SvtMiscOptions::SetToolboxStyle( sal_Int16 nStyle )
-{
-    m_pImpl->SetToolboxStyle( nStyle );
-}
-
 namespace
 {
     class theSvtMiscOptionsMutex :
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 863f4c9dbb09..84e9ec332966 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -72,7 +72,6 @@ void DecoToolBox::calcMinSize()
             aTbx->InsertItem( nId, GetItemImage( nId ) );
         }
     }
-    aTbx->SetOutStyle( TOOLBOX_STYLE_FLAT );
     maMinSize = aTbx->CalcWindowSizePixel();
 
     aTbx.disposeAndClear();
@@ -129,7 +128,6 @@ MenuBarWindow::MenuBarWindow( vcl::Window* pParent ) :
 
     m_aCloseBtn->maImage = Image(StockImage::Yes, SV_RESID_BITMAP_CLOSEDOC);
 
-    m_aCloseBtn->SetOutStyle(TOOLBOX_STYLE_FLAT);
     m_aCloseBtn->SetBackground();
     m_aCloseBtn->SetPaintTransparent(true);
     m_aCloseBtn->SetParentClipMode(ParentClipMode::NoClip);
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index ae9afe30250f..289f9e522954 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1109,7 +1109,6 @@ void ToolBox::ImplInitToolBoxData()
     mnRightBorder         = 0;
     mnBottomBorder        = 0;
     mnLastResizeDY        = 0;
-    mnOutStyle            = TOOLBOX_STYLE_FLAT; // force flat buttons since NWF
     mnHighItemId          = 0;
     mnCurItemId           = 0;
     mnDownItemId          = 0;
@@ -1358,8 +1357,6 @@ bool ToolBox::ImplCalcItem()
     if ( !mbCalc )
         return false;
 
-    ImplDisableFlatButtons();
-
     OutputDevice *pDefault = Application::GetDefaultDevice();
     float fScaleFactor = pDefault ? pDefault->GetDPIScaleFactor() : 1.0;
 
@@ -2560,8 +2557,6 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplToolItems::si
     // execute pending paint requests
     ImplCheckUpdate();
 
-    ImplDisableFlatButtons();
-
     rRenderContext.SetFillColor();
 
     ImplToolItem* pItem = &mpData->m_aItems[nPos];
@@ -2596,11 +2591,8 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplToolItems::si
     tools::Long    nImageOffY  = 0;
     DrawButtonFlags nStyle      = DrawButtonFlags::NONE;
 
-    // draw separators in flat style only
-    if ( (mnOutStyle & TOOLBOX_STYLE_FLAT) &&
-         (pItem->meType == ToolBoxItemType::SEPARATOR) &&
-         nPos > 0
-         )
+    // draw separators
+    if ( (pItem->meType == ToolBoxItemType::SEPARATOR) && nPos > 0 )
     {
         ImplDrawSeparator(rRenderContext, nPos, aButtonRect);
     }
@@ -2622,15 +2614,7 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplToolItems::si
         nStyle |= DrawButtonFlags::Pressed;
     }
 
-    if ( mnOutStyle & TOOLBOX_STYLE_FLAT )
-    {
-        ImplErase(rRenderContext, pItem->maRect, nHighlight != 0, bHasOpenPopup );
-    }
-    else
-    {
-        DecorationView aDecoView(&rRenderContext);
-        aDecoView.DrawButton(aButtonRect, nStyle);
-    }
+    ImplErase(rRenderContext, pItem->maRect, nHighlight != 0, bHasOpenPopup );
 
     nOffX += pItem->maRect.Left();
     nOffY += pItem->maRect.Top();
@@ -2944,8 +2928,6 @@ bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, bool bRepeat )
 
 bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, bool bCancel )
 {
-    ImplDisableFlatButtons();
-
     if ( !mpData )
         return false;
 
@@ -3054,8 +3036,6 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
     if ( ImplHandleMouseMove( rMEvt ) )
         return;
 
-    ImplDisableFlatButtons();
-
     Point aMousePos = rMEvt.GetPosPixel();
 
     // only highlight when the focus is not inside a child window of a toolbox
@@ -3118,7 +3098,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
         }
     }
 
-    if ( bDrawHotSpot && ( (mnOutStyle & TOOLBOX_STYLE_FLAT) || !mnOutStyle ) )
+    if ( bDrawHotSpot )
     {
         bool bClearHigh = true;
         if ( !rMEvt.IsLeaveWindow() && (mnCurPos == ITEM_NOTFOUND) )
@@ -3130,28 +3110,25 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
                 {
                     if ( (item.meType == ToolBoxItemType::BUTTON) && item.mbEnabled )
                     {
-                        if ( !mnOutStyle || (mnOutStyle & TOOLBOX_STYLE_FLAT) )
+                        bClearHigh = false;
+                        if ( mnHighItemId != item.mnId )
                         {
-                            bClearHigh = false;
-                            if ( mnHighItemId != item.mnId )
+                            if ( mnHighItemId )
+                            {
+                                ImplHideFocus();
+                                ImplToolItems::size_type nPos = GetItemPos( mnHighItemId );
+                                InvalidateItem(nPos);
+                                CallEventListeners( VclEventId::ToolboxHighlightOff, reinterpret_cast< void* >( nPos ) );
+                            }
+                            if ( mpData->mbMenubuttonSelected )
                             {
-                                if ( mnHighItemId )
-                                {
-                                    ImplHideFocus();
-                                    ImplToolItems::size_type nPos = GetItemPos( mnHighItemId );
-                                    InvalidateItem(nPos);
-                                    CallEventListeners( VclEventId::ToolboxHighlightOff, reinterpret_cast< void* >( nPos ) );
-                                }
-                                if ( mpData->mbMenubuttonSelected )
-                                {
-                                    // remove highlight from menubutton
-                                    InvalidateMenuButton();
-                                }
-                                mnHighItemId = item.mnId;
-                                InvalidateItem(nTempPos);
-                                ImplShowFocus();
-                                CallEventListeners( VclEventId::ToolboxHighlight );
+                                // remove highlight from menubutton
+                                InvalidateMenuButton();
                             }
+                            mnHighItemId = item.mnId;
+                            InvalidateItem(nTempPos);
+                            ImplShowFocus();
+                            CallEventListeners( VclEventId::ToolboxHighlight );
                         }
                     }
                     break;
@@ -4850,44 +4827,6 @@ void ToolBox::ImplHideFocus()
     }
 }
 
-void ToolBox::ImplDisableFlatButtons()
-{
-#ifdef _WIN32        // Check in the Windows registry if an AT tool wants no flat toolboxes
-    static bool bInit = false, bValue = false;
-    if( ! bInit )
-    {
-        bInit = true;
-        HKEY hkey;
-
-        if( ERROR_SUCCESS == RegOpenKeyW(HKEY_CURRENT_USER, L"Software\\LibreOffice\\Accessibility\\AtToolSupport", &hkey) )
-        {
-            DWORD dwType = 0;
-            wchar_t Data[6]; // possible values: "true", "false", "1", "0", DWORD
-            DWORD cbData = sizeof(Data);
-
-            if( ERROR_SUCCESS == RegQueryValueExW(hkey, L"DisableFlatToolboxButtons",
-                nullptr, &dwType, reinterpret_cast<LPBYTE>(Data), &cbData) )
-            {
-                switch (dwType)
-                {
-                    case REG_SZ:
-                        bValue = ((0 == wcsicmp(Data, L"1")) || (0 == wcsicmp(Data, L"true")));
-                        break;
-                    case REG_DWORD:
-                        bValue = static_cast<bool>(reinterpret_cast<DWORD *>(Data)[0]);
-                        break;
-                }
-            }
-            RegCloseKey(hkey);
-        }
-    }
-    if( bValue )
-        mnOutStyle &= ~TOOLBOX_STYLE_FLAT;
-#else
-    (void) this; // loplugin:staticmethods
-#endif
-}
-
 void ToolBox::SetToolbarLayoutMode( ToolBoxLayoutMode eLayout )
 {
     if ( meLayoutMode != eLayout )
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 56abd3cea7ae..047ca8c37621 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1376,27 +1376,6 @@ void ToolBox::SetHelpId( sal_uInt16 nItemId, const OString& rHelpId )
         pItem->maHelpId = rHelpId;
 }
 
-void ToolBox::SetOutStyle( sal_uInt16 nNewStyle )
-{
-    // always force flat looking toolbars since NWF
-    nNewStyle |= TOOLBOX_STYLE_FLAT;
-
-    if ( mnOutStyle == nNewStyle )
-        return;
-
-    mnOutStyle = nNewStyle;
-    ImplDisableFlatButtons();
-
-    // so as to redo the ButtonDevice
-    if ( !(mnOutStyle & TOOLBOX_STYLE_FLAT) )
-    {
-        mnMaxItemWidth  = 1;
-        mnMaxItemHeight = 1;
-    }
-
-    ImplInvalidate( true, true );
-}
-
 // disable key input if all items are disabled
 void ToolBox::ImplUpdateInputEnable()
 {


More information about the Libreoffice-commits mailing list