[Libreoffice-commits] core.git: Branch 'feature/sidebar' - include/svx svx/source

Armin Le Grand alg at apache.org
Mon May 6 13:03:36 PDT 2013


 include/svx/dialogs.hrc                            |    3 +-
 svx/source/sidebar/line/LinePropertyPanel.cxx      |   17 ++++++-----
 svx/source/sidebar/line/LinePropertyPanel.hrc      |    1 
 svx/source/sidebar/line/LinePropertyPanel.src      |    4 --
 svx/source/sidebar/paragraph/ParaPropertyPanel.cxx |   21 +++++++++-----
 svx/source/sidebar/paragraph/ParaPropertyPanel.hxx |    1 
 svx/source/sidebar/paragraph/ParaPropertyPanel.src |   14 +++------
 svx/source/sidebar/text/TextPropertyPanel.cxx      |   30 +++++++++++----------
 svx/source/sidebar/text/TextPropertyPanel.hxx      |    2 -
 svx/source/sidebar/text/TextPropertyPanel.src      |    2 -
 10 files changed, 45 insertions(+), 50 deletions(-)

New commits:
commit 79364079bcc741b932b263636b320b792b5af5f0
Author: Armin Le Grand <alg at apache.org>
Date:   Wed Apr 17 12:15:11 2013 +0000

    Related: #i122041# Added 'Automatic' to TextPropertyPanel, FontColor...
    
    and HilightColor. Added 'No Color' to ParagraphPropertyPanel and
    BackgroundColor
    
    (cherry picked from commit 6b722f7d7c1ae5a1b344a24442bd591afba8606b)
    
    Conflicts:
    	svx/inc/svx/dialogs.hrc
    
    Change-Id: If75bdb87a1fc43e753c8c8ab15370808235926fd

diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 08ff470..4cfa8c5 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -26,7 +26,7 @@
 // Resource-Id's ------------------------------------------------------------
 
 // !!! IMPORTANT: consider and update FIRSTFREE when introducing new RIDs !!! (not for RIDs for Strings - they have there own)
-#define RID_SVX_FIRSTFREE                   332
+#define RID_SVX_FIRSTFREE                   333
 
 // some strings also used in CUI
 #define RID_SVXERRCTX                       (RID_SVX_START + 351)
@@ -270,6 +270,7 @@
 #define RID_POPUPPANEL_PARAPAGE_LINESPACING (RID_SVX_START + 329)
 #define RID_POPUPPANEL_PARAPAGE_BULLETS     (RID_SVX_START + 330)
 #define RID_POPUPPANEL_PARAPAGE_NUMBERING   (RID_SVX_START + 331)
+#define RID_POPUPPANEL_PARAPAGE_BACK_COLOR  (RID_SVX_START + 332)
 
 // !!! IMPORTANT: consider and update RID_SVX_FIRSTFREE when introducing new RIDs !!! (see above)
 
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index 8172091..d58ad83 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -83,11 +83,6 @@ namespace {
         return bFound ? n : -1;
     }
 
-    Color GetTransparentColor (void)
-    {
-        return COL_TRANSPARENT;
-    }
-
     void FillLineEndListBox(ListBox& rListBoxStart, ListBox& rListBoxEnd, const XLineEndList& rList)
     {
         const sal_uInt32 nCount(rList.Count());
@@ -898,10 +893,16 @@ IMPL_LINK( LinePropertyPanel, ChangeTransparentHdl, void *, EMPTYARG )
 
 
 
-PopupControl* LinePropertyPanel::CreateColorPopupControl (PopupContainer* pParent)
+namespace
 {
-    const ResId aResId(SVX_RES(STR_AUTOMATICE));
+    Color GetTransparentColor (void)
+    {
+        return COL_TRANSPARENT;
+    }
+} // end of anonymous namespace
 
+PopupControl* LinePropertyPanel::CreateColorPopupControl (PopupContainer* pParent)
+{
     return new ColorControl(
         pParent,
         mpBindings,
@@ -910,7 +911,7 @@ PopupControl* LinePropertyPanel::CreateColorPopupControl (PopupContainer* pParen
         ::boost::bind(GetTransparentColor),
         ::boost::bind(&LinePropertyPanel::SetColor, this, _1, _2),
         pParent,
-        &aResId);
+        0);
 }
 
 
diff --git a/svx/source/sidebar/line/LinePropertyPanel.hrc b/svx/source/sidebar/line/LinePropertyPanel.hrc
index 740741c..13c446e 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.hrc
+++ b/svx/source/sidebar/line/LinePropertyPanel.hrc
@@ -58,7 +58,6 @@
 
 //color popup page
 #define VS_COLOR        1
-#define STR_AUTOMATICE  2
 
 //style popup page
 #define VS_STYLE                1
diff --git a/svx/source/sidebar/line/LinePropertyPanel.src b/svx/source/sidebar/line/LinePropertyPanel.src
index 7adc42f..e904958 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.src
+++ b/svx/source/sidebar/line/LinePropertyPanel.src
@@ -288,10 +288,6 @@ Control RID_POPUPPANEL_LINEPAGE_COLOR
         TabStop = TRUE ;
         Text = "Color";
     };
-    String STR_AUTOMATICE
-    {
-        Text [ en-US ] = "No Color";
-    };
 };
 Control RID_POPUPPANEL_LINEPAGE_STYLE
 {
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 36ce007..76dd922 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -757,11 +757,6 @@ void ParaPropertyPanel::ParaBKGStateChanged(sal_uInt16 /*nSID*/, SfxItemState eS
     }
 }
 
-Color ParaPropertyPanel::GetBGColor (void) const
-{
-    return maColor;
-}
-
 void ParaPropertyPanel::SetBGColor (
     const String& /*rsColorName*/,
     const Color aColor)
@@ -1528,17 +1523,27 @@ PopupControl* ParaPropertyPanel::CreateNumberingPopupControl (PopupContainer* pP
     return new ParaNumberingControl(pParent, *this);
 }
 
+namespace
+{
+    Color GetNoBackgroundColor(void)
+    {
+        return COL_TRANSPARENT;
+    }
+} // end of anonymous namespace
+
 PopupControl* ParaPropertyPanel::CreateBGColorPopupControl (PopupContainer* pParent)
 {
+    const ResId aResId(SVX_RES(STR_NOFILL));
+
     return new ColorControl(
         pParent,
         mpBindings,
-        SVX_RES(RID_POPUPPANEL_TEXTPAGE_FONT_COLOR),
+        SVX_RES(RID_POPUPPANEL_PARAPAGE_BACK_COLOR),
         SVX_RES(VS_FONT_COLOR),
-        ::boost::bind(&ParaPropertyPanel::GetBGColor, this),
+        ::boost::bind(GetNoBackgroundColor),
         ::boost::bind(&ParaPropertyPanel::SetBGColor, this, _1,_2),
         pParent,
-        0);
+        &aResId);
 }
 
 
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index 4d240ee..7d6677d 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -274,7 +274,6 @@ private:
     void InitToolBoxSpacing();
     void InitToolBoxLineSpacing();
 
-    Color GetBGColor (void) const;
     void SetBGColor (const String& rsColorName, const Color aColor);
 };
 
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.src b/svx/source/sidebar/paragraph/ParaPropertyPanel.src
index c946c9b..b3c3ada 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.src
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.src
@@ -553,31 +553,27 @@ Control RID_SIDEBAR_PARA_PANEL
 };
 
 //===========================================Back color page==============================
-/*
 Control RID_POPUPPANEL_PARAPAGE_BACK_COLOR
 {
     OutputSize = TRUE;
     DialogControl = TRUE;
     Border = FALSE;
-
-    Size = MAP_APPFONT(  POPUP_COLOR_PICKER_WIDTH + POPUP_BORDER_WIDTH , POPUP_COLOR_PICKER_HEIGHT +POPUP_BORDER_HEIGHT );
+    Size = MAP_APPFONT(  POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT  );
 
     Control VS_FONT_COLOR
     {
         HelpID = HID_PPROPERTYPANEL_PARA_BACK_COLOR_VS ;
-            Hide = TRUE ;
-            Pos = MAP_APPFONT ( OFFSET_X , OFFSET_Y );
-            Size = MAP_APPFONT (  POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT );
+        Hide = TRUE ;
+        Pos = MAP_APPFONT ( OFFSET_X , OFFSET_Y );
+        Size = MAP_APPFONT (  POPUP_COLOR_PICKER_WIDTH - OFFSET_X * 2, POPUP_COLOR_PICKER_HEIGHT - OFFSET_Y * 2);
         TabStop = TRUE ;
         Text = "Color Picker";
     };
-
     String STR_NOFILL
     {
         Text [ en-US ] = "No Color";
     };
-
-};*/
+};
 
 //===========================================Bullet popup page==============================
 Control RID_POPUPPANEL_PARAPAGE_BULLETS
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index c0d0f37..79b2488 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -85,30 +85,42 @@ PopupControl* TextPropertyPanel::CreateUnderlinePopupControl (PopupContainer* pP
     return new TextUnderlineControl(pParent, *this);
 }
 
+namespace
+{
+    Color GetAutomaticColor(void)
+    {
+        return COL_AUTO;
+    }
+} // end of anonymous namespace
+
 PopupControl* TextPropertyPanel::CreateFontColorPopupControl (PopupContainer* pParent)
 {
+    const ResId aResId(SVX_RES(STR_AUTOMATICE));
+
     return new ColorControl(
         pParent,
         mpBindings,
         SVX_RES(RID_POPUPPANEL_TEXTPAGE_FONT_COLOR),
         SVX_RES(VS_FONT_COLOR),
-        ::boost::bind(&TextPropertyPanel::GetFontColor, this),
+        ::boost::bind(GetAutomaticColor),
         ::boost::bind(&TextPropertyPanel::SetFontColor, this, _1,_2),
         pParent,
-        0);
+        &aResId);
 }
 
 PopupControl* TextPropertyPanel::CreateBrushColorPopupControl (PopupContainer* pParent)
 {
+    const ResId aResId(SVX_RES(STR_AUTOMATICE));
+
     return new ColorControl(
         pParent,
         mpBindings,
         SVX_RES(RID_POPUPPANEL_TEXTPAGE_FONT_COLOR),
         SVX_RES(VS_FONT_COLOR),
-        ::boost::bind(&TextPropertyPanel::GetBrushColor, this),
+        ::boost::bind(GetAutomaticColor),
         ::boost::bind(&TextPropertyPanel::SetBrushColor, this, _1,_2),
         pParent,
-        0);
+        &aResId);
 }
 
 long TextPropertyPanel::GetSelFontSize()
@@ -1531,11 +1543,6 @@ void  TextPropertyPanel::UpdateFontScript()
     }
 }
 
-Color TextPropertyPanel::GetFontColor (void) const
-{
-    return maColor;
-}
-
 void TextPropertyPanel::SetFontColor (
     const String& /*rsColorName*/,
     const Color aColor)
@@ -1545,11 +1552,6 @@ void TextPropertyPanel::SetFontColor (
     maColor = aColor;
 }
 
-Color TextPropertyPanel::GetBrushColor (void) const
-{
-    return maBackColor;
-}
-
 void TextPropertyPanel::SetBrushColor (
     const String& /*rsColorName*/,
     const Color aColor)
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index 546eb72..b842e4f 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -65,9 +65,7 @@ public:
     void SetSpacing(long nKern);
     void EndSpacingPopupMode (void);
     void EndUnderlinePopupMode (void);
-    Color GetFontColor (void) const;
     void SetFontColor (const String& rsColorName,const Color aColor);
-    Color GetBrushColor (void) const;
     void SetBrushColor (const String& rsColorName,const Color aColor);
     void SetUnderline(FontUnderline eUnderline);
     Color& GetUnderlineColor();
diff --git a/svx/source/sidebar/text/TextPropertyPanel.src b/svx/source/sidebar/text/TextPropertyPanel.src
index 6ced5c7..633750f 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.src
+++ b/svx/source/sidebar/text/TextPropertyPanel.src
@@ -500,7 +500,6 @@ Control RID_POPUPPANEL_TEXTPAGE_FONT_COLOR
 
     Control VS_FONT_COLOR
     {
-//      HelpID = HID_COLOR_VS ;
         HelpID = HID_PPROPERTYPANEL_TEXT_COLOR_VS;
         Hide = TRUE ;
         Pos = MAP_APPFONT ( OFFSET_X , OFFSET_Y );
@@ -512,7 +511,6 @@ Control RID_POPUPPANEL_TEXTPAGE_FONT_COLOR
     {
         Text [ en-US ] = "Automatic";
     };
-
 };
 
 Control RID_POPUPPANEL_TEXTPAGE_SPACING


More information about the Libreoffice-commits mailing list