Kaydet (Commit) 75d50b71 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

generate correct sidebar context strings for charts

Change-Id: I92adf79c461f3536475da318e03b60f2e1adc08f
üst d4d56067
...@@ -153,7 +153,7 @@ public: ...@@ -153,7 +153,7 @@ public:
::com::sun::star::uno::XComponentContext > const & xContext); ::com::sun::star::uno::XComponentContext > const & xContext);
virtual ~ChartController(); virtual ~ChartController();
static OUString GetContextName(); OUString GetContextName();
// ::com::sun::star::lang::XServiceInfo // ::com::sun::star::lang::XServiceInfo
virtual OUString SAL_CALL getImplementationName() virtual OUString SAL_CALL getImplementationName()
......
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
#include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <boost/bind.hpp>
// this is needed to properly destroy the unique_ptr to the AcceleratorExecute // this is needed to properly destroy the unique_ptr to the AcceleratorExecute
// object in the DTOR // object in the DTOR
#include <svtools/acceleratorexecute.hxx> #include <svtools/acceleratorexecute.hxx>
...@@ -114,8 +116,8 @@ ChartController::ChartController(uno::Reference<uno::XComponentContext> const & ...@@ -114,8 +116,8 @@ ChartController::ChartController(uno::Reference<uno::XComponentContext> const &
m_aDispatchContainer( m_xCC, this ), m_aDispatchContainer( m_xCC, this ),
m_eDrawMode( CHARTDRAW_SELECT ), m_eDrawMode( CHARTDRAW_SELECT ),
mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler( mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler(
&ChartController::GetContextName, this, ::boost::bind(&ChartController::GetContextName, this),
sfx2::sidebar::EnumContext::Context_Cell)) this, sfx2::sidebar::EnumContext::Context_Cell))
{ {
m_aDoubleClickTimer.SetTimeoutHdl( LINK( this, ChartController, DoubleClickWaitingHdl ) ); m_aDoubleClickTimer.SetTimeoutHdl( LINK( this, ChartController, DoubleClickWaitingHdl ) );
} }
...@@ -296,6 +298,30 @@ bool ChartController::TheModelRef::is() const ...@@ -296,6 +298,30 @@ bool ChartController::TheModelRef::is() const
OUString ChartController::GetContextName() OUString ChartController::GetContextName()
{ {
uno::Any aAny = getSelection();
if (!aAny.hasValue())
return OUString("Chart");
OUString aCID;
aAny >>= aCID;
if (aCID.isEmpty())
return OUString("Chart");
ObjectType eObjectID = ObjectIdentifier::getObjectType(aCID);
switch (eObjectID)
{
case OBJECTTYPE_DATA_SERIES:
return OUString("Series");
break;
case OBJECTTYPE_DATA_ERRORS_X:
case OBJECTTYPE_DATA_ERRORS_Y:
case OBJECTTYPE_DATA_ERRORS_Z:
return OUString("ErrorBar");
default:
break;
}
return OUString("Chart"); return OUString("Chart");
} }
......
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