diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-09-15 01:18:17 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-09-15 01:54:05 +0200 |
commit | 4248e89e4be31a5cb1c9b0b98b50ee16024ff5d4 (patch) | |
tree | 7896a88f4826135226a4d11e8ec2d4057398fa48 | |
parent | 1beb5017f1791f26e6404d6175ccc1c49887c48e (diff) |
remove chart sidebar when leaving chart edit mode
Change-Id: Ie6fc01b2a610fb861ddade996ebb8480be217085
-rw-r--r-- | chart2/source/controller/inc/ChartController.hxx | 1 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 826deee540cd..cdb23aa9133c 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -524,6 +524,7 @@ private: bool m_bWaitingForMouseUp; bool m_bConnectingToView; + bool m_bDisposed; ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > m_xUndoManager; std::unique_ptr< UndoGuard > m_pTextActionUndoGuard; diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index b99858f6cfc4..8683b949cf78 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -113,6 +113,7 @@ ChartController::ChartController(uno::Reference<uno::XComponentContext> const & m_bWaitingForDoubleClick(false), m_bWaitingForMouseUp(false), m_bConnectingToView(false), + m_bDisposed(false), m_xUndoManager( 0 ), m_aDispatchContainer( m_xCC, this ), m_eDrawMode( CHARTDRAW_SELECT ), @@ -299,6 +300,9 @@ bool ChartController::TheModelRef::is() const OUString ChartController::GetContextName() { + if (m_bDisposed) + return OUString(); + uno::Any aAny = getSelection(); if (!aAny.hasValue()) return OUString("Chart"); @@ -425,6 +429,8 @@ void SAL_CALL ChartController::attachFrame( sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()); sfx2::sidebar::SidebarController::registerSidebarForFrame(pSidebar, this); pSidebar->updateModel(getModel()); + css::lang::EventObject aEvent; + mpSelectionChangeHandler->selectionChanged(aEvent); } if(m_xFrame.is()) //what happens, if we do have a Frame already?? @@ -791,6 +797,8 @@ void ChartController::impl_deleteDrawViewController() void SAL_CALL ChartController::dispose() throw(uno::RuntimeException, std::exception) { + m_bDisposed = true; + mpSelectionChangeHandler->selectionChanged(css::lang::EventObject()); mpSelectionChangeHandler->Disconnect(); if (getModel().is()) |