Kaydet (Commit) f756fb84 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#60040 crash after undoing master page application

 regression since 839cb94a

Change-Id: Ie7068ecd1655ecae169948dc1e08330dc4200bf9
üst 2e67b2c1
...@@ -1414,7 +1414,6 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, ...@@ -1414,7 +1414,6 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
SdPage& rOldNotesMaster = (SdPage&)pNotes->TRG_GetMasterPage(); SdPage& rOldNotesMaster = (SdPage&)pNotes->TRG_GetMasterPage();
SdPage* pMaster = NULL; SdPage* pMaster = NULL;
SdPage* pNotesMaster = NULL; SdPage* pNotesMaster = NULL;
SdPage* pPage = NULL;
OUString aOldPageLayoutName(pSelectedPage->GetLayoutName()); OUString aOldPageLayoutName(pSelectedPage->GetLayoutName());
OUString aOldLayoutName(aOldPageLayoutName); OUString aOldLayoutName(aOldPageLayoutName);
sal_Int32 nIndex = aOldLayoutName.indexOf( SD_LT_SEPARATOR ); sal_Int32 nIndex = aOldLayoutName.indexOf( SD_LT_SEPARATOR );
...@@ -1714,7 +1713,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, ...@@ -1714,7 +1713,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
{ {
for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++) for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++)
{ {
pPage = (SdPage*) GetPage(nPage); SdPage* pPage = (SdPage*) GetPage(nPage);
OUString aTest = pPage->GetLayoutName(); OUString aTest = pPage->GetLayoutName();
if (aTest == aOldPageLayoutName) if (aTest == aOldPageLayoutName)
{ {
...@@ -1731,20 +1730,21 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, ...@@ -1731,20 +1730,21 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
for (std::vector<SdPage*>::iterator pIter = aPageList.begin(); pIter != aPageList.end(); ++pIter) for (std::vector<SdPage*>::iterator pIter = aPageList.begin(); pIter != aPageList.end(); ++pIter)
{ {
AutoLayout eAutoLayout = (*pIter)->GetAutoLayout(); SdPage* pPage = *pIter;
AutoLayout eAutoLayout = pPage->GetAutoLayout();
if( bUndo ) if( bUndo )
{ {
SdPresentationLayoutUndoAction * pPLUndoAction = SdPresentationLayoutUndoAction * pPLUndoAction =
new SdPresentationLayoutUndoAction new SdPresentationLayoutUndoAction
(this, (this,
( pPage && pPage->IsMasterPage() ) ? aLayoutName : aOldLayoutName, pPage->IsMasterPage() ? aLayoutName : aOldLayoutName,
aLayoutName, aLayoutName,
eAutoLayout, eAutoLayout, false, *pIter); eAutoLayout, eAutoLayout, false, *pIter);
pUndoMgr->AddUndoAction(pPLUndoAction); pUndoMgr->AddUndoAction(pPLUndoAction);
} }
(*pIter)->SetPresentationLayout(aLayoutName); pPage->SetPresentationLayout(aLayoutName);
(*pIter)->SetAutoLayout(eAutoLayout); pPage->SetAutoLayout(eAutoLayout);
} }
// Adapt new master pages // Adapt new master pages
...@@ -1847,7 +1847,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, ...@@ -1847,7 +1847,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
{ {
for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++) for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++)
{ {
pPage = (SdPage*) GetPage(nPage); SdPage* pPage = (SdPage*) GetPage(nPage);
if (pPage->GetLayoutName() == aOldPageLayoutName) if (pPage->GetLayoutName() == aOldPageLayoutName)
{ {
aPageList.push_back(pPage); aPageList.push_back(pPage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment