[Libreoffice-commits] core.git: compilerplugins/clang include/vcl svtools/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 26 06:27:17 UTC 2018


 compilerplugins/clang/unusedenumconstants.readonly.results |   10 --
 include/vcl/button.hxx                                     |    4 -
 include/vcl/fixed.hxx                                      |    2 
 include/vcl/imgctrl.hxx                                    |    2 
 include/vcl/window.hxx                                     |    7 -
 svtools/source/brwbox/brwbox2.cxx                          |    6 -
 vcl/source/control/button.cxx                              |   46 +++----------
 vcl/source/control/combobox.cxx                            |    6 -
 vcl/source/control/edit.cxx                                |    6 -
 vcl/source/control/fixed.cxx                               |   40 +++--------
 vcl/source/control/imgctrl.cxx                             |   22 ++----
 vcl/source/control/listbox.cxx                             |    6 -
 vcl/source/control/spinfld.cxx                             |    2 
 vcl/source/edit/vclmedit.cxx                               |    6 -
 vcl/source/toolkit/group.cxx                               |   15 ----
 vcl/source/treelist/headbar.cxx                            |    2 
 16 files changed, 58 insertions(+), 124 deletions(-)

New commits:
commit 84d9785a04a1d4929505ef1d7958e0420eec43b6
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Nov 23 14:54:34 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Nov 26 07:26:54 2018 +0100

    remove unused DrawFlags enum values
    
    Change-Id: I3f313dfa085612d805ea54352793a3fb0356b986
    Reviewed-on: https://gerrit.libreoffice.org/63970
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results b/compilerplugins/clang/unusedenumconstants.readonly.results
index cd11353fcf84..94bab4fd2689 100644
--- a/compilerplugins/clang/unusedenumconstants.readonly.results
+++ b/compilerplugins/clang/unusedenumconstants.readonly.results
@@ -1106,16 +1106,6 @@ include/vcl/window.hxx:303
     enum StartTrackingFlags MouseButtonDown
 include/vcl/window.hxx:304
     enum StartTrackingFlags FocusCancel
-include/vcl/window.hxx:373
-    enum DrawFlags NoBorder
-include/vcl/window.hxx:375
-    enum DrawFlags NoDisable
-include/vcl/window.hxx:376
-    enum DrawFlags NoMnemonic
-include/vcl/window.hxx:377
-    enum DrawFlags NoSelection
-include/vcl/window.hxx:378
-    enum DrawFlags NoBackground
 include/xmloff/shapeexport.hxx:53
     enum XMLShapeExportFlags WIDTH
 include/xmloff/shapeexport.hxx:54
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 5bad4b5e2e15..98ac3ea9f7e9 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -49,9 +49,9 @@ private:
 public:
     SAL_DLLPRIVATE DrawButtonFlags  ImplGetButtonState() const;
     SAL_DLLPRIVATE DrawButtonFlags& ImplGetButtonState();
-    SAL_DLLPRIVATE DrawTextFlags    ImplGetTextStyle( OUString& rText, WinBits nWinStyle, DrawFlags nDrawFlags );
+    SAL_DLLPRIVATE DrawTextFlags    ImplGetTextStyle( WinBits nWinStyle, DrawFlags nDrawFlags );
     SAL_DLLPRIVATE void             ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, Size& rSize,
-                                              sal_uLong nImageSep, DrawFlags nDrawFlags,
+                                              sal_uLong nImageSep,
                                               DrawTextFlags nTextStyle, tools::Rectangle *pSymbolRect=nullptr, bool bAddImageSep = false );
     SAL_DLLPRIVATE void             ImplSetFocusRect( const tools::Rectangle &rFocusRect );
     SAL_DLLPRIVATE const tools::Rectangle& ImplGetFocusRect() const;
diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx
index 10a0263c5d40..7873c58de340 100644
--- a/include/vcl/fixed.hxx
+++ b/include/vcl/fixed.hxx
@@ -156,7 +156,7 @@ private:
     SAL_DLLPRIVATE static WinBits ImplInitStyle( WinBits nStyle );
 
 protected:
-    SAL_DLLPRIVATE void    ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
+    SAL_DLLPRIVATE void    ImplDraw( OutputDevice* pDev,
                               const Point& rPos, const Size& rSize );
 public:
     explicit        FixedImage( vcl::Window* pParent, WinBits nStyle = 0 );
diff --git a/include/vcl/imgctrl.hxx b/include/vcl/imgctrl.hxx
index f1aa5f3225d6..528f2046fd52 100644
--- a/include/vcl/imgctrl.hxx
+++ b/include/vcl/imgctrl.hxx
@@ -45,7 +45,7 @@ public:
     virtual void    LoseFocus() override;
 
 protected:
-    void    ImplDraw( OutputDevice& rDev, DrawFlags nDrawFlags, const Point& rPos, const Size& rSize ) const;
+    void    ImplDraw( OutputDevice& rDev, const Point& rPos, const Size& rSize ) const;
 };
 
 #endif // INCLUDED_VCL_IMGCTRL_HXX
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 6557c45434d1..99a6d2b6b599 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -370,16 +370,11 @@ enum class DrawFlags
 {
     NONE                = 0x0000,
     Mono                = 0x0001,
-    NoBorder            = 0x0002,
     NoControls          = 0x0004,
-    NoDisable           = 0x0008,
-    NoMnemonic          = 0x0010,
-    NoSelection         = 0x0020,
-    NoBackground        = 0x0040,
 };
 namespace o3tl
 {
-    template<> struct typed_flags<DrawFlags> : is_typed_flags<DrawFlags, 0x007f> {};
+    template<> struct typed_flags<DrawFlags> : is_typed_flags<DrawFlags, 0x0005> {};
 }
 
 // DialogControl-Flags
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 2674b5488694..7944ab7bb565 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -633,8 +633,6 @@ void BrowseBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
 
 void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags )
 {
-    bool bDrawSelection = !(nFlags & DrawFlags::NoSelection);
-
     // we need pixel coordinates
     Size aRealSize = pDev->LogicToPixel(rSize);
     Point aRealPos = pDev->LogicToPixel(rPos);
@@ -745,7 +743,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
     pDev->SetClipRegion( pDev->PixelToLogic( aRegion ) );
 
     // do we have to paint the background
-    bool bBackground = !(nFlags & DrawFlags::NoBackground) && pDataWin->IsControlBackground();
+    bool bBackground = pDataWin->IsControlBackground();
     if ( bBackground )
     {
         tools::Rectangle aRect( aRealPos, aRealSize );
@@ -753,7 +751,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
         pDev->DrawRect( aRect );
     }
 
-    ImplPaintData( *pDev, tools::Rectangle( aRealPos, aRealSize ), true, bDrawSelection );
+    ImplPaintData( *pDev, tools::Rectangle( aRealPos, aRealSize ), true, /*bDrawSelection*/true );
 
     // restore the column widths/data row height
     nDataRowHeight = nOriginalHeight;
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 4ac8c03cc32b..b5e889d92e0d 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -202,25 +202,13 @@ void Button::ImplSetSeparatorX( long nX )
     mpButtonData->mnSeparatorX = nX;
 }
 
-DrawTextFlags Button::ImplGetTextStyle(OUString& rText, WinBits nWinStyle, DrawFlags nDrawFlags )
+DrawTextFlags Button::ImplGetTextStyle( WinBits nWinStyle, DrawFlags nDrawFlags )
 {
     const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
     DrawTextFlags nTextStyle = FixedText::ImplGetTextStyle(nWinStyle & ~WB_DEFBUTTON);
 
-    if (nDrawFlags & DrawFlags::NoMnemonic)
-    {
-        if (nTextStyle & DrawTextFlags::Mnemonic)
-        {
-            rText = GetNonMnemonicString( rText );
-            nTextStyle &= ~DrawTextFlags::Mnemonic;
-        }
-    }
-
-    if (!(nDrawFlags & DrawFlags::NoDisable))
-    {
-        if (!IsEnabled())
-            nTextStyle |= DrawTextFlags::Disable;
-    }
+    if (!IsEnabled())
+        nTextStyle |= DrawTextFlags::Disable;
 
     if ((nDrawFlags & DrawFlags::Mono) ||
         (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono))
@@ -233,7 +221,7 @@ DrawTextFlags Button::ImplGetTextStyle(OUString& rText, WinBits nWinStyle, DrawF
 
 void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos,
                                   Size& rSize,
-                                  sal_uLong nImageSep, DrawFlags nDrawFlags,
+                                  sal_uLong nImageSep,
                                   DrawTextFlags nTextStyle, tools::Rectangle *pSymbolRect,
                                   bool bAddImageSep)
 {
@@ -251,13 +239,6 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos,
     ImageAlign eImageAlign = mpButtonData->meImageAlign;
     Size aImageSize = mpButtonData->maImage.GetSizePixel();
 
-    if ((nDrawFlags & DrawFlags::NoMnemonic) &&
-        (nTextStyle & DrawTextFlags::Mnemonic))
-    {
-        aText = GetNonMnemonicString(aText);
-        nTextStyle &= ~DrawTextFlags::Mnemonic;
-    }
-
     aImageSize.setWidth( CalcZoom( aImageSize.Width() ) );
     aImageSize.setHeight( CalcZoom( aImageSize.Height() ) );
 
@@ -482,8 +463,7 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos,
 
     DrawImageFlags nStyle = DrawImageFlags::NONE;
 
-    if (!(nDrawFlags & DrawFlags::NoDisable) &&
-        !IsEnabled())
+    if (!IsEnabled())
     {
         nStyle |= DrawImageFlags::Disable;
     }
@@ -786,7 +766,7 @@ DrawTextFlags PushButton::ImplGetTextStyle( DrawFlags nDrawFlags ) const
     else
         nTextStyle |= DrawTextFlags::VCenter;
 
-    if ( ! ( (nDrawFlags & DrawFlags::NoDisable) || IsEnabled() ) )
+    if ( !IsEnabled() )
         nTextStyle |= DrawTextFlags::Disable;
 
     return nTextStyle;
@@ -857,7 +837,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl
 
     pDev->SetTextColor( aColor );
 
-    if ( IsEnabled() || (nDrawFlags & DrawFlags::NoDisable) )
+    if ( IsEnabled() )
         nStyle = DrawSymbolFlags::NONE;
     else
         nStyle = DrawSymbolFlags::Disable;
@@ -886,7 +866,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl
             aSymbolRect.SetLeft( aSymbolRect.Right() - nSymbolSize );
 
             ImplDrawAlignedImage( pDev, aPos, aSize, nImageSep,
-                                  nDrawFlags, nTextStyle, nullptr, true );
+                                  nTextStyle, nullptr, true );
         }
         else
             ImplCalcSymbolRect( aSymbolRect );
@@ -907,7 +887,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl
     else
     {
         tools::Rectangle aSymbolRect;
-        ImplDrawAlignedImage( pDev, aPos, aSize, nImageSep, nDrawFlags,
+        ImplDrawAlignedImage( pDev, aPos, aSize, nImageSep,
                               nTextStyle, IsSymbol() ? &aSymbolRect : nullptr, true );
 
         if ( IsSymbol() )
@@ -2042,7 +2022,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
         if ( ( !aText.isEmpty() && ! (ImplGetButtonState() & DrawButtonFlags::NoText) ) ||
              ( HasImage() &&  ! (ImplGetButtonState() & DrawButtonFlags::NoImage) ) )
         {
-            DrawTextFlags nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+            DrawTextFlags nTextStyle = Button::ImplGetTextStyle( nWinStyle, nDrawFlags );
 
             const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
             Size aSize( rSize );
@@ -2060,7 +2040,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
                 aSize.setHeight( rImageSize.Height() );
             }
 
-            ImplDrawAlignedImage( pDev, aPos, aSize, 1, nDrawFlags, nTextStyle );
+            ImplDrawAlignedImage( pDev, aPos, aSize, 1, nTextStyle );
 
             rMouseRect          = tools::Rectangle( aPos, aSize );
             rMouseRect.SetLeft( rPos.X() );
@@ -3050,7 +3030,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
     if ( ( !aText.isEmpty() && ! (ImplGetButtonState() & DrawButtonFlags::NoText) ) ||
          ( HasImage() && !  (ImplGetButtonState() & DrawButtonFlags::NoImage) ) )
     {
-        DrawTextFlags nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+        DrawTextFlags nTextStyle = Button::ImplGetTextStyle( nWinStyle, nDrawFlags );
 
         const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
         Size aSize( rSize );
@@ -3068,7 +3048,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
             aSize.setHeight( rImageSize.Height() );
         }
 
-        ImplDrawAlignedImage( pDev, aPos, aSize, 1, nDrawFlags, nTextStyle );
+        ImplDrawAlignedImage( pDev, aPos, aSize, 1, nTextStyle );
 
         rMouseRect          = tools::Rectangle( aPos, aSize );
         rMouseRect.SetLeft( rPos.X() );
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 91901b883882..8dee63269d0e 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -1178,8 +1178,8 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, D
     // Border/Background
     pDev->SetLineColor();
     pDev->SetFillColor();
-    bool bBorder = !(nFlags & DrawFlags::NoBorder ) && (GetStyle() & WB_BORDER);
-    bool bBackground = !(nFlags & DrawFlags::NoBackground) && IsControlBackground();
+    bool bBorder = (GetStyle() & WB_BORDER);
+    bool bBackground = IsControlBackground();
     if ( bBorder || bBackground )
     {
         tools::Rectangle aRect( aPos, aSize );
@@ -1220,7 +1220,7 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, D
         }
         else
         {
-            if ( !(nFlags & DrawFlags::NoDisable ) && !IsEnabled() )
+            if ( !IsEnabled() )
             {
                 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
                 pDev->SetTextColor( rStyleSettings.GetDisableColor() );
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 56563c48c96c..795f1e828f4e 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1755,8 +1755,8 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawF
     // Border/Background
     pDev->SetLineColor();
     pDev->SetFillColor();
-    bool bBorder = !(nFlags & DrawFlags::NoBorder ) && (GetStyle() & WB_BORDER);
-    bool bBackground = !(nFlags & DrawFlags::NoBackground) && IsControlBackground();
+    bool bBorder = (GetStyle() & WB_BORDER);
+    bool bBackground = IsControlBackground();
     if ( bBorder || bBackground )
     {
         tools::Rectangle aRect( aPos, aSize );
@@ -1776,7 +1776,7 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawF
         pDev->SetTextColor( COL_BLACK );
     else
     {
-        if ( !(nFlags & DrawFlags::NoDisable ) && !IsEnabled() )
+        if ( !IsEnabled() )
         {
             const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
             pDev->SetTextColor( rStyleSettings.GetDisableColor() );
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 435c0b6a6a67..a43ea3165c95 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -153,19 +153,8 @@ void FixedText::ImplDraw(OutputDevice* pDev, DrawFlags nDrawFlags,
         nTextStyle &= ~DrawTextFlags(DrawTextFlags::EndEllipsis | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak);
         nTextStyle |= DrawTextFlags::PathEllipsis;
     }
-    if ( nDrawFlags & DrawFlags::NoMnemonic )
-    {
-        if ( nTextStyle & DrawTextFlags::Mnemonic )
-        {
-            aText = GetNonMnemonicString( aText );
-            nTextStyle &= ~DrawTextFlags::Mnemonic;
-        }
-    }
-    if ( !(nDrawFlags & DrawFlags::NoDisable) )
-    {
-        if ( !IsEnabled() )
-            nTextStyle |= DrawTextFlags::Disable;
-    }
+    if ( !IsEnabled() )
+        nTextStyle |= DrawTextFlags::Disable;
     if ( (nDrawFlags & DrawFlags::Mono) ||
          (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) )
         nTextStyle |= DrawTextFlags::Mono;
@@ -232,8 +221,8 @@ void FixedText::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
         pDev->SetTextColor( GetTextColor() );
     pDev->SetTextFillColor();
 
-    bool bBorder = !(nFlags & DrawFlags::NoBorder ) && (GetStyle() & WB_BORDER);
-    bool bBackground = !(nFlags & DrawFlags::NoBackground) && IsControlBackground();
+    bool bBorder = (GetStyle() & WB_BORDER);
+    bool bBackground = IsControlBackground();
     if ( bBorder || bBackground )
     {
         tools::Rectangle aRect( aPos, aSize );
@@ -735,7 +724,7 @@ void FixedBitmap::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang
 }
 
 void FixedBitmap::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
-                        DrawFlags nFlags )
+                        DrawFlags )
 {
     Point       aPos  = pDev->LogicToPixel( rPos );
     Size        aSize = pDev->LogicToPixel( rSize );
@@ -745,7 +734,7 @@ void FixedBitmap::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize
     pDev->SetMapMode();
 
     // Border
-    if ( !(nFlags & DrawFlags::NoBorder) && (GetStyle() & WB_BORDER) )
+    if ( GetStyle() & WB_BORDER )
     {
         DecorationView aDecoView( pDev );
         aRect = aDecoView.DrawFrame( aRect, DrawFrameStyle::DoubleIn );
@@ -825,15 +814,12 @@ FixedImage::FixedImage( vcl::Window* pParent, WinBits nStyle ) :
     ImplInit( pParent, nStyle );
 }
 
-void FixedImage::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
+void FixedImage::ImplDraw( OutputDevice* pDev,
                            const Point& rPos, const Size& rSize )
 {
     DrawImageFlags nStyle = DrawImageFlags::NONE;
-    if ( !(nDrawFlags & DrawFlags::NoDisable) )
-    {
-        if ( !IsEnabled() )
-            nStyle |= DrawImageFlags::Disable;
-    }
+    if ( !IsEnabled() )
+        nStyle |= DrawImageFlags::Disable;
 
     Image *pImage = &maImage;
 
@@ -876,7 +862,7 @@ void FixedImage::ApplySettings(vcl::RenderContext& rRenderContext)
 
 void FixedImage::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
 {
-    ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel());
+    ImplDraw(&rRenderContext, Point(), GetOutputSizePixel());
 }
 
 Size FixedImage::GetOptimalSize() const
@@ -885,7 +871,7 @@ Size FixedImage::GetOptimalSize() const
 }
 
 void FixedImage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
-                       DrawFlags nFlags )
+                       DrawFlags )
 {
     Point       aPos  = pDev->LogicToPixel( rPos );
     Size        aSize = pDev->LogicToPixel( rSize );
@@ -895,12 +881,12 @@ void FixedImage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
     pDev->SetMapMode();
 
     // Border
-    if ( !(nFlags & DrawFlags::NoBorder) && (GetStyle() & WB_BORDER) )
+    if ( GetStyle() & WB_BORDER )
     {
         ImplDrawFrame( pDev, aRect );
     }
     pDev->IntersectClipRegion( aRect );
-    ImplDraw( pDev, nFlags, aRect.TopLeft(), aRect.GetSize() );
+    ImplDraw( pDev, aRect.TopLeft(), aRect.GetSize() );
 
     pDev->Pop();
 }
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index b25f35febcd2..29d7f171ad39 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -67,14 +67,11 @@ namespace
     }
 }
 
-void ImageControl::ImplDraw(OutputDevice& rDev, DrawFlags nDrawFlags, const Point& rPos, const Size& rSize) const
+void ImageControl::ImplDraw(OutputDevice& rDev, const Point& rPos, const Size& rSize) const
 {
     DrawImageFlags nStyle = DrawImageFlags::NONE;
-    if ( !(nDrawFlags & DrawFlags::NoDisable) )
-    {
-        if ( !IsEnabled() )
-            nStyle |= DrawImageFlags::Disable;
-    }
+    if ( !IsEnabled() )
+        nStyle |= DrawImageFlags::Disable;
 
     const Image& rImage( GetModeImage() );
     const tools::Rectangle aDrawRect( rPos, rSize );
@@ -86,9 +83,8 @@ void ImageControl::ImplDraw(OutputDevice& rDev, DrawFlags nDrawFlags, const Poin
 
         WinBits nWinStyle = GetStyle();
         DrawTextFlags nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
-        if ( !(nDrawFlags & DrawFlags::NoDisable) )
-            if ( !IsEnabled() )
-                nTextStyle |= DrawTextFlags::Disable;
+        if ( !IsEnabled() )
+            nTextStyle |= DrawTextFlags::Disable;
 
         rDev.DrawText( aDrawRect, sText, nTextStyle );
         return;
@@ -129,7 +125,7 @@ void ImageControl::ImplDraw(OutputDevice& rDev, DrawFlags nDrawFlags, const Poin
 
 void ImageControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/)
 {
-    ImplDraw(rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel());
+    ImplDraw(rRenderContext, Point(), GetOutputSizePixel());
 
     if (!HasFocus())
         return;
@@ -154,7 +150,7 @@ void ImageControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
 
 }
 
-void ImageControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags )
+void ImageControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags )
 {
     const Point     aPos  = pDev->LogicToPixel( rPos );
     const Size      aSize = pDev->LogicToPixel( rSize );
@@ -164,12 +160,12 @@ void ImageControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSiz
     pDev->SetMapMode();
 
     // Border
-    if ( !(nFlags & DrawFlags::NoBorder) && (GetStyle() & WB_BORDER) )
+    if ( GetStyle() & WB_BORDER )
     {
         ImplDrawFrame( pDev, aRect );
     }
     pDev->IntersectClipRegion( aRect );
-    ImplDraw( *pDev, nFlags, aRect.TopLeft(), aRect.GetSize() );
+    ImplDraw( *pDev, aRect.TopLeft(), aRect.GetSize() );
 
     pDev->Pop();
 }
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index d1ee6e2a876a..e109e135d0d4 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -342,8 +342,8 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Dr
     // Border/Background
     pDev->SetLineColor();
     pDev->SetFillColor();
-    bool bBorder = !(nFlags & DrawFlags::NoBorder ) && (GetStyle() & WB_BORDER);
-    bool bBackground = !(nFlags & DrawFlags::NoBackground) && IsControlBackground();
+    bool bBorder = (GetStyle() & WB_BORDER);
+    bool bBackground = IsControlBackground();
     if ( bBorder || bBackground )
     {
         tools::Rectangle aRect( aPos, aSize );
@@ -365,7 +365,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Dr
     }
     else
     {
-        if ( !(nFlags & DrawFlags::NoDisable ) && !IsEnabled() )
+        if ( !IsEnabled() )
         {
             const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
             pDev->SetTextColor( rStyleSettings.GetDisableColor() );
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index acc132e537f2..dd7d6561c554 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -1001,7 +1001,7 @@ void SpinField::Draw(OutputDevice* pDev, const Point& rPos, const Size& rSize, D
     {
         DecorationView aView( pDev );
         tools::Rectangle aInnerRect = aView.DrawButton( aDD, DrawButtonFlags::NoLightBorder );
-        DrawSymbolFlags nSymbolStyle = (IsEnabled() || (nFlags & DrawFlags::NoDisable)) ? DrawSymbolFlags::NONE : DrawSymbolFlags::Disable;
+        DrawSymbolFlags nSymbolStyle = IsEnabled() ? DrawSymbolFlags::NONE : DrawSymbolFlags::Disable;
         aView.DrawSymbol(aInnerRect, SymbolType::SPIN_DOWN, aButtonTextColor, nSymbolStyle);
     }
 
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 10c6f20c0bb9..263d8231c715 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -1338,8 +1338,8 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size&
     // Border/Background
     pDev->SetLineColor();
     pDev->SetFillColor();
-    bool bBorder = !(nFlags & DrawFlags::NoBorder ) && (GetStyle() & WB_BORDER);
-    bool bBackground = !(nFlags & DrawFlags::NoBackground) && IsControlBackground();
+    bool bBorder = (GetStyle() & WB_BORDER);
+    bool bBackground = IsControlBackground();
     if ( bBorder || bBackground )
     {
         tools::Rectangle aRect( aPos, aSize );
@@ -1360,7 +1360,7 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size&
         pDev->SetTextColor( COL_BLACK );
     else
     {
-        if ( !(nFlags & DrawFlags::NoDisable ) && !IsEnabled() )
+        if ( !IsEnabled() )
         {
             const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
             pDev->SetTextColor( rStyleSettings.GetDisableColor() );
diff --git a/vcl/source/toolkit/group.cxx b/vcl/source/toolkit/group.cxx
index 8ef95d4ff587..0743518f8ba1 100644
--- a/vcl/source/toolkit/group.cxx
+++ b/vcl/source/toolkit/group.cxx
@@ -101,19 +101,8 @@ void GroupBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
 
     if ( GetStyle() & WB_NOLABEL )
         nTextStyle &= ~DrawTextFlags::Mnemonic;
-    if ( nDrawFlags & DrawFlags::NoMnemonic )
-    {
-        if ( nTextStyle & DrawTextFlags::Mnemonic )
-        {
-            aText = GetNonMnemonicString( aText );
-            nTextStyle &= ~DrawTextFlags::Mnemonic;
-        }
-    }
-    if ( !(nDrawFlags & DrawFlags::NoDisable) )
-    {
-        if ( !IsEnabled() )
-            nTextStyle |= DrawTextFlags::Disable;
-    }
+    if ( !IsEnabled() )
+        nTextStyle |= DrawTextFlags::Disable;
     if ( (nDrawFlags & DrawFlags::Mono) ||
          (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) )
     {
diff --git a/vcl/source/treelist/headbar.cxx b/vcl/source/treelist/headbar.cxx
index 07f32358af54..0523ffa21699 100644
--- a/vcl/source/treelist/headbar.cxx
+++ b/vcl/source/treelist/headbar.cxx
@@ -935,7 +935,7 @@ void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
         pDev->SetTextColor( GetTextColor() );
     pDev->SetTextFillColor();
 
-    if ( !(nFlags & DrawFlags::NoBackground) )
+    // draw background
     {
         pDev->DrawWallpaper( aRect, GetBackground() );
         if ( mnBorderOff1 || mnBorderOff2 )


More information about the Libreoffice-commits mailing list