diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-06-03 14:04:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-06-03 14:20:32 +0100 |
commit | fce299fc64fcfe5280966631613edda7e6031c16 (patch) | |
tree | 51fe9c57d5d1266de2e65697250d918febd55b29 /sfx2/source/sidebar/Sidebar.cxx | |
parent | a22af0b1702d625f12711e9997daebbddb02b6e0 (diff) |
Resolves: tdf#96008 crash when an extension with legacy decks is installed
ReadLegacyAddons modifies its vectors of maDecks and maPanels in this case, but
a load of things have (c++) references contents of the original contents.
Its such a rats nest that the easiest thing seems to be to make them
vectors of shared_ptrs and hold DeckDescriptor and PanelDescriptor
by shared_ptr and it all works out
Change-Id: I3f628e12c7d5f4224d14d5e0769e450ce893fb54
Diffstat (limited to 'sfx2/source/sidebar/Sidebar.cxx')
-rw-r--r-- | sfx2/source/sidebar/Sidebar.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sfx2/source/sidebar/Sidebar.cxx b/sfx2/source/sidebar/Sidebar.cxx index eaa8a510c00f..dda31e4bbaec 100644 --- a/sfx2/source/sidebar/Sidebar.cxx +++ b/sfx2/source/sidebar/Sidebar.cxx @@ -33,9 +33,9 @@ void Sidebar::ShowPanel ( if (!pController) return; - const PanelDescriptor* pPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId); + std::shared_ptr<PanelDescriptor> xPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId); - if (!pPanelDescriptor) + if (!xPanelDescriptor) return; // This should be a lot more sophisticated: @@ -44,7 +44,7 @@ void Sidebar::ShowPanel ( // All that is not necessary for the current use cases so lets // keep it simple for the time being. - pController->OpenThenSwitchToDeck(pPanelDescriptor->msDeckId); + pController->OpenThenSwitchToDeck(xPanelDescriptor->msDeckId); } void Sidebar::TogglePanel ( @@ -55,9 +55,9 @@ void Sidebar::TogglePanel ( if (!pController) return; - const PanelDescriptor* pPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId); + std::shared_ptr<PanelDescriptor> xPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId); - if (!pPanelDescriptor) + if (!xPanelDescriptor) return; // This should be a lot more sophisticated: @@ -66,7 +66,7 @@ void Sidebar::TogglePanel ( // All that is not necessary for the current use cases so lets // keep it simple for the time being. - pController->OpenThenToggleDeck(pPanelDescriptor->msDeckId); + pController->OpenThenToggleDeck(xPanelDescriptor->msDeckId); } bool Sidebar::IsPanelVisible( @@ -77,11 +77,11 @@ bool Sidebar::IsPanelVisible( if (!pController) return false; - const PanelDescriptor* pPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId); - if (!pPanelDescriptor) + std::shared_ptr<PanelDescriptor> xPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId); + if (!xPanelDescriptor) return false; - return pController->IsDeckVisible(pPanelDescriptor->msDeckId); + return pController->IsDeckVisible(xPanelDescriptor->msDeckId); } } } // end of namespace sfx2::sidebar |