diff options
5 files changed, 20 insertions, 8 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; } diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 6e11151071ae..afddf87e28fb 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -397,7 +397,7 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String const SfxFilter* pFilter = NULL; SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ) ); - if ( !aMedium.GetStorage( sal_True ).is() ) + if ( !aMedium.GetStorage( sal_False ).is() ) aMedium.GetInStream(); if ( aMedium.GetError() ) |