summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-24 17:10:12 +0100
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-04-24 18:45:50 +0000
commit1a33a20fe4ed4078794c07f0b506355999119882 (patch)
tree8042922a24b063a568dc45ea7c1176209b3ec9be
parentf609515bbd0fda93fa8acd6d9c553f974fc9c03b (diff)
Resolves: fdo#60040 crash after undoing master page application
regression since 839cb94a2bd9dfadb6a7e11a97f0540a78f79b6b Change-Id: Ie7068ecd1655ecae169948dc1e08330dc4200bf9 (cherry picked from commit f756fb84a1629d455ccbd7af1f3975ac307fb957) Reviewed-on: https://gerrit.libreoffice.org/9150 Tested-by: Norbert Thiebaud <nthiebaud@gmail.com> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r--sd/source/core/drawdoc3.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 998621904da5..2dcf5fa8a57a 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1367,7 +1367,6 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
SdPage& rOldNotesMaster = (SdPage&)pNotes->TRG_GetMasterPage();
SdPage* pMaster = NULL;
SdPage* pNotesMaster = NULL;
- SdPage* pPage = NULL;
OUString aOldPageLayoutName(pSelectedPage->GetLayoutName());
OUString aOldLayoutName(aOldPageLayoutName);
sal_Int32 nIndex = aOldLayoutName.indexOf( SD_LT_SEPARATOR );
@@ -1664,7 +1663,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
{
for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++)
{
- pPage = (SdPage*) GetPage(nPage);
+ SdPage* pPage = (SdPage*) GetPage(nPage);
OUString aTest = pPage->GetLayoutName();
if (aTest == aOldPageLayoutName)
{
@@ -1681,20 +1680,21 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
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 )
{
SdPresentationLayoutUndoAction * pPLUndoAction =
new SdPresentationLayoutUndoAction
(this,
- ( pPage && pPage->IsMasterPage() ) ? aLayoutName : aOldLayoutName,
+ pPage->IsMasterPage() ? aLayoutName : aOldLayoutName,
aLayoutName,
eAutoLayout, eAutoLayout, sal_False, *pIter);
pUndoMgr->AddUndoAction(pPLUndoAction);
}
- (*pIter)->SetPresentationLayout(aLayoutName);
- (*pIter)->SetAutoLayout(eAutoLayout);
+ pPage->SetPresentationLayout(aLayoutName);
+ pPage->SetAutoLayout(eAutoLayout);
}
// Adapt new master pages
@@ -1797,7 +1797,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
{
for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++)
{
- pPage = (SdPage*) GetPage(nPage);
+ SdPage* pPage = (SdPage*) GetPage(nPage);
if (pPage->GetLayoutName() == aOldPageLayoutName)
{
aPageList.push_back(pPage);