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

Maxim Monastirsky momonasmon at gmail.com
Wed Oct 19 21:03:24 UTC 2016


 include/svx/svxitems.hrc            |    3 -
 svx/source/items/svxitems.src       |    4 -
 svx/source/tbxctrls/colorwindow.hxx |    1 
 svx/source/tbxctrls/tbcontrl.cxx    |   80 ++++++++++++++----------------------
 4 files changed, 33 insertions(+), 55 deletions(-)

New commits:
commit b420a6ab0729530df6ff95c41d24673b5399ceae
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Wed Oct 19 22:59:08 2016 +0300

    SvxColorWindow_Impl: Unify title setting
    
    Change-Id: Ic61fddfc92d30bfc5a5d0a298605606fba7ca676

diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx
index 56b9ed2..551db2b 100644
--- a/svx/source/tbxctrls/colorwindow.hxx
+++ b/svx/source/tbxctrls/colorwindow.hxx
@@ -66,7 +66,6 @@ public:
                          BorderColorStatus& rBorderColorStatus,
                          sal_uInt16 nSlotId,
                          const css::uno::Reference< css::frame::XFrame >& rFrame,
-                         const OUString& rWndTitle,
                          vcl::Window* pParentWindow,
                          std::function<void(const OUString&, const Color&)> const & maColorSelectFunction);
     virtual ~SvxColorWindow_Impl() override;
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 89da4fb..d1c26ba 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1249,7 +1249,6 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString&            rCommand,
                                           BorderColorStatus&         rBorderColorStatus,
                                           sal_uInt16                 nSlotId,
                                           const Reference< XFrame >& rFrame,
-                                          const OUString&            rWndTitle,
                                           vcl::Window*                    pParentWindow,
                                           std::function<void(const OUString&, const Color&)> const & aFunction):
 
@@ -1279,7 +1278,6 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString&            rCommand,
         case SID_ATTR_CHAR_BACK_COLOR:
         {
             mpButtonAutoColor->SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) );
-            mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_BACKGROUND ) );
             break;
         }
         case SID_ATTR_CHAR_COLOR:
@@ -1294,34 +1292,52 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString&            rCommand,
                                          OUString( ".uno:AutoColorInvalid" ));
             SfxItemState eState = aQueryStatus.QueryState( pDummy );
             if( (SfxItemState::DEFAULT > eState) || ( SID_EXTRUSION_3D_COLOR == theSlotId ) )
-            {
                 mpButtonAutoColor->SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) );
-                mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_TEXTCOLOR ) );
-            }
             break;
         }
-        case SID_FRAME_LINECOLOR:
+        default:
         {
             mpButtonAutoColor->Hide();
             mpAutomaticSeparator->Hide();
-            mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_FRAME_COLOR ) );
             break;
         }
+    }
+
+    OUString aWindowTitle;
+    switch ( theSlotId )
+    {
+        case SID_ATTR_CHAR_COLOR:
+        case SID_ATTR_CHAR_COLOR2:
+            aWindowTitle = SVX_RESSTR( RID_SVXSTR_TEXTCOLOR );
+            break;
+
+        case SID_ATTR_CHAR_COLOR_BACKGROUND:
+        case SID_ATTR_CHAR_BACK_COLOR:
+            aWindowTitle = SVX_RESSTR( RID_SVXSTR_EXTRAS_CHARBACKGROUND );
+            break;
+
+        case SID_BACKGROUND_COLOR:
+            aWindowTitle = SVX_RESSTR( RID_SVXSTR_BACKGROUND );
+            break;
+
+        case SID_FRAME_LINECOLOR:
+            aWindowTitle = SVX_RESSTR( RID_SVXSTR_FRAME_COLOR );
+            break;
+
+        case SID_EXTRUSION_3D_COLOR:
+            aWindowTitle = SVX_RESSTR( RID_SVXSTR_EXTRUSION_COLOR );
+            break;
+
         case SID_ATTR_LINE_COLOR:
-        {
-            mpButtonAutoColor->Hide();
-            mpAutomaticSeparator->Hide();
-            mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_LINECOLOR ) );
+            aWindowTitle = SVX_RESSTR( RID_SVXSTR_LINECOLOR );
             break;
-        }
+
         case SID_ATTR_FILL_COLOR:
-        {
-            mpButtonAutoColor->Hide();
-            mpAutomaticSeparator->Hide();
-            mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_FILLCOLOR ) );
+            aWindowTitle = SVX_RESSTR( RID_SVXSTR_FILLCOLOR );
             break;
-        }
     }
+    SetText( aWindowTitle );
+    mpColorSet->SetAccessibleName( aWindowTitle );
 
     mpPaletteListBox->SetStyle( mpPaletteListBox->GetStyle() | WB_BORDER | WB_AUTOSIZE );
     mpPaletteListBox->SetSelectHdl( LINK( this, SvxColorWindow_Impl, SelectPaletteHdl ) );
@@ -1342,7 +1358,6 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString&            rCommand,
     mpRecentColorSet->SetSelectHdl( LINK( this, SvxColorWindow_Impl, SelectHdl ) );
     SetHelpId( HID_POPUP_COLOR );
     mpColorSet->SetHelpId( HID_POPUP_COLOR_CTRL );
-    SetText( rWndTitle );
 
     mrPaletteManager.ReloadColorSet(*mpColorSet);
     mpColorSet->layoutToGivenHeight(mpColorSet->GetSizePixel().Height(), mrPaletteManager.GetColorCount());
@@ -2699,38 +2714,9 @@ VclPtr<SfxPopupWindow> SvxColorToolBoxControl::CreatePopupWindow()
                             m_aBorderColorStatus,
                             GetSlotId(),
                             m_xFrame,
-                            SVX_RESSTR( RID_SVXSTR_TEXTCOLOR ),
                             &GetToolBox(),
                             m_aColorSelectFunction);
 
-    switch( GetSlotId() )
-    {
-        case SID_ATTR_CHAR_COLOR_BACKGROUND :
-        case SID_ATTR_CHAR_BACK_COLOR :
-            pColorWin->SetText( SVX_RESSTR( RID_SVXSTR_EXTRAS_CHARBACKGROUND ) );
-            break;
-
-        case SID_BACKGROUND_COLOR :
-            pColorWin->SetText( SVX_RESSTR( RID_SVXSTR_BACKGROUND ) );
-            break;
-
-        case SID_FRAME_LINECOLOR:
-            pColorWin->SetText( SVX_RESSTR( RID_SVXSTR_FRAME_COLOR ) );
-            break;
-
-        case SID_EXTRUSION_3D_COLOR:
-            pColorWin->SetText( SVX_RESSTR( RID_SVXSTR_EXTRUSION_COLOR ) );
-            break;
-
-        case SID_ATTR_LINE_COLOR:
-            pColorWin->SetText( SVX_RESSTR( RID_SVXSTR_LINECOLOR ) );
-            break;
-
-        case SID_ATTR_FILL_COLOR:
-            pColorWin->SetText( SVX_RESSTR( RID_SVXSTR_FILLCOLOR ) );
-            break;
-    }
-
     pColorWin->StartPopupMode( &GetToolBox(),
         FloatWinPopupFlags::AllowTearOff|FloatWinPopupFlags::NoAppFocusClose );
     pColorWin->StartSelection();
commit 9d93fe6ca8a50e8cfbcec40507ee90f1f26bd7ba
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Wed Oct 19 22:40:04 2016 +0300

    Remove RID_SVXITEMS_EXTRAS_CHARCOLOR string
    
    It's the same as RID_SVXSTR_TEXTCOLOR.
    
    Change-Id: I91c4ad0840ec60acbbdd9bbdc70184417cecd82f

diff --git a/include/svx/svxitems.hrc b/include/svx/svxitems.hrc
index dfd2e57..62e718b 100644
--- a/include/svx/svxitems.hrc
+++ b/include/svx/svxitems.hrc
@@ -22,9 +22,6 @@
 
 #include <svl/solar.hrc>
 
-// Extras -------------------------------------------------------------------
-#define RID_SVXITEMS_EXTRAS_CHARCOLOR       (RID_SVXITEMS_START +  2)
-
 // SvxSearchItem ------------------------------------------------------------
 // Kommando
 #define RID_SVXITEMS_SEARCHCMD_FIND         (RID_SVXITEMS_START + 10)
diff --git a/svx/source/items/svxitems.src b/svx/source/items/svxitems.src
index 6687cfd..14980b6 100644
--- a/svx/source/items/svxitems.src
+++ b/svx/source/items/svxitems.src
@@ -87,10 +87,6 @@ StringArray RID_ATTR_NAMES
     };
 };
 
-String RID_SVXITEMS_EXTRAS_CHARCOLOR
-{
-    Text [ en-US ] = "Font color" ;
-};
  // SvxSearchItem ------------------------------------------------------------
  // Kommando
 String RID_SVXITEMS_SEARCHCMD_FIND
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index a081a58..89da4fb 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2699,7 +2699,7 @@ VclPtr<SfxPopupWindow> SvxColorToolBoxControl::CreatePopupWindow()
                             m_aBorderColorStatus,
                             GetSlotId(),
                             m_xFrame,
-                            SVX_RESSTR( RID_SVXITEMS_EXTRAS_CHARCOLOR ),
+                            SVX_RESSTR( RID_SVXSTR_TEXTCOLOR ),
                             &GetToolBox(),
                             m_aColorSelectFunction);
 


More information about the Libreoffice-commits mailing list