diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2014-05-26 00:45:32 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2014-05-29 22:27:49 +0300 |
commit | fd21291c60cb9e6bde10c9d230abfc4258b65dae (patch) | |
tree | 2155388aa1092636d96b14b2f271d02e47d15057 /chart2 | |
parent | 5a03ef2ae2740d04cd58e2339834f568173ac771 (diff) |
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
(cherry picked from commit 209eea5457fc40d9f013fb1c041f184b8dd4676a)
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/main/ShapeToolbarController.cxx | 8 | ||||
-rw-r--r-- | chart2/source/controller/main/ShapeToolbarController.hxx | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/chart2/source/controller/main/ShapeToolbarController.cxx b/chart2/source/controller/main/ShapeToolbarController.cxx index d272b25c2127..08fa8ca4607b 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 7f5b72d4a67b..1d1de1d040e5 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; |