Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


The attached patch removes from DecorationView some unused (according to "grep -r BUTTON_DRAW_ *, performed at top level) button styles with the related code.

Matteo
From e5097ddf0c1753b44b2a23dcfb51ba761b899adf Mon Sep 17 00:00:00 2001
From: Matteo Casalin <matteo.casalin@poste.it>
Date: Sun, 4 Dec 2011 23:20:40 +0100
Subject: [PATCH 1/2] DecoView cleanup - remove unused button styles

---
 vcl/inc/vcl/decoview.hxx       |    5 +----
 vcl/source/window/decoview.cxx |   29 +++++------------------------
 2 files changed, 6 insertions(+), 28 deletions(-)

diff --git a/vcl/inc/vcl/decoview.hxx b/vcl/inc/vcl/decoview.hxx
index 63434be..64b738e 100644
--- a/vcl/inc/vcl/decoview.hxx
+++ b/vcl/inc/vcl/decoview.hxx
@@ -76,12 +76,9 @@ class OutputDevice;
 #define BUTTON_DRAW_DISABLED                ((sal_uInt16)0x0080)
 #define BUTTON_DRAW_HIGHLIGHT               ((sal_uInt16)0x0100)
 #define BUTTON_DRAW_FLAT                    ((sal_uInt16)0x0200)
-#define BUTTON_DRAW_NOTOPLIGHTBORDER        ((sal_uInt16)0x0400)
-#define BUTTON_DRAW_NOBOTTOMSHADOWBORDER    ((sal_uInt16)0x0800)
 #define BUTTON_DRAW_NOLEFTLIGHTBORDER       ((sal_uInt16)0x1000)
 #define BUTTON_DRAW_NOTEXT                  ((sal_uInt16)0x2000)
-#define BUTTON_DRAW_NOIMAGE             ((sal_uInt16)0x4000)
-#define BUTTON_DRAW_NODRAW                  ((sal_uInt16)0x8000)
+#define BUTTON_DRAW_NOIMAGE                 ((sal_uInt16)0x4000)
 
 // ------------------
 // - DecorationView -
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index ec46b89..1958cd6 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -589,22 +589,6 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect,
         }
         else
         {
-            if ( nStyle & BUTTON_DRAW_NOTOPLIGHTBORDER )
-            {
-                pDev->SetLineColor( rStyleSettings.GetLightBorderColor() );
-                pDev->DrawLine( Point( aFillRect.Left(), aFillRect.Top()),
-                                Point( aFillRect.Right(), aFillRect.Top() ) );
-                ++aFillRect.Top();
-            }
-            if ( (( (nStyle & BUTTON_DRAW_NOBOTTOMSHADOWBORDER) | BUTTON_DRAW_FLAT) == 
(BUTTON_DRAW_NOBOTTOMSHADOWBORDER | BUTTON_DRAW_FLAT)) &&
-                    !(nStyle & BUTTON_DRAW_HIGHLIGHT) )
-            {
-                pDev->SetLineColor( rStyleSettings.GetDarkShadowColor() );
-                pDev->DrawLine( Point( aFillRect.Left(), aFillRect.Bottom() ),
-                                Point( aFillRect.Right(), aFillRect.Bottom() ) );
-                --aFillRect.Bottom();
-            }
-
             if ( nStyle & BUTTON_DRAW_NOLIGHTBORDER )
                 aColor1 = rStyleSettings.GetLightBorderColor();
             else
@@ -1024,14 +1008,11 @@ Rectangle DecorationView::DrawButton( const Rectangle& rRect, sal_uInt16 
nStyle
         mpOutDev->EnableMapMode( false );
     }
 
-    if ( !(nStyle & BUTTON_DRAW_NODRAW) )
-    {
-        const Color maOldLineColor = mpOutDev->GetLineColor();
-        const Color maOldFillColor = mpOutDev->GetFillColor();
-        ImplDrawButton( mpOutDev, aRect, nStyle );
-        mpOutDev->SetLineColor( maOldLineColor );
-        mpOutDev->SetFillColor( maOldFillColor );
-    }
+    const Color maOldLineColor = mpOutDev->GetLineColor();
+    const Color maOldFillColor = mpOutDev->GetFillColor();
+    ImplDrawButton( mpOutDev, aRect, nStyle );
+    mpOutDev->SetLineColor( maOldLineColor );
+    mpOutDev->SetFillColor( maOldFillColor );
 
     // Ein Border freilassen, der jedoch bei Default-Darstellung
     // mitbenutzt wird
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.