Kaydet (Commit) 209eea54 authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

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
üst 42119194
...@@ -231,6 +231,14 @@ Reference< awt::XWindow > ShapeToolbarController::createPopupWindow() throw (uno ...@@ -231,6 +231,14 @@ Reference< awt::XWindow > ShapeToolbarController::createPopupWindow() throw (uno
return xRet; 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 // ::com::sun::star::frame::XSubToolbarController
sal_Bool ShapeToolbarController::opensSubToolbar() throw (uno::RuntimeException, std::exception) sal_Bool ShapeToolbarController::opensSubToolbar() throw (uno::RuntimeException, std::exception)
{ {
......
...@@ -80,6 +80,7 @@ public: ...@@ -80,6 +80,7 @@ public:
// ::com::sun::star::frame::XToolbarController // ::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 ::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 // ::com::sun::star::frame::XSubToolbarController
virtual sal_Bool SAL_CALL opensSubToolbar() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual sal_Bool SAL_CALL opensSubToolbar() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment