summaryrefslogtreecommitdiff
path: root/sd/source/ui/func
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-04-07 13:14:23 +0200
committersb <sb@openoffice.org>2010-04-07 13:14:23 +0200
commit17d0f112effa923bc6bfeb799a775b9050941573 (patch)
tree6ff5dcb5d1338c41641b3deb5f0ae2886d579a92 /sd/source/ui/func
parent81835b80ab54e2e0b41c48286f9f021f3f4237b2 (diff)
parente725e315399f527e63f919a9a6861066b1f41512 (diff)
sb118: merged in re/DEV300_next towards DEV300_m76
Diffstat (limited to 'sd/source/ui/func')
-rw-r--r--sd/source/ui/func/fubullet.cxx2
-rw-r--r--sd/source/ui/func/fupage.cxx80
-rw-r--r--sd/source/ui/func/undoback.cxx28
3 files changed, 51 insertions, 59 deletions
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index f45ed82f4d3e..92b1450624e1 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -210,7 +210,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
SfxAbstractDialog* pDlg = pFact ? pFact->CreateSfxDialog( &mpView->GetViewShell()->GetViewFrame()->GetWindow(), aSet,
- mpView->GetViewShell()->GetViewFrame()->GetFrame()->GetFrameInterface(),
+ mpView->GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface(),
RID_SVXDLG_CHARMAP ) : 0;
if( !pDlg )
return;
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 134646f2368e..de1dadc3ae43 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -276,20 +276,28 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
}
else
{
- // Only this page, check if there is a background-object on that page
- SdrObject* pObj = mpPage->GetBackgroundObj();
- if( pObj )
+ // Only this page, get attributes for background fill
+ const SfxItemSet& rBackgroundAttributes = mpPage->getSdrPageProperties().GetItemSet();
+
+ if(XFILL_NONE != ((const XFillStyleItem&)rBackgroundAttributes.Get(XATTR_FILLSTYLE)).GetValue())
{
- aMergedAttr.Put(pObj->GetMergedItemSet());
+ // page attributes are used, take them
+ aMergedAttr.Put(rBackgroundAttributes);
}
else
{
- // if the page hasn't got a background-object, than use
- // the fillstyle-settings of the masterpage for the dialog
- if( pStyleSheet && pStyleSheet->GetItemSet().GetItemState( XATTR_FILLSTYLE ) != SFX_ITEM_DEFAULT )
- mergeItemSetsImpl( aMergedAttr, pStyleSheet->GetItemSet() );
+ if(pStyleSheet
+ && XFILL_NONE != ((const XFillStyleItem&)pStyleSheet->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue())
+ {
+ // if the page has no fill style, use the settings from the
+ // background stylesheet (if used)
+ mergeItemSetsImpl(aMergedAttr, pStyleSheet->GetItemSet());
+ }
else
- aMergedAttr.Put( XFillStyleItem( XFILL_NONE ) );
+ {
+ // no fill style from page, start with no fill style
+ aMergedAttr.Put(XFillStyleItem(XFILL_NONE));
+ }
}
}
}
@@ -371,12 +379,14 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
if( mbPageBckgrdDeleted )
{
- mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction( *mpDoc, *mpPage, mpPage->GetBackgroundObj() );
- mpPage->SetBackgroundObj( NULL );
-
- // #110094#-15
- // tell the page that it's visualization has changed
- mpPage->ActionChanged();
+ mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction(
+ *mpDoc, *mpPage, mpPage->getSdrPageProperties().GetItemSet());
+
+ if(!mpPage->IsMasterPage())
+ {
+ // on normal pages, switch off fill attribute usage
+ mpPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE));
+ }
}
}
@@ -403,15 +413,12 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
mpDoc->SetChanged(TRUE);
- SdrObject* pObj = mpPage->IsMasterPage() ?
- mpPage->GetPresObj( PRESOBJ_BACKGROUND ) :
- ((SdPage&)(mpPage->TRG_GetMasterPage())).GetPresObj( PRESOBJ_BACKGROUND );
- if( pObj )
- {
- // BackgroundObj: no hard attributes allowed
- SfxItemSet aSet( mpDoc->GetPool() );
- pObj->SetMergedItemSet(aSet);
- }
+ // BackgroundFill of Masterpage: no hard attributes allowed
+ SdrPage& rUsedMasterPage = mpPage->IsMasterPage() ? *mpPage : mpPage->TRG_GetMasterPage();
+ OSL_ENSURE(rUsedMasterPage.IsMasterPage(), "No MasterPage (!)");
+ rUsedMasterPage.getSdrPageProperties().ClearItem();
+ OSL_ENSURE(0 != rUsedMasterPage.getSdrPageProperties().GetStyleSheet(),
+ "MasterPage without StyleSheet detected (!)");
}
aNewAttr.Put(*(pTempSet.get()));
@@ -536,28 +543,11 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
if( !mbMasterPage && !mbPageBckgrdDeleted )
{
// Only this page
- SdrObject* pObj = mpPage->GetBackgroundObj();
-
delete mpBackgroundObjUndoAction;
- mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction( *mpDoc, *mpPage, pObj );
-
- if( !pObj )
- {
- pObj = new SdrRectObj();
- mpPage->SetBackgroundObj( pObj );
- }
-
- Point aPos ( nLeft, nUpper );
- Size aSize( mpPage->GetSize() );
- aSize.Width() -= nLeft + nRight - 1;
- aSize.Height() -= nUpper + nLower - 1;
- Rectangle aRect( aPos, aSize );
- pObj->SetLogicRect( aRect );
- pObj->SetMergedItemSet(*pArgs);
-
- // #110094#-15
- // tell the page that it's visualization has changed
- mpPage->ActionChanged();
+ mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction(
+ *mpDoc, *mpPage, mpPage->getSdrPageProperties().GetItemSet());
+ mpPage->getSdrPageProperties().ClearItem();
+ mpPage->getSdrPageProperties().PutItemSet(*pArgs);
}
}
diff --git a/sd/source/ui/func/undoback.cxx b/sd/source/ui/func/undoback.cxx
index 2f1ab259bc55..7f0245c50cda 100644
--- a/sd/source/ui/func/undoback.cxx
+++ b/sd/source/ui/func/undoback.cxx
@@ -32,6 +32,7 @@
#include "sdpage.hxx"
#include "sdresid.hxx"
#include "strings.hrc"
+#include <svl/itemset.hxx>
// ---------------------------
// - BackgroundObjUndoAction -
@@ -41,10 +42,13 @@ TYPEINIT1( SdBackgroundObjUndoAction, SdUndoAction );
// -----------------------------------------------------------------------------
-SdBackgroundObjUndoAction::SdBackgroundObjUndoAction( SdDrawDocument& rDoc, SdPage& rPage, const SdrObject* pBackgroundObj ) :
- SdUndoAction( &rDoc ),
- mrPage( rPage ),
- mpBackgroundObj( pBackgroundObj ? pBackgroundObj->Clone() : NULL )
+SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
+ SdDrawDocument& rDoc,
+ SdPage& rPage,
+ const SfxItemSet& rItenSet)
+: SdUndoAction(&rDoc),
+ mrPage(rPage),
+ mpItemSet(new SfxItemSet(rItenSet))
{
String aString( SdResId( STR_UNDO_CHANGE_PAGEFORMAT ) );
SetComment( aString );
@@ -54,20 +58,18 @@ SdBackgroundObjUndoAction::SdBackgroundObjUndoAction( SdDrawDocument& rDoc, SdPa
SdBackgroundObjUndoAction::~SdBackgroundObjUndoAction()
{
- SdrObject::Free( mpBackgroundObj );
+ delete mpItemSet;
}
// -----------------------------------------------------------------------------
void SdBackgroundObjUndoAction::ImplRestoreBackgroundObj()
{
- SdrObject* pOldObj = mrPage.GetBackgroundObj();
-
- if( pOldObj )
- pOldObj = pOldObj->Clone();
-
- mrPage.SetBackgroundObj( mpBackgroundObj );
- mpBackgroundObj = pOldObj;
+ SfxItemSet* pNew = new SfxItemSet(mrPage.getSdrPageProperties().GetItemSet());
+ mrPage.getSdrPageProperties().ClearItem();
+ mrPage.getSdrPageProperties().PutItemSet(*mpItemSet);
+ delete mpItemSet;
+ mpItemSet = pNew;
// #110094#-15
// tell the page that it's visualization has changed
@@ -92,5 +94,5 @@ void SdBackgroundObjUndoAction::Redo()
SdUndoAction* SdBackgroundObjUndoAction::Clone() const
{
- return new SdBackgroundObjUndoAction( *mpDoc, mrPage, mpBackgroundObj );
+ return new SdBackgroundObjUndoAction(*mpDoc, mrPage, *mpItemSet);
}