[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 6 16:17:18 UTC 2020


 include/sfx2/sidebar/Theme.hxx |   15 -------
 sfx2/source/sidebar/Theme.cxx  |   85 -----------------------------------------
 2 files changed, 4 insertions(+), 96 deletions(-)

New commits:
commit 124da70f50b526381a979d059e8e5f54c8717208
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Nov 6 13:14:48 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Nov 6 17:16:29 2020 +0100

    drop some unused sidebar theme properties and enums
    
    Change-Id: I6f5aa8e43f6f3fa5df530f9d73d64faf9152e85b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105406
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/sfx2/sidebar/Theme.hxx b/include/sfx2/sidebar/Theme.hxx
index a1500364d7d2..ebe5ec8b496a 100644
--- a/include/sfx2/sidebar/Theme.hxx
+++ b/include/sfx2/sidebar/Theme.hxx
@@ -87,10 +87,6 @@ public:
         Paint_TabItemBackgroundHighlight,
         Paint_HorizontalBorder,
         Paint_VerticalBorder,
-        Paint_ToolBoxBackground,
-        Paint_ToolBoxBorderTopLeft,
-        Paint_ToolBoxBorderCenterCorners,
-        Paint_ToolBoxBorderBottomRight,
         Paint_DropDownBackground,
 
         Paint_Int_,
@@ -118,13 +114,8 @@ public:
         Bool_UseSystemColors,
         Bool_IsHighContrastModeActive,
 
-        Bool_Rect_,
-
-        Rect_ToolBoxPadding,
-        Rect_ToolBoxBorder,
-
-        Post_Rect_,
-        End_=Post_Rect_
+        Post_Bool_,
+        End_=Post_Bool_
     };
 
     static Image GetImage (const ThemeItem eItem);
@@ -182,7 +173,6 @@ private:
     std::vector<Paint> maPaints;
     std::vector<sal_Int32> maIntegers;
     std::vector<bool> maBooleans;
-    std::vector<tools::Rectangle> maRectangles;
     bool mbIsHighContrastMode;
     bool mbIsHighContrastModeSetManually;
 
@@ -207,7 +197,6 @@ private:
         PT_Paint,
         PT_Integer,
         PT_Boolean,
-        PT_Rectangle,
         PT_Invalid
     };
 
diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx
index 51a0debdc997..a19b60f3d5d7 100644
--- a/sfx2/source/sidebar/Theme.cxx
+++ b/sfx2/source/sidebar/Theme.cxx
@@ -279,40 +279,6 @@ void Theme::UpdateTheme()
         setPropertyValue(
             maPropertyIdToNameMap[Image_CloseIndicator],
             Any(OUString("private:graphicrepository/cmd/lc_decrementlevel.png")));
-
-        // Gradient style
-        Color aGradientStop2 (aBaseBackgroundColor);
-        aGradientStop2.IncreaseLuminance(17);
-        Color aToolBoxBorderColor (aBaseBackgroundColor);
-        aToolBoxBorderColor.DecreaseLuminance(12);
-        setPropertyValue(
-            maPropertyIdToNameMap[Paint_ToolBoxBackground],
-            Any(Tools::VclToAwtGradient(Gradient(
-                        GradientStyle::Linear,
-                        aBaseBackgroundColor.GetRGBColor(),
-                        aGradientStop2.GetRGBColor()
-                        ))));
-        setPropertyValue(
-            maPropertyIdToNameMap[Paint_ToolBoxBorderTopLeft],
-            mbIsHighContrastMode
-                ? Any(util::Color(sal_uInt32(0x00ff00)))
-                : Any(util::Color(aToolBoxBorderColor.GetRGBColor())));
-        setPropertyValue(
-            maPropertyIdToNameMap[Paint_ToolBoxBorderCenterCorners],
-            mbIsHighContrastMode
-                ? Any(util::Color(sal_uInt32(0x00ff00)))
-                : Any(util::Color(aToolBoxBorderColor.GetRGBColor())));
-        setPropertyValue(
-            maPropertyIdToNameMap[Paint_ToolBoxBorderBottomRight],
-            mbIsHighContrastMode
-                ? Any(util::Color(sal_uInt32(0x00ff00)))
-                : Any(util::Color(aToolBoxBorderColor.GetRGBColor())));
-        setPropertyValue(
-            maPropertyIdToNameMap[Rect_ToolBoxPadding],
-            Any(awt::Rectangle(2,2,2,2)));
-        setPropertyValue(
-            maPropertyIdToNameMap[Rect_ToolBoxBorder],
-            Any(awt::Rectangle(1,1,1,1)));
     }
     catch(beans::UnknownPropertyException const &)
     {
@@ -578,13 +544,12 @@ sal_Bool SAL_CALL Theme::hasPropertyByName (const OUString& rsPropertyName)
 
 void Theme::SetupPropertyMaps()
 {
-    maPropertyIdToNameMap.resize(Post_Rect_);
+    maPropertyIdToNameMap.resize(Post_Bool_);
     maImages.resize(Image_Color_ - Pre_Image_ - 1);
     maColors.resize(Color_Paint_ - Image_Color_ - 1);
     maPaints.resize(Paint_Int_ - Color_Paint_ - 1);
     maIntegers.resize(Int_Bool_ - Paint_Int_ - 1);
-    maBooleans.resize(Bool_Rect_ - Int_Bool_ - 1);
-    maRectangles.resize(Post_Rect_ - Bool_Rect_ - 1);
+    maBooleans.resize(Post_Bool_ - Int_Bool_ - 1);
 
     maPropertyNameToIdMap["Image_Grip"]=Image_Grip;
     maPropertyIdToNameMap[Image_Grip]="Image_Grip";
@@ -657,18 +622,6 @@ void Theme::SetupPropertyMaps()
     maPropertyNameToIdMap["Paint_VerticalBorder"]=Paint_VerticalBorder;
     maPropertyIdToNameMap[Paint_VerticalBorder]="Paint_VerticalBorder";
 
-    maPropertyNameToIdMap["Paint_ToolBoxBackground"]=Paint_ToolBoxBackground;
-    maPropertyIdToNameMap[Paint_ToolBoxBackground]="Paint_ToolBoxBackground";
-
-    maPropertyNameToIdMap["Paint_ToolBoxBorderTopLeft"]=Paint_ToolBoxBorderTopLeft;
-    maPropertyIdToNameMap[Paint_ToolBoxBorderTopLeft]="Paint_ToolBoxBorderTopLeft";
-
-    maPropertyNameToIdMap["Paint_ToolBoxBorderCenterCorners"]=Paint_ToolBoxBorderCenterCorners;
-    maPropertyIdToNameMap[Paint_ToolBoxBorderCenterCorners]="Paint_ToolBoxBorderCenterCorners";
-
-    maPropertyNameToIdMap["Paint_ToolBoxBorderBottomRight"]=Paint_ToolBoxBorderBottomRight;
-    maPropertyIdToNameMap[Paint_ToolBoxBorderBottomRight]="Paint_ToolBoxBorderBottomRight";
-
     maPropertyNameToIdMap["Paint_DropDownBackground"]=Paint_DropDownBackground;
     maPropertyIdToNameMap[Paint_DropDownBackground]="Paint_DropDownBackground";
 
@@ -731,13 +684,6 @@ void Theme::SetupPropertyMaps()
     maPropertyNameToIdMap["Bool_IsHighContrastModeActive"]=Bool_IsHighContrastModeActive;
     maPropertyIdToNameMap[Bool_IsHighContrastModeActive]="Bool_IsHighContrastModeActive";
 
-
-    maPropertyNameToIdMap["Rect_ToolBoxPadding"]=Rect_ToolBoxPadding;
-    maPropertyIdToNameMap[Rect_ToolBoxPadding]="Rect_ToolBoxPadding";
-
-    maPropertyNameToIdMap["Rect_ToolBoxBorder"]=Rect_ToolBoxBorder;
-    maPropertyIdToNameMap[Rect_ToolBoxBorder]="Rect_ToolBoxBorder";
-
     maRawValues.resize(maPropertyIdToNameMap.size());
 }
 
@@ -772,10 +718,6 @@ Theme::PropertyType Theme::GetPropertyType (const ThemeItem eItem)
         case Paint_TabItemBackgroundHighlight:
         case Paint_HorizontalBorder:
         case Paint_VerticalBorder:
-        case Paint_ToolBoxBackground:
-        case Paint_ToolBoxBorderTopLeft:
-        case Paint_ToolBoxBorderCenterCorners:
-        case Paint_ToolBoxBorderBottomRight:
         case Paint_DropDownBackground:
             return PT_Paint;
 
@@ -802,10 +744,6 @@ Theme::PropertyType Theme::GetPropertyType (const ThemeItem eItem)
         case Bool_IsHighContrastModeActive:
             return PT_Boolean;
 
-        case Rect_ToolBoxBorder:
-        case Rect_ToolBoxPadding:
-            return PT_Rectangle;
-
         default:
             return PT_Invalid;
     }
@@ -830,9 +768,6 @@ css::uno::Type const & Theme::GetCppuType (const PropertyType eType)
         case PT_Boolean:
             return cppu::UnoType<sal_Bool>::get();
 
-        case PT_Rectangle:
-            return cppu::UnoType<awt::Rectangle>::get();
-
         case PT_Invalid:
         default:
             return cppu::UnoType<void>::get();
@@ -853,9 +788,6 @@ sal_Int32 Theme::GetIndex (const ThemeItem eItem, const PropertyType eType)
             return eItem - Paint_Int_-1;
         case PT_Boolean:
             return eItem - Int_Bool_-1;
-        case PT_Rectangle:
-            return eItem - Bool_Rect_-1;
-
         default:
             OSL_ASSERT(false);
             return 0;
@@ -1000,19 +932,6 @@ void Theme::ProcessNewValue (
             }
             break;
         }
-        case PT_Rectangle:
-        {
-            awt::Rectangle aBox;
-            if (rValue >>= aBox)
-            {
-                maRectangles[nIndex] = tools::Rectangle(
-                    aBox.X,
-                    aBox.Y,
-                    aBox.Width,
-                    aBox.Height);
-            }
-            break;
-        }
         case PT_Invalid:
             OSL_ASSERT(eType != PT_Invalid);
             throw RuntimeException();


More information about the Libreoffice-commits mailing list