[Libreoffice-commits] core.git: 2 commits - icon-themes/galaxy include/svx officecfg/registry sc/source sd/source svx/source sw/source

Maxim Monastirsky momonasmon at gmail.com
Fri Oct 24 01:45:57 PDT 2014


 icon-themes/galaxy/links.txt                                         |    2 
 include/svx/dialogs.hrc                                              |    1 
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |    3 
 sc/source/ui/app/scdll.cxx                                           |    3 
 sd/source/ui/app/sddll.cxx                                           |    3 
 svx/source/tbxctrls/tbcontrl.cxx                                     |   35 +++++++++-
 svx/source/tbxctrls/tbcontrl.src                                     |    5 +
 svx/source/tbxctrls/tbxcolorupdate.cxx                               |    4 +
 sw/source/uibase/app/swmodule.cxx                                    |    1 
 9 files changed, 52 insertions(+), 5 deletions(-)

New commits:
commit 518b30527955276363f2cd6ccb5019d15de51413
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Fri Oct 24 11:03:19 2014 +0300

    Related: fdo#84844 Support fill color in SvxColorToolBoxControl
    
    Change-Id: I6ccc1d4e71a9fe76cd16dd957f626722aaba543c

diff --git a/icon-themes/galaxy/links.txt b/icon-themes/galaxy/links.txt
index 2bd46e0..cb176fc 100644
--- a/icon-themes/galaxy/links.txt
+++ b/icon-themes/galaxy/links.txt
@@ -7,3 +7,5 @@ cmd/sc_showsinglepage.png cmd/sc_adddirect.png
 cmd/sc_zoommode.png cmd/sc_zoomoptimal.png
 cmd/sc_nexttrackedchange.png cmd/sc_arrowshapes.right-arrow.png
 cmd/sc_previoustrackedchange.png cmd/sc_arrowshapes.left-arrow.png
+cmd/sc_fillcolor.png cmd/sc_formatarea.png
+cmd/lc_fillcolor.png cmd/lc_formatarea.png
\ No newline at end of file
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 0698052..e06a8a7 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -255,6 +255,7 @@
 #define RID_SVXSTR_CHARFONTNAME             (RID_SVX_START + 200)
 #define RID_SVXSTR_LINECOLOR                (RID_SVX_START + 201)
 #define RID_SVXSTR_MORE_STYLES              (RID_SVX_START + 202)
+#define RID_SVXSTR_FILLCOLOR                (RID_SVX_START + 203)
 
 // Strings for insert/overwrite mode
 #define RID_SVXSTR_INSERT_HELPTEXT          (RID_SVX_START + 210)
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 91734b0..3417c20 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -2513,6 +2513,9 @@
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Fill Color</value>
         </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
       </node>
       <node oor:name=".uno:StyleApply" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 072a551..f20e342 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -172,6 +172,7 @@ void ScDLL::Init()
     SvxLineStyleToolBoxControl      ::RegisterControl(0, pMod);
     SvxLineWidthToolBoxControl      ::RegisterControl(0, pMod);
     SvxColorToolBoxControl          ::RegisterControl(SID_ATTR_LINE_COLOR,      pMod);
+    SvxColorToolBoxControl          ::RegisterControl(SID_ATTR_FILL_COLOR,      pMod);
     SvxLineEndToolBoxControl        ::RegisterControl(SID_ATTR_LINEEND_STYLE,   pMod);
     SvxStyleToolBoxControl          ::RegisterControl(SID_STYLE_APPLY,          pMod);
     SvxFontNameToolBoxControl       ::RegisterControl(SID_ATTR_CHAR_FONT,       pMod);
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index 4eda9f2..8f1c3e8 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -208,6 +208,7 @@ void SdDLL::RegisterControllers()
     SvxLineStyleToolBoxControl::RegisterControl(0, pMod);
     SvxLineWidthToolBoxControl::RegisterControl(0, pMod);
     SvxColorToolBoxControl::RegisterControl(SID_ATTR_LINE_COLOR, pMod);
+    SvxColorToolBoxControl::RegisterControl(SID_ATTR_FILL_COLOR, pMod);
 
     SvxLineEndToolBoxControl::RegisterControl( SID_ATTR_LINEEND_STYLE, pMod );
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 3f90933..cc5b172 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1182,12 +1182,18 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString&            rCommand,
         mpAutomaticSeparator->Hide();
         mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_FRAME_COLOR ) );
     }
-    else
+    else if ( SID_ATTR_LINE_COLOR == theSlotId )
     {
         mpButtonAutoColor->Hide();
         mpAutomaticSeparator->Hide();
         mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_LINECOLOR ) );
     }
+    else if ( SID_ATTR_FILL_COLOR == theSlotId )
+    {
+        mpButtonAutoColor->Hide();
+        mpAutomaticSeparator->Hide();
+        mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_FILLCOLOR ) );
+    }
 
     mpPaletteListBox->SetStyle( mpPaletteListBox->GetStyle() | WB_BORDER | WB_AUTOSIZE );
     mpPaletteListBox->SetSelectHdl( LINK( this, SvxColorWindow_Impl, SelectPaletteHdl ) );
@@ -1338,6 +1344,8 @@ void SvxColorWindow_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eState, co
                 aColor = static_cast<const SvxColorItem*>(pState)->GetValue();
             else if ( pState->ISA( XLineColorItem ) )
                 aColor = static_cast<const XLineColorItem*>(pState)->GetColorValue();
+            else if ( pState->ISA( XFillColorItem ) )
+                aColor = static_cast<const XFillColorItem*>(pState)->GetColorValue();
 
             for ( size_t i = 1; i <= mpColorSet->GetItemCount(); ++i )
             {
@@ -2375,6 +2383,11 @@ SvxColorToolBoxControl::SvxColorToolBoxControl(
             addStatusListener( OUString( ".uno:XLineColor" ));
             mPaletteManager.SetLastColor( COL_BLACK );
             break;
+
+        case SID_ATTR_FILL_COLOR:
+            addStatusListener( OUString( ".uno:FillColor" ));
+            mPaletteManager.SetLastColor( COL_DEFAULT_SHAPE_FILLING );
+            break;
     }
 
     if ( bSidebarType )
@@ -2427,6 +2440,10 @@ SfxPopupWindow* SvxColorToolBoxControl::CreatePopupWindow()
         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(),
@@ -2467,6 +2484,9 @@ void SvxColorToolBoxControl::StateChanged(
             aColor = static_cast< const SvxColorItem* >(pState)->GetValue();
         else if ( pState->ISA( XLineColorItem ) )
             aColor = static_cast< const XLineColorItem* >(pState)->GetColorValue();
+        else if ( pState->ISA( XFillColorItem ) )
+            aColor = static_cast< const XFillColorItem* >(pState)->GetColorValue();
+
         pBtnUpdater->Update( aColor );
     }
 }
@@ -2521,6 +2541,11 @@ void SvxColorToolBoxControl::Select(sal_uInt16 /*nSelectModifier*/)
             aCommand    = ".uno:XLineColor";
             aParamName  = "XLineColor";
             break;
+
+        case SID_ATTR_FILL_COLOR:
+            aCommand    = ".uno:FillColor";
+            aParamName  = "FillColor";
+            break;
     }
 
     Sequence< PropertyValue > aArgs( 1 );
@@ -2538,6 +2563,8 @@ void SvxColorToolBoxControl::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod
 {
     if ( nSlotId == SID_ATTR_LINE_COLOR )
         SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(XLineColorItem), nSlotId ) );
+    else if ( nSlotId == SID_ATTR_FILL_COLOR )
+        SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(XFillColorItem), nSlotId ) );
     else
         SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(SvxColorItem), nSlotId ) );
 }
diff --git a/svx/source/tbxctrls/tbcontrl.src b/svx/source/tbxctrls/tbcontrl.src
index ccda7f6..b13cf62 100644
--- a/svx/source/tbxctrls/tbcontrl.src
+++ b/svx/source/tbxctrls/tbcontrl.src
@@ -76,6 +76,11 @@ String RID_SVXSTR_LINECOLOR
     Text [ en-US ] = "Line Color" ;
 };
 
+String RID_SVXSTR_FILLCOLOR
+{
+    Text [ en-US ] = "Fill Color" ;
+};
+
 ComboBox RID_SVXTBX_STYLE
 {
     HelpId = HID_STYLE_LISTBOX ;
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx
index d7447aa..62a0224 100644
--- a/svx/source/tbxctrls/tbxcolorupdate.cxx
+++ b/svx/source/tbxctrls/tbxcolorupdate.cxx
@@ -20,6 +20,7 @@
 
 #include <svx/tbxcolorupdate.hxx>
 #include <svx/svxids.hrc>
+#include <svx/xdef.hxx>
 
 #include <vcl/toolbox.hxx>
 #include <vcl/bmpacc.hxx>
@@ -70,6 +71,9 @@ namespace svx
             case SID_ATTR_LINE_COLOR:
                 Update( COL_BLACK );
                 break;
+            case SID_ATTR_FILL_COLOR:
+                Update( COL_DEFAULT_SHAPE_FILLING );
+                break;
             default :
                 Update( COL_TRANSPARENT );
         }
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index ecec7df..bd1809f 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -322,6 +322,7 @@ void SwDLL::RegisterControls()
     SvxLineWidthToolBoxControl::RegisterControl(SID_ATTR_LINE_WIDTH, pMod );
     SvxColorToolBoxControl::RegisterControl(SID_ATTR_LINE_COLOR, pMod );
     SvxLineEndToolBoxControl::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod );
+    SvxColorToolBoxControl::RegisterControl(SID_ATTR_FILL_COLOR, pMod);
 
     SvxFontNameToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONT, pMod );
     SvxColorToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR, pMod );
commit 312d903b8ec1805da91f7af367ba18cfe63313a3
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sun Aug 31 21:39:10 2014 +0300

    Register the item type based on the SID
    
    Change-Id: If954191b71daf52c4f49fb7638e583cd0a2c97a5

diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 2772993..072a551 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -171,7 +171,7 @@ void ScDLL::Init()
     SvxFillToolBoxControl           ::RegisterControl(0, pMod);
     SvxLineStyleToolBoxControl      ::RegisterControl(0, pMod);
     SvxLineWidthToolBoxControl      ::RegisterControl(0, pMod);
-    SvxColorToolBoxControl          ::RegisterControl(0, pMod);
+    SvxColorToolBoxControl          ::RegisterControl(SID_ATTR_LINE_COLOR,      pMod);
     SvxLineEndToolBoxControl        ::RegisterControl(SID_ATTR_LINEEND_STYLE,   pMod);
     SvxStyleToolBoxControl          ::RegisterControl(SID_STYLE_APPLY,          pMod);
     SvxFontNameToolBoxControl       ::RegisterControl(SID_ATTR_CHAR_FONT,       pMod);
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index 22c21f0..4eda9f2 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -207,7 +207,7 @@ void SdDLL::RegisterControllers()
     SvxFillToolBoxControl::RegisterControl(0, pMod);
     SvxLineStyleToolBoxControl::RegisterControl(0, pMod);
     SvxLineWidthToolBoxControl::RegisterControl(0, pMod);
-    SvxColorToolBoxControl::RegisterControl(0, pMod);
+    SvxColorToolBoxControl::RegisterControl(SID_ATTR_LINE_COLOR, pMod);
 
     SvxLineEndToolBoxControl::RegisterControl( SID_ATTR_LINEEND_STYLE, pMod );
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 293d8a0..3f90933 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2536,8 +2536,10 @@ SfxToolBoxControl* SvxColorToolBoxControl::CreateImpl( sal_uInt16 nSlotId, sal_u
 
 void SvxColorToolBoxControl::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod)
 {
-    SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(SvxColorItem), nSlotId ) );
-    SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(XLineColorItem), nSlotId ) );
+    if ( nSlotId == SID_ATTR_LINE_COLOR )
+        SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(XLineColorItem), nSlotId ) );
+    else
+        SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(SvxColorItem), nSlotId ) );
 }
 
 // class SvxFrameToolBoxControl --------------------------------------------


More information about the Libreoffice-commits mailing list