summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorChristian Lippka ORACLE <christian.lippka@oracle.com>2011-03-04 21:31:20 +0100
committerChristian Lippka ORACLE <christian.lippka@oracle.com>2011-03-04 21:31:20 +0100
commitf269295e80eba9515f48f09561d04594b2652469 (patch)
tree5c2e06048318849e55ac93775e85365ed898149b /sd
parent2785e67bbcd479f864ea941bfd9a47916fd04aa4 (diff)
impress210: #i50899# clean up fill attributes if fill style changes
Diffstat (limited to 'sd')
-rwxr-xr-xsd/source/ui/func/fupage.cxx27
-rwxr-xr-xsd/source/ui/func/futempl.cxx41
2 files changed, 21 insertions, 47 deletions
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 4d068e1fde90..d8736d9b8ccb 100755
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -38,20 +38,14 @@
#include <svx/svxids.hrc>
#include <svx/dialogs.hrc>
#include <svl/itempool.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <sfx2/request.hxx>
#include <svl/stritem.hxx>
#include <vcl/prntypes.hxx>
#include <svl/style.hxx>
#include <stlsheet.hxx>
-#ifndef _SVX_SVDORECT_HXX
#include <svx/svdorect.hxx>
-#endif
-#ifndef _SVX_SVDUNDO_HXX
#include <svx/svdundo.hxx>
-#endif
#include <editeng/eeitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <svx/xbtmpit.hxx>
@@ -59,6 +53,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>
@@ -393,7 +388,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));
}
}
}
@@ -409,6 +408,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 )
@@ -430,6 +430,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));
}
@@ -444,7 +445,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();
}
}
@@ -606,8 +613,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 d7a251cee531..363eba2f6dab 100755
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -49,6 +49,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>
@@ -454,6 +455,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
sStyleName.Append( sal_Unicode( ' ' ));
pStyleSheet->GetItemSet().Put(aTempSet);
+
SdStyleSheet* pRealSheet =((SdStyleSheet*)pStyleSheet)->GetRealStyleSheet();
pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
@@ -477,45 +479,8 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
SfxItemSet& rAttr = pStyleSheet->GetItemSet();
-/* #i35937#
- if ( rAttr.GetItemState( EE_PARA_LRSPACE ) == SFX_ITEM_ON )
- {
- // SvxLRSpaceItem hart gesetzt: NumBulletItem anpassen
- if ( aOriSet.GetItemState( EE_PARA_LRSPACE ) != SFX_ITEM_ON ||
- (const SvxLRSpaceItem&) aOriSet.Get( EE_PARA_LRSPACE ) !=
- (const SvxLRSpaceItem&) rAttr.Get( EE_PARA_LRSPACE ) )
- {
- SvxNumBulletItem aNumBullet( (const SvxNumBulletItem&) rAttr.Get(EE_PARA_NUMBULLET) );
-
- sal_uInt16 nLevel = 0;
- if( (ePO >= PO_OUTLINE_2) && (ePO <= PO_OUTLINE_9) )
- nLevel = (sal_uInt16)(ePO - PO_OUTLINE_1 + 1);
-
- EditEngine::ImportBulletItem( aNumBullet, nLevel, NULL,
- &(const SvxLRSpaceItem&) rAttr.Get( EE_PARA_LRSPACE ) );
+ sdr::properties::CleanupFillProperties( rAttr );
- // the numbering bullet item is not valid in styles Outline 2 to Outline 9
- if( nLevel != 0 )
- {
- // so put it into Outline 1 then..
- String sStyleName((SdResId(STR_PSEUDOSHEET_OUTLINE)));
- sStyleName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " 1" ) );
- SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( sStyleName, SD_STYLE_FAMILY_PSEUDO);
-
- if(pFirstStyleSheet)
- {
- pFirstStyleSheet->GetItemSet().Put( aNumBullet);
- SdStyleSheet* pRealSheet = ((SdStyleSheet*)pFirstStyleSheet)->GetRealStyleSheet();
- pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
- }
- }
- else
- {
- ( (SfxItemSet&) rAttr).Put( aNumBullet );
- }
- }
- }
-*/
// check for unique names of named items for xml
if( rAttr.GetItemState( XATTR_FILLBITMAP ) == SFX_ITEM_SET )
{