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

Maxim Monastirsky momonasmon at gmail.com
Tue May 27 07:24:27 PDT 2014


 chart2/source/controller/main/ShapeToolbarController.cxx |    8 ++++++++
 chart2/source/controller/main/ShapeToolbarController.hxx |    1 +
 reportdesign/source/ui/inc/toolboxcontroller.hxx         |    1 +
 reportdesign/source/ui/misc/toolboxcontroller.cxx        |    6 ++++++
 reportdesign/source/ui/report/ReportController.cxx       |    2 ++
 svx/source/customshapes/tbxcustomshapes.cxx              |    6 ++++--
 6 files changed, 22 insertions(+), 2 deletions(-)

New commits:
commit 426033250db0b9b6344980655ca0be59efe6a6a5
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Mon May 26 11:32:25 2014 +0300

    reportdesign: Fix applying the last used color
    
    The last used color is stored inside
    SvxColorToolBoxControl, so we must call its Select method
    to do that. (This also fixes using the last shape, See
    commit ce842113ae728e8995c7c5398204a20d0707e843 for a
    fix of exactly the same problem in chart2.)
    
    For the font color, there was also another problem:
    The SID used for that button is SID_ATTR_CHAR_COLOR2.
    The problem is that SvxColorToolBoxControl::Select
    actually calls for that SID the ".uno:CharColorExt"
    command instead of ".uno:FontColor" (which activates
    in writer the format paintbrush mode). Given that since
    commit 584b415924bba22db23a4258062e54973de0ed7c this
    command also receives the last used color as argument,
    the easiest solution is to register ".uno:CharColorExt"
    here as well.
    
    Change-Id: I2db25a7fb537ce10dfec7b1c2d049dd77d9f8f6b

diff --git a/reportdesign/source/ui/inc/toolboxcontroller.hxx b/reportdesign/source/ui/inc/toolboxcontroller.hxx
index a4a668c..b005b42 100644
--- a/reportdesign/source/ui/inc/toolboxcontroller.hxx
+++ b/reportdesign/source/ui/inc/toolboxcontroller.hxx
@@ -71,6 +71,7 @@ namespace rptui
         virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
         // XToolbarController
         virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+        virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
         // XSubToolbarController
         virtual sal_Bool SAL_CALL opensSubToolbar(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx
index 2bdbd25..66335da 100644
--- a/reportdesign/source/ui/misc/toolboxcontroller.cxx
+++ b/reportdesign/source/ui/misc/toolboxcontroller.cxx
@@ -276,6 +276,12 @@ Reference< awt::XWindow > SAL_CALL OToolboxController::createPopupWindow() throw
     return xRet;
 }
 
+void SAL_CALL OToolboxController::execute( sal_Int16 KeyModifier ) throw (uno::RuntimeException, std::exception)
+{
+    if ( m_pToolbarController.is() )
+        m_pToolbarController.getRef()->execute( KeyModifier );
+}
+
 sal_Bool SAL_CALL OToolboxController::opensSubToolbar() throw (uno::RuntimeException, std::exception)
 {
     return ( m_nSlotId == SID_DRAWTBX_CS_BASIC ||
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index c4f709a..1b39181 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -1462,6 +1462,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
             break;
         case SID_ATTR_CHAR_COLOR:
         case SID_ATTR_CHAR_COLOR2:
+        case SID_ATTR_CHAR_COLOR_EXT:
             {
                 const SequenceAsHashMap aMap(aArgs);
                 const util::Color aColor = aMap.getUnpackedValueOrDefault(PROPERTY_FONTCOLOR,util::Color());
@@ -1857,6 +1858,7 @@ void OReportController::describeSupportedFeatures()
     implDescribeSupportedFeature( ".uno:Underline",                 SID_ATTR_CHAR_UNDERLINE,        CommandGroup::FORMAT );
     implDescribeSupportedFeature( ".uno:BackColor",                 SID_ATTR_CHAR_COLOR_BACKGROUND, CommandGroup::FORMAT );
     implDescribeSupportedFeature( ".uno:BackgroundColor",           SID_BACKGROUND_COLOR,           CommandGroup::FORMAT );
+    implDescribeSupportedFeature( ".uno:CharColorExt",              SID_ATTR_CHAR_COLOR_EXT);
     implDescribeSupportedFeature( ".uno:Color",                     SID_ATTR_CHAR_COLOR);
     implDescribeSupportedFeature( ".uno:FontColor",                 SID_ATTR_CHAR_COLOR2,           CommandGroup::FORMAT );
     implDescribeSupportedFeature( ".uno:FontDialog",                SID_CHAR_DLG,                   CommandGroup::FORMAT );
diff --git a/svx/source/customshapes/tbxcustomshapes.cxx b/svx/source/customshapes/tbxcustomshapes.cxx
index f91d2e3..4a8fff2 100644
--- a/svx/source/customshapes/tbxcustomshapes.cxx
+++ b/svx/source/customshapes/tbxcustomshapes.cxx
@@ -128,11 +128,13 @@ SfxPopupWindow* SvxTbxCtlCustomShapes::CreatePopupWindow()
 
 
 
-void SvxTbxCtlCustomShapes::Select(sal_uInt16 /*nSelectModifier*/)
+void SvxTbxCtlCustomShapes::Select(sal_uInt16 nSelectModifier)
 {
      if ( !m_aCommand.isEmpty() )
     {
-        com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aParamSeq( 0 );
+        com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aParamSeq( 1 );
+        aParamSeq[0].Name = "KeyModifier";
+        aParamSeq[0].Value <<= static_cast< sal_Int16 >( nSelectModifier );
         Dispatch( m_aCommand, aParamSeq );
     }
 }
commit 209eea5457fc40d9f013fb1c041f184b8dd4676a
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Mon May 26 00:45:32 2014 +0300

    chart2: Fix using the last shape
    
    Clicking a shape button works only for the default shape,
    not for the last used one.
    
    Steps to reproduce:
    1) Click on the drop-down arrow of one of the shape buttons,
       and select a shape. Notice that the button icon updates
       with the last selected shape.
    2) Click on another button.
    3) Click on the first button, and try to draw something.
       The button doesn't work anymore. Only opening the sub
       toolbar and selecting the shape there will work.
    
    The problem is in ToolboxController::execute that requires
    the command to be in the listener map, but we didn't
    register sub commands (like .uno:SymbolShapes.sun).
    Instead of doing that, we'll try some generic solution.
    (Note that calling the corresponding method from
    SvxTbxCtlCustomShapes like we do in other methods here
    won't work, because ChartController::queryDispatch checks
    for the "_self" target, but SfxToolBoxControl::Dispatch
    doesn't provide it.)
    
    Change-Id: I5be3dfd3ee3ca9ab9d8080929173dbe5984f61a0

diff --git a/chart2/source/controller/main/ShapeToolbarController.cxx b/chart2/source/controller/main/ShapeToolbarController.cxx
index d272b25..08fa8ca 100644
--- a/chart2/source/controller/main/ShapeToolbarController.cxx
+++ b/chart2/source/controller/main/ShapeToolbarController.cxx
@@ -231,6 +231,14 @@ Reference< awt::XWindow > ShapeToolbarController::createPopupWindow() throw (uno
     return xRet;
 }
 
+void ShapeToolbarController::execute( sal_Int16 KeyModifier ) throw (uno::RuntimeException, std::exception)
+{
+    uno::Sequence< beans::PropertyValue > aArgs( 1 );
+    aArgs[0].Name = "KeyModifier";
+    aArgs[0].Value <<= KeyModifier;
+    dispatchCommand( m_aCommandURL, aArgs );
+}
+
 // ::com::sun::star::frame::XSubToolbarController
 sal_Bool ShapeToolbarController::opensSubToolbar() throw (uno::RuntimeException, std::exception)
 {
diff --git a/chart2/source/controller/main/ShapeToolbarController.hxx b/chart2/source/controller/main/ShapeToolbarController.hxx
index 7f5b72d..1d1de1d 100644
--- a/chart2/source/controller/main/ShapeToolbarController.hxx
+++ b/chart2/source/controller/main/ShapeToolbarController.hxx
@@ -80,6 +80,7 @@ public:
 
     // ::com::sun::star::frame::XToolbarController
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+    virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
     // ::com::sun::star::frame::XSubToolbarController
     virtual sal_Bool SAL_CALL opensSubToolbar() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;


More information about the Libreoffice-commits mailing list