afl-eventtesting + VclPtr: only current context decks getting disposed
but they all have to go, not just the current one Change-Id: I84819c2a74042ad028fbdd8acba5d925c7fdedab
This commit is contained in:
@@ -67,6 +67,7 @@ public:
|
||||
|
||||
void UpdateModel(css::uno::Reference<css::frame::XModel> xModel);
|
||||
|
||||
void disposeDecks();
|
||||
|
||||
class DeckContextDescriptor
|
||||
{
|
||||
|
@@ -160,7 +160,7 @@ public:
|
||||
|
||||
void updateModel(css::uno::Reference<css::frame::XModel> xModel);
|
||||
|
||||
void disposeDecks(css::uno::Reference<css::frame::XController> xController);
|
||||
void disposeDecks();
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user