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/UnoPanel.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/UnoPanel.cxx')
-rw-r--r-- | sfx2/source/sidebar/UnoPanel.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/sfx2/source/sidebar/UnoPanel.cxx b/sfx2/source/sidebar/UnoPanel.cxx index 3fd124b459d5..917a23692919 100644 --- a/sfx2/source/sidebar/UnoPanel.cxx +++ b/sfx2/source/sidebar/UnoPanel.cxx @@ -64,11 +64,11 @@ void SAL_CALL SfxUnoPanel::setTitle( const OUString& newTitle ) SolarMutexGuard aGuard; SidebarController* pSidebarController = getSidebarController(); - PanelDescriptor* pPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); + std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); - if (pPanelDescriptor) + if (xPanelDescriptor) { - pPanelDescriptor->msTitle = newTitle; + xPanelDescriptor->msTitle = newTitle; PanelTitleBar* pTitleBar = mpPanel->GetTitleBar(); if (pTitleBar) pTitleBar->SetTitle(newTitle); @@ -145,11 +145,11 @@ void SAL_CALL SfxUnoPanel::setOrderIndex( const sal_Int32 newOrderIndex ) SolarMutexGuard aGuard; SidebarController* pSidebarController = getSidebarController(); - PanelDescriptor* pPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); + std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); - if (pPanelDescriptor) + if (xPanelDescriptor) { - pPanelDescriptor->mnOrderIndex = newOrderIndex; + xPanelDescriptor->mnOrderIndex = newOrderIndex; // update the sidebar pSidebarController->NotifyResize(); } @@ -169,10 +169,10 @@ void SAL_CALL SfxUnoPanel::moveFirst() if (curOrderIndex != minIndex) // is current panel already in place ? { minIndex -= 1; - PanelDescriptor* pPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); - if (pPanelDescriptor) + std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); + if (xPanelDescriptor) { - pPanelDescriptor->mnOrderIndex = minIndex; + xPanelDescriptor->mnOrderIndex = minIndex; // update the sidebar pSidebarController->NotifyResize(); } @@ -193,10 +193,10 @@ void SAL_CALL SfxUnoPanel::moveLast() if (curOrderIndex != maxIndex) // is current panel already in place ? { maxIndex += 1; - PanelDescriptor* pPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); - if (pPanelDescriptor) + std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); + if (xPanelDescriptor) { - pPanelDescriptor->mnOrderIndex = maxIndex; + xPanelDescriptor->mnOrderIndex = maxIndex; // update the sidebar pSidebarController->NotifyResize(); } @@ -226,10 +226,10 @@ void SAL_CALL SfxUnoPanel::moveUp() if (curOrderIndex != previousIndex) // is current panel already in place ? { previousIndex -= 1; - PanelDescriptor* pPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); - if (pPanelDescriptor) + std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); + if (xPanelDescriptor) { - pPanelDescriptor->mnOrderIndex = previousIndex; + xPanelDescriptor->mnOrderIndex = previousIndex; // update the sidebar pSidebarController->NotifyResize(); } @@ -259,10 +259,10 @@ void SAL_CALL SfxUnoPanel::moveDown() if (curOrderIndex != nextIndex) // is current panel already in place ? { nextIndex += 1; - PanelDescriptor* pPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); - if (pPanelDescriptor) + std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(mPanelId); + if (xPanelDescriptor) { - pPanelDescriptor->mnOrderIndex = nextIndex; + xPanelDescriptor->mnOrderIndex = nextIndex; // update the sidebar pSidebarController->NotifyResize(); } |