diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-21 10:45:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-21 15:52:40 +0100 |
commit | 3303f43a6ea3c377331491d70a539e7e02ca9df8 (patch) | |
tree | d07161885fef7f71f51bdc8222360e3cadd6efbb /sfx2 | |
parent | f7799477ddf650c6adf14bf8c77d0c3e31abed41 (diff) |
afl-eventtesting + VclPtr: only current context decks getting disposed
but they all have to go, not just the current one
Change-Id: I84819c2a74042ad028fbdd8acba5d925c7fdedab
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 33 |
2 files changed, 12 insertions, 30 deletions
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index d3d47505f660..243f4a6b4401 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -649,7 +649,8 @@ bool ResourceManager::IsDeckEnabled ( void ResourceManager::UpdateModel(css::uno::Reference<css::frame::XModel> xModel) { - for (DeckContainer::iterator itr = maDecks.begin(); itr != maDecks.end(); ++itr) { + for (DeckContainer::iterator itr = maDecks.begin(); itr != maDecks.end(); ++itr) + { if (!itr->mpDeck) continue; @@ -661,8 +662,12 @@ void ResourceManager::UpdateModel(css::uno::Reference<css::frame::XModel> xModel } } +} - +void ResourceManager::disposeDecks() +{ + for (DeckContainer::iterator itr = maDecks.begin(); itr != maDecks.end(); ++itr) + itr->mpDeck.disposeAndClear(); } } } // end of namespace sfx2::sidebar diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 896b06d61133..1d882863738c 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -174,7 +174,7 @@ void SidebarController::registerSidebarForFrame(SidebarController* pController, void SidebarController::unregisterSidebarForFrame(SidebarController* pController, css::uno::Reference<css::frame::XController> xController) { - pController->disposeDecks(xController); + pController->disposeDecks(); css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer ( css::ui::ContextChangeEventMultiplexer::get( ::comphelper::getProcessComponentContext())); @@ -184,34 +184,11 @@ void SidebarController::unregisterSidebarForFrame(SidebarController* pController xController); } -void SidebarController::disposeDecks(css::uno::Reference<css::frame::XController> xController) +void SidebarController::disposeDecks() { - // clear decks - ResourceManager::DeckContextDescriptorContainer aDecks; - - mpResourceManager->GetMatchingDecks ( - aDecks, - GetCurrentContext(), - IsDocumentReadOnly(), - xController); - - for (ResourceManager::DeckContextDescriptorContainer::const_iterator - iDeck(aDecks.begin()), iEnd(aDecks.end()); - iDeck!=iEnd; ++iDeck) - { - 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>()); - } - } + mpCurrentDeck.clear(); + maFocusManager.Clear(); + mpResourceManager->disposeDecks(); } void SAL_CALL SidebarController::disposing() |