summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorRob Snelders <programming@ertai.nl>2012-12-02 15:25:56 +0100
committerThorsten Behrens <tbehrens@suse.com>2012-12-04 12:49:37 +0000
commit2a9c83fa8ac7e94d7124889e760c7343ccf3c19b (patch)
tree194d68dd24abf366b0a03c7fe32404f7ead984f1 /sd
parent75a2c5014826e3095a49799eaa40f461dfddabcb (diff)
fdo#56877 CRASH when profile contains invalid RecentlyUsedMasterpages
Change-Id: Ia875d6b04b5ce6a026a57aaef2c17fc02a503ae9 Reviewed-on: https://gerrit.libreoffice.org/1224 Reviewed-by: Thorsten Behrens <tbehrens@suse.com> Tested-by: Thorsten Behrens <tbehrens@suse.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageContainer.cxx8
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx7
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx5
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx6
4 files changed, 19 insertions, 7 deletions
diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx b/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
index f90dc2c27b9d..f17a2245fc60 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
@@ -1159,13 +1159,17 @@ bool MasterPageContainer::Implementation::UpdateDescriptor (
// Update the page object (which may be used for the preview update).
if (bForcePageObject)
GetDocument();
- bool bPageObjectModified (rpDescriptor->UpdatePageObject(
+ int bPageObjectModified (rpDescriptor->UpdatePageObject(
(bForcePageObject ? -1 : nCostThreshold),
mpDocument));
- if (bPageObjectModified && bSendEvents)
+ if (bPageObjectModified == 1 && bSendEvents)
FireContainerChange(
MasterPageContainerChangeEvent::DATA_CHANGED,
rpDescriptor->maToken);
+ if (bPageObjectModified == -1 && bSendEvents)
+ FireContainerChange(
+ MasterPageContainerChangeEvent::CHILD_REMOVED,
+ rpDescriptor->maToken);
if (bPageObjectModified && ! mbFirstPageObjectSeen)
UpdatePreviewSizePixel();
diff --git a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx
index 2601d27b504e..fdd38c68a4b2 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx
@@ -177,11 +177,11 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
-bool MasterPageDescriptor::UpdatePageObject (
+int MasterPageDescriptor::UpdatePageObject (
sal_Int32 nCostThreshold,
SdDrawDocument* pDocument)
{
- bool bModified (false);
+ int bModified = 0;
// Update the page object when that is not yet known.
if (mpMasterPage == NULL
@@ -221,9 +221,10 @@ bool MasterPageDescriptor::UpdatePageObject (
else
{
DBG_ASSERT(false, "UpdatePageObject: master page is NULL");
+ return -1;
}
- bModified = true;
+ bModified = 1;
}
return bModified;
diff --git a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx
index d77186a091ae..0896a093537e 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx
@@ -121,9 +121,10 @@ public:
a page object with or store one in.
@return
When the master page object is successfully provided then
- <TRUE/> is returned.
+ 1 is returned, on no change then a 0 is provided,
+ on a masterpage-error a -1 is provided.
*/
- bool UpdatePageObject (
+ int UpdatePageObject (
sal_Int32 nCostThreshold,
SdDrawDocument* pDocument);
diff --git a/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx
index 3951a374853c..512fd1dbdce0 100644
--- a/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx
@@ -432,6 +432,12 @@ void MasterPagesSelector::NotifyContainerChangeEvent (const MasterPageContainerC
}
break;
+ case MasterPageContainerChangeEvent::CHILD_REMOVED:
+ {
+ int nIndex (GetIndexForToken(rEvent.maChildToken));
+ SetItem(nIndex, MasterPageContainer::NIL_TOKEN);
+ }
+
default:
break;
}