diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-06-03 14:33:05 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-06-03 14:33:05 +0200 |
commit | 798d48ee776fe1bc443d273eeb688ad584f65d7c (patch) | |
tree | 312e2a5e8998c5b0a3ad2fc604a7699dd0f83916 /sd/source/ui/func/fupage.cxx | |
parent | afe714cb4a899f6e264a5f60cf421c2396684999 (diff) | |
parent | 38c1d35d15a0adc980c2355ff97ce327645cd954 (diff) |
slidecopy: merged latest DEV300.m80 changes
Diffstat (limited to 'sd/source/ui/func/fupage.cxx')
-rw-r--r-- | sd/source/ui/func/fupage.cxx | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index de1dadc3ae43..9fb0007cc72c 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -84,6 +84,7 @@ #include "undoback.hxx" #include "sdabstdlg.hxx" #include "sdresid.hxx" +#include "sdundogr.hxx" #include "helpids.h" namespace sd { @@ -359,6 +360,8 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) ( ( (XFillStyleItem*) aMergedAttr.GetItem( XATTR_FILLSTYLE ) )->GetValue() == XFILL_NONE ) ) ) mbPageBckgrdDeleted = TRUE; + bool bSetToAllPages = false; + // Ask, wether the setting are for the background-page or for the current page if( !mbMasterPage && bChanges ) { @@ -374,7 +377,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) aTit, aTxt ); aQuestionBox.SetImage( QueryBox::GetStandardImage() ); - mbMasterPage = ( RET_YES == aQuestionBox.Execute() ); + bSetToAllPages = ( RET_YES == aQuestionBox.Execute() ); } if( mbPageBckgrdDeleted ) @@ -403,6 +406,48 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) pStyleSheet->GetItemSet().Put( *(pTempSet.get()) ); pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); } + else if( bSetToAllPages ) + { + String aComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT)); + SfxUndoManager* pUndoMgr = mpDocSh->GetUndoManager(); + pUndoMgr->EnterListAction(aComment, aComment); + SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc); + pUndoGroup->SetComment(aComment); + + //Set background on all master pages + USHORT nMasterPageCount = mpDoc->GetMasterSdPageCount(ePageKind); + for (USHORT i = 0; i < nMasterPageCount; ++i) + { + SdPage *pMasterPage = mpDoc->GetMasterSdPage(i, ePageKind); + SdStyleSheet *pStyle = + pMasterPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND); + StyleSheetUndoAction* pAction = + new StyleSheetUndoAction(mpDoc, (SfxStyleSheet*)pStyle, &(*pTempSet.get())); + pUndoGroup->AddAction(pAction); + pStyle->GetItemSet().Put( *(pTempSet.get()) ); + pStyle->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + } + + //Remove background from all pages to reset to the master bg + USHORT nPageCount(mpDoc->GetSdPageCount(ePageKind)); + for(USHORT i=0; i<nPageCount; ++i) + { + SdPage *pPage = mpDoc->GetSdPage(i, ePageKind); + + const SfxItemSet& rFillAttributes = pPage->getSdrPageProperties().GetItemSet(); + if(XFILL_NONE != ((const XFillStyleItem&)rFillAttributes.Get(XATTR_FILLSTYLE)).GetValue()) + { + SdBackgroundObjUndoAction *pBackgroundObjUndoAction = new SdBackgroundObjUndoAction(*mpDoc, *pPage, rFillAttributes); + pUndoGroup->AddAction(pBackgroundObjUndoAction); + pPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE)); + pPage->ActionChanged(); + } + } + + pUndoMgr->AddUndoAction(pUndoGroup); + pUndoMgr->LeaveListAction(); + + } const SfxPoolItem *pItem; if( SFX_ITEM_SET == pTempSet->GetItemState( EE_PARA_WRITINGDIR, sal_False, &pItem ) ) |