chart2/source/controller/main/ChartController.cxx | 4 +- chart2/source/controller/sidebar/ChartAreaPanel.cxx | 2 - include/sfx2/sidebar/SidebarController.hxx | 2 + include/svx/sidebar/AreaPropertyPanelBase.hxx | 3 -- sfx2/source/sidebar/SidebarController.cxx | 30 +++++++++++++------- 5 files changed, 24 insertions(+), 17 deletions(-)
New commits: commit 33972dea7d8849842929060be8f970e090077e4c Author: Markus Mohrhard <[email protected]> Date: Thu Oct 8 19:14:35 2015 +0200 correctly dispose the chart sidebar when leaving chart, tdf#94292 This is a much better approach than my old one that tried to use the correct XModel with the chart sidebar. Now everytime we leave the chart edit mdoe we destroy the chart sidebar panels and recreate them when we go back to chart edit mode. As a result we no longer need to have worry that much about using the correct ChartModel and about the lifecycle of the ChartModel. Change-Id: Ie85ad82968e20a81f059d4bd930a83a70da35fc9 diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 8b16543..754bc07 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -807,8 +807,6 @@ void SAL_CALL ChartController::dispose() throw(uno::RuntimeException, std::exception) { m_bDisposed = true; - mpSelectionChangeHandler->selectionChanged(css::lang::EventObject()); - mpSelectionChangeHandler->Disconnect(); if (getModel().is()) { @@ -819,6 +817,8 @@ void SAL_CALL ChartController::dispose() sfx2::sidebar::SidebarController::unregisterSidebarForFrame(pSidebar, this); } } + mpSelectionChangeHandler->selectionChanged(css::lang::EventObject()); + mpSelectionChangeHandler->Disconnect(); try { diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx index 0c88901..64bc26e 100644 --- a/include/sfx2/sidebar/SidebarController.hxx +++ b/include/sfx2/sidebar/SidebarController.hxx @@ -160,6 +160,8 @@ public: void updateModel(css::uno::Reference<css::frame::XModel> xModel); + void disposeDecks(css::uno::Reference<css::frame::XController> xController); + private: VclPtr<Deck> mpCurrentDeck; diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 5764394..896b06d 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -174,6 +174,7 @@ void SidebarController::registerSidebarForFrame(SidebarController* pController, void SidebarController::unregisterSidebarForFrame(SidebarController* pController, css::uno::Reference<css::frame::XController> xController) { + pController->disposeDecks(xController); css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer ( css::ui::ContextChangeEventMultiplexer::get( ::comphelper::getProcessComponentContext())); @@ -183,22 +184,16 @@ void SidebarController::unregisterSidebarForFrame(SidebarController* pController xController); } -void SAL_CALL SidebarController::disposing() +void SidebarController::disposeDecks(css::uno::Reference<css::frame::XController> xController) { - mpCloseIndicator.disposeAndClear(); - - maFocusManager.Clear(); - mpTabBar.disposeAndClear(); - - - // clear decks + // clear decks ResourceManager::DeckContextDescriptorContainer aDecks; mpResourceManager->GetMatchingDecks ( aDecks, GetCurrentContext(), IsDocumentReadOnly(), - mxFrame->getController()); + xController); for (ResourceManager::DeckContextDescriptorContainer::const_iterator iDeck(aDecks.begin()), iEnd(aDecks.end()); @@ -206,9 +201,25 @@ void SAL_CALL SidebarController::disposing() { const DeckDescriptor* deckDesc = mpResourceManager->GetDeckDescriptor(iDeck->msId); VclPtr<Deck> aDeck = deckDesc->mpDeck; + if (aDeck == mpCurrentDeck) + { + mpCurrentDeck.clear(); + maFocusManager.Clear(); + } if (aDeck) + { aDeck.disposeAndClear(); + mpResourceManager->SetDeckToDescriptor(iDeck->msId, VclPtr<Deck>()); + } } +} + +void SAL_CALL SidebarController::disposing() +{ + mpCloseIndicator.disposeAndClear(); + + maFocusManager.Clear(); + mpTabBar.disposeAndClear(); uno::Reference<css::frame::XController> xController = mxFrame->getController(); if (!xController.is()) commit c129a415ad0998b1544aed756316ed869148ef7b Author: Markus Mohrhard <[email protected]> Date: Tue Oct 6 19:24:26 2015 +0200 no need for using rtl::OUString in core code Change-Id: I6fc8a928374de48910395685b500ba95e8621d39 diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index f05a166..5764394 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -57,7 +57,6 @@ using namespace css; using namespace css::uno; -using ::rtl::OUString; namespace { commit bfa0c4c9986c87135ef19190ad260999cc1e43fc Author: Markus Mohrhard <[email protected]> Date: Tue Oct 6 12:24:17 2015 +0200 remove whitespace Change-Id: I6390f16a6c2346c4c903a34d702277b931bc0079 diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx index 39f8185..54928df0 100644 --- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx +++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx @@ -99,8 +99,6 @@ DrawModelWrapper* getDrawModelWrapper(css::uno::Reference<css::frame::XModel> xM XGradient getXGradientForName(css::uno::Reference<css::frame::XModel> xModel, const OUString& rName) { - - try { ViewElementListProvider aProvider = getViewElementListProvider(xModel); commit 0ea449d37cf60186ded1372ac0de96c6bac955cd Author: Markus Mohrhard <[email protected]> Date: Sat Oct 3 16:30:16 2015 +0200 remove whitespace Change-Id: I02541a12c893038f090a8e2847b6882669a967df diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx index 0d1faf0c..b0ac3e345 100644 --- a/include/svx/sidebar/AreaPropertyPanelBase.hxx +++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx @@ -175,11 +175,8 @@ protected: void SetTransparency(sal_uInt16 nVal); }; - } } // end of namespace svx::sidebar - - #endif // INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
