diff options
author | Christian Lippka ORACLE <christian.lippka@oracle.com> | 2011-12-06 02:24:51 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-12-06 09:39:11 +0100 |
commit | b7540a2bfe424ff761f6bfd1e7264349c83e3f59 (patch) | |
tree | 669a489a806fc47623ae8fa55f217eccb67b4d4c /sd | |
parent | 416435e1dcbc175787a5a9e03142f7f766b6a648 (diff) |
impress210: #i50899# clean up fill attributes if fill style changes
# HG changeset patch
# User Christian Lippka ORACLE <christian.lippka@oracle.com>
# Date 1299270680 -3600
# Node ID 69091b8fc77c9951fcdc52b800a37a92dc70bf84
# Parent 20c5c9384888da33596d864251881e6e46bdd339
impress210: #i50899# clean up fill attributes if fill style changes
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/func/fupage.cxx | 21 | ||||
-rw-r--r-- | sd/source/ui/func/futempl.cxx | 3 |
2 files changed, 21 insertions, 3 deletions
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 4d07bef7faf3..5c7e0df2f0f5 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -52,6 +52,7 @@ #include <svl/itempool.hxx> #include <editeng/ulspitem.hxx> #include <editeng/lrspitem.hxx> +#include <svx/sdr/properties/properties.hxx> #include "glob.hrc" #include <editeng/shaditem.hxx> @@ -386,7 +387,11 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) if(!mpPage->IsMasterPage()) { // on normal pages, switch off fill attribute usage - mpPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE)); + SdrPageProperties& rPageProperties = mpPage->getSdrPageProperties(); + rPageProperties.ClearItem( XATTR_FILLBITMAP ); + rPageProperties.ClearItem( XATTR_FILLGRADIENT ); + rPageProperties.ClearItem( XATTR_FILLHATCH ); + rPageProperties.PutItem(XFillStyleItem(XFILL_NONE)); } } } @@ -402,6 +407,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, (SfxStyleSheet*)pStyleSheet, &(*pTempSet.get())); mpDocSh->GetUndoManager()->AddUndoAction(pAction); pStyleSheet->GetItemSet().Put( *(pTempSet.get()) ); + sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() ); pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); } else if( bSetToAllPages ) @@ -423,6 +429,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) new StyleSheetUndoAction(mpDoc, (SfxStyleSheet*)pStyle, &(*pTempSet.get())); pUndoGroup->AddAction(pAction); pStyle->GetItemSet().Put( *(pTempSet.get()) ); + sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() ); pStyle->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); } @@ -437,7 +444,13 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) { SdBackgroundObjUndoAction *pBackgroundObjUndoAction = new SdBackgroundObjUndoAction(*mpDoc, *pPage, rFillAttributes); pUndoGroup->AddAction(pBackgroundObjUndoAction); - pPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE)); + + SdrPageProperties& rPageProperties = pPage->getSdrPageProperties(); + rPageProperties.ClearItem( XATTR_FILLBITMAP ); + rPageProperties.ClearItem( XATTR_FILLGRADIENT ); + rPageProperties.ClearItem( XATTR_FILLHATCH ); + rPageProperties.PutItem(XFillStyleItem(XFILL_NONE)); + pPage->ActionChanged(); } } @@ -599,8 +612,10 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs ) delete mpBackgroundObjUndoAction; mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction( *mpDoc, *mpPage, mpPage->getSdrPageProperties().GetItemSet()); + SfxItemSet aSet( *pArgs ); + sdr::properties::CleanupFillProperties(aSet); mpPage->getSdrPageProperties().ClearItem(); - mpPage->getSdrPageProperties().PutItemSet(*pArgs); + mpPage->getSdrPageProperties().PutItemSet(aSet); } } diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index 64a8791f94d6..b67c71061c7d 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -48,6 +48,7 @@ #include <editeng/lrspitem.hxx> #include <svx/svdopage.hxx> #include <svx/svditer.hxx> +#include <svx/sdr/properties/properties.hxx> #include <sfx2/viewfrm.hxx> #include <svx/xlndsit.hxx> @@ -471,6 +472,8 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) SfxItemSet& rAttr = pStyleSheet->GetItemSet(); + sdr::properties::CleanupFillProperties( rAttr ); + // check for unique names of named items for xml if( rAttr.GetItemState( XATTR_FILLBITMAP ) == SFX_ITEM_SET ) { |