summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2010-02-11 17:35:16 +0100
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2010-02-11 17:35:16 +0100
commitc44386b26b233abc19936a99efb3ac7781bdaefc (patch)
tree7761d694ac9b50ac7e91d8df64dc59fa54a231c8 /sd
parent320a65cdff355760da860f5f55689056d39089d6 (diff)
aw079 #i99386# cleanup of define and last change from CL
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/pres.hxx3
-rw-r--r--sd/inc/sdpage.hxx8
-rw-r--r--sd/source/core/drawdoc.cxx27
-rw-r--r--sd/source/core/sdpage.cxx130
-rw-r--r--sd/source/filter/cgm/sdcgmfilter.cxx14
-rw-r--r--sd/source/filter/ppt/pptin.cxx32
-rw-r--r--sd/source/ui/func/fupage.cxx64
-rw-r--r--sd/source/ui/func/undoback.cxx28
-rw-r--r--sd/source/ui/inc/drawview.hxx4
-rw-r--r--sd/source/ui/inc/undoback.hxx15
-rw-r--r--sd/source/ui/toolpanel/controls/DocumentHelper.cxx9
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx31
-rw-r--r--sd/source/ui/unoidl/unopage.cxx108
-rw-r--r--sd/source/ui/unoidl/unopage.hxx1
-rw-r--r--sd/source/ui/unoidl/unopback.cxx19
-rw-r--r--sd/source/ui/unoidl/unopback.hxx11
-rw-r--r--sd/source/ui/view/drawview.cxx19
-rw-r--r--sd/source/ui/view/sdview.cxx8
18 files changed, 10 insertions, 521 deletions
diff --git a/sd/inc/pres.hxx b/sd/inc/pres.hxx
index 8dfbcce4cbcb..b824a459ba50 100644
--- a/sd/inc/pres.hxx
+++ b/sd/inc/pres.hxx
@@ -42,9 +42,6 @@ enum PresObjKind
PRESOBJ_ORGCHART,
PRESOBJ_TABLE,
PRESOBJ_IMAGE,
-#ifndef NEWPBG
- PRESOBJ_BACKGROUND,
-#endif
PRESOBJ_PAGE,
PRESOBJ_HANDOUT,
PRESOBJ_NOTES,
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 98ae4fc18607..8c39e5278a32 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -160,10 +160,6 @@ protected:
/** a helper class to manipulate effects inside the main sequence */
boost::shared_ptr< sd::MainSequence > mpMainSequence;
-#ifndef NEWPBG
- void AdjustBackgroundSize();
-#endif
-
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
SfxItemSet* mpItems;
@@ -199,17 +195,13 @@ public:
sd::ShapeList& GetPresentationShapeList() { return maPresentationShapeList; }
-#ifdef NEWPBG
void EnsureMasterPageDefaultBackground();
-#endif
SdrObject* CreatePresObj(PresObjKind eObjKind, BOOL bVertical, const Rectangle& rRect, BOOL bInsert=FALSE);
SdrObject* CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert);
SdrObject* GetPresObj(PresObjKind eObjKind, int nIndex = 1 );
PresObjKind GetPresObjKind(SdrObject* pObj) const;
String GetPresObjText(PresObjKind eObjKind) const;
-#ifdef NEWPBG
SfxStyleSheet* GetStyleSheetForMasterPageBackground() const;
-#endif
SfxStyleSheet* GetStyleSheetForPresObj(PresObjKind eObjKind) const;
bool RestoreDefaultText( SdrObject* pObj );
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 1eea24cd2b4e..4d1fa634f905 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -637,26 +637,6 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
if( aName != pPage->GetName() )
pPage->SetName( aName );
-#ifndef NEWPBG
- SdrObject* pPresObj = pPage->GetPresObj( PRESOBJ_BACKGROUND ) ;
-
- if( pPage->GetPageKind() == PK_STANDARD )
- {
- DBG_ASSERT( pPresObj, "Masterpage without a background object!" );
- if (pPresObj && pPresObj->GetOrdNum() != 0 )
- pPage->NbcSetObjectOrdNum(pPresObj->GetOrdNum(),0);
- }
- else
- {
- DBG_ASSERT( pPresObj == NULL, "Non Standard Masterpage with a background object!\n(This assertion is ok for old binary files)" );
- if( pPresObj )
- {
- pPage->RemoveObject( pPresObj->GetOrdNum() );
- pPage->RemovePresObj(pPresObj);
- SdrObject::Free( pPresObj );
- }
- }
-#endif
}
// Sprachabhaengige Namen der StandardLayer erzeugen
@@ -728,13 +708,6 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
SdPage* pPage = (SdPage*)GetMasterPage(nPage);
NewOrLoadCompleted( pPage, pSPool );
-
-#ifndef NEWPBG
- // BackgroundObjekt vor Selektion schuetzen #62144#
- SdrObject* pBackObj = pPage->GetPresObj(PRESOBJ_BACKGROUND);
- if(pBackObj)
- pBackObj->SetMarkProtect(TRUE);
-#endif
}
}
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index f8086e861a9b..c197c547144e 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -180,7 +180,6 @@ SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex )
return 0;
}
-#ifdef NEWPBG
/** create background properties */
void SdPage::EnsureMasterPageDefaultBackground()
{
@@ -203,7 +202,6 @@ void SdPage::EnsureMasterPageDefaultBackground()
}
}
}
-#endif
/** creates a presentation object with the given PresObjKind on this page. A user call will be set
*/
@@ -315,17 +313,6 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, BOOL bVertical, const Rec
}
break;
-#ifndef NEWPBG
- case PRESOBJ_BACKGROUND:
- {
- pSdrObj = new SdrRectObj();
- pSdrObj->SetMoveProtect(TRUE);
- pSdrObj->SetResizeProtect(TRUE);
- pSdrObj->SetMarkProtect(TRUE);
- }
- break;
-#endif
-
case PRESOBJ_HANDOUT:
{
//Erste Standardseite am SdrPageObj vermerken
@@ -476,20 +463,9 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, BOOL bVertical, const Rec
{
SdrLayerAdmin& rLayerAdmin = pModel->GetLayerAdmin();
-#ifndef NEWPBG
- if (eObjKind == PRESOBJ_BACKGROUND)
- {
- // Hintergrund der MasterPage
- pSdrObj->SetLayer( rLayerAdmin.
- GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), FALSE) );
- }
- else
-#endif
- {
- // Hintergrundobjekte der MasterPage
- pSdrObj->SetLayer( rLayerAdmin.
- GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), FALSE) );
- }
+ // Hintergrundobjekte der MasterPage
+ pSdrObj->SetLayer( rLayerAdmin.
+ GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), FALSE) );
}
// Objekt am StyleSheet anmelden
@@ -556,7 +532,6 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, BOOL bVertical, const Rec
|*
\************************************************************************/
-#ifdef NEWPBG
SfxStyleSheet* SdPage::GetStyleSheetForMasterPageBackground() const
{
String aName(GetLayoutName());
@@ -575,7 +550,6 @@ SfxStyleSheet* SdPage::GetStyleSheetForMasterPageBackground() const
SfxStyleSheetBase* pResult = pStShPool->Find(aName, SD_STYLE_FAMILY_MASTERPAGE);
return (SfxStyleSheet*)pResult;
}
-#endif
SfxStyleSheet* SdPage::GetStyleSheetForPresObj(PresObjKind eObjKind) const
{
@@ -602,12 +576,6 @@ SfxStyleSheet* SdPage::GetStyleSheetForPresObj(PresObjKind eObjKind) const
aName += String(SdResId(STR_LAYOUT_TITLE));
break;
-#ifndef NEWPBG
- case PRESOBJ_BACKGROUND:
- aName += String(SdResId(STR_LAYOUT_BACKGROUND));
- break;
-#endif
-
case PRESOBJ_NOTES:
aName += String(SdResId(STR_LAYOUT_NOTES));
break;
@@ -773,13 +741,7 @@ void SdPage::CreateTitleAndLayout(BOOL bInit, BOOL bCreate )
**************************************************************************/
if( mePageKind == PK_STANDARD )
{
-#ifdef NEWPBG
pMasterPage->EnsureMasterPageDefaultBackground();
-#else
- SdrObject* pMasterBackground = pMasterPage->GetPresObj( PRESOBJ_BACKGROUND );
- if( pMasterBackground == NULL )
- pMasterPage->CreateDefaultPresObj(PRESOBJ_BACKGROUND, true);
-#endif
}
if( ( (SdDrawDocument*) GetModel() )->GetDocumentType() == DOCUMENT_TYPE_IMPRESS )
@@ -963,17 +925,6 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert)
return NULL;
}
}
-#ifndef NEWPBG
- else if( eObjKind == PRESOBJ_BACKGROUND )
- {
- Point aBackgroundPos ( GetLftBorder(), GetUppBorder() );
- Size aBackgroundSize ( GetSize() );
- aBackgroundSize.Width() -= GetLftBorder() + GetRgtBorder() - 1;
- aBackgroundSize.Height() -= GetUppBorder() + GetLwrBorder() - 1;
- Rectangle aBackgroundRect(aBackgroundPos, aBackgroundSize);
- return CreatePresObj( PRESOBJ_BACKGROUND, FALSE, aBackgroundRect, bInsert );
- }
-#endif
else
{
DBG_ERROR("SdPage::CreateDefaultPresObj() - unknown PRESOBJ kind" );
@@ -1707,9 +1658,6 @@ void SdPage::SetSize(const Size& aSize)
if (aSize != aOldSize)
{
FmFormPage::SetSize(aSize);
-#ifndef NEWPBG
- AdjustBackgroundSize();
-#endif
if (aOldSize.Height() == 10 && aOldSize.Width() == 10)
{
@@ -1740,9 +1688,6 @@ void SdPage::SetBorder(INT32 nLft, INT32 nUpp, INT32 nRgt, INT32 nLwr)
nRgt != GetRgtBorder() || nLwr != GetLwrBorder() )
{
FmFormPage::SetBorder(nLft, nUpp, nRgt, nLwr);
-#ifndef NEWPBG
- AdjustBackgroundSize();
-#endif
}
}
@@ -1758,9 +1703,6 @@ void SdPage::SetLftBorder(INT32 nBorder)
if (nBorder != GetLftBorder() )
{
FmFormPage::SetLftBorder(nBorder);
-#ifndef NEWPBG
- AdjustBackgroundSize();
-#endif
}
}
@@ -1776,9 +1718,6 @@ void SdPage::SetRgtBorder(INT32 nBorder)
if (nBorder != GetRgtBorder() )
{
FmFormPage::SetRgtBorder(nBorder);
-#ifndef NEWPBG
- AdjustBackgroundSize();
-#endif
}
}
@@ -1794,9 +1733,6 @@ void SdPage::SetUppBorder(INT32 nBorder)
if (nBorder != GetUppBorder() )
{
FmFormPage::SetUppBorder(nBorder);
-#ifndef NEWPBG
- AdjustBackgroundSize();
-#endif
}
}
@@ -1812,9 +1748,6 @@ void SdPage::SetLwrBorder(INT32 nBorder)
if (nBorder != GetLwrBorder() )
{
FmFormPage::SetLwrBorder(nBorder);
-#ifndef NEWPBG
- AdjustBackgroundSize();
-#endif
}
}
@@ -1829,9 +1762,6 @@ void SdPage::SetBackgroundFullSize( BOOL bIn )
if( bIn != mbBackgroundFullSize )
{
mbBackgroundFullSize = bIn;
-#ifndef NEWPBG
- AdjustBackgroundSize();
-#endif
}
}
@@ -1921,23 +1851,10 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
if (pObj)
{
-#ifndef NEWPBG
- USHORT nIndexBackground = 0;
-#endif
// #88084# remember aTopLeft as original TopLeft
Point aTopLeft(pObj->GetCurrentBoundRect().TopLeft());
-#ifndef NEWPBG
- if (bIsPresObjOnMaster && (pObj == GetPresObj(PRESOBJ_BACKGROUND, nIndexBackground)) )
- {
- /**************************************************************
- * 1. Praesentationsobjekte auf Handzettelseite sollen nur positioniert werden
- * 2. Hintergrundobjekt wird nicht skaliert
- **************************************************************/
- }
- else
-#endif
- if (!pObj->IsEdgeObj())
+ if (!pObj->IsEdgeObj())
{
/**************************************************************
* Objekt skalieren
@@ -2649,45 +2566,6 @@ const String& SdPage::GetName() const
return maCreatedPageName;
}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-#ifndef NEWPBG
-void SdPage::AdjustBackgroundSize()
-{
- SdrObject* pObj = GetPresObj(PRESOBJ_BACKGROUND);
-
- if (pObj)
- {
- // Hintergrund-Objekt verschieben
- pObj->SetMoveProtect(FALSE);
- pObj->SetResizeProtect(FALSE);
-
- {
- sd::ScopeLockGuard aGuard( maLockAutoLayoutArrangement );
-
- Point aBackgroundPos;
- Size aBackgroundSize( GetSize() );
-
- if( !mbBackgroundFullSize )
- {
- aBackgroundPos = Point( GetLftBorder(), GetUppBorder() );
- aBackgroundSize.Width() -= GetLftBorder() + GetRgtBorder() - 1;
- aBackgroundSize.Height() -= GetUppBorder() + GetLwrBorder() - 1;
- }
- Rectangle aBackgroundRect (aBackgroundPos, aBackgroundSize);
- pObj->SetLogicRect(aBackgroundRect);
- }
- pObj->SetMoveProtect(TRUE);
- pObj->SetResizeProtect(TRUE);
- }
-}
-#endif
-
/*************************************************************************
|*
|*
diff --git a/sd/source/filter/cgm/sdcgmfilter.cxx b/sd/source/filter/cgm/sdcgmfilter.cxx
index 3fed48ac1857..e4beb91795e3 100644
--- a/sd/source/filter/cgm/sdcgmfilter.cxx
+++ b/sd/source/filter/cgm/sdcgmfilter.cxx
@@ -114,7 +114,6 @@ sal_Bool SdCGMFilter::Import()
if( ( nRetValue &~0xff000000 ) != 0xffffff ) // maybe the backgroundcolor is already white
{ // so we must not set a master page
mrDocument.StopWorkStartupDelay();
-#ifdef NEWPBG
SdPage* pSdPage = mrDocument.GetMasterSdPage(0, PK_STANDARD);
if(pSdPage)
@@ -124,19 +123,6 @@ sal_Bool SdCGMFilter::Import()
pSdPage->getSdrPageProperties().PutItem(XFillColorItem(String(), aColor));
pSdPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_SOLID));
}
-#else
- SdrObject* pObj = mrDocument.GetMasterSdPage(0, PK_STANDARD)->GetPresObj(PRESOBJ_BACKGROUND);
-
- if( pObj )
- {
- SfxItemSet aSet( mrDocument.GetPool() );
- Color aColor( (BYTE)( nRetValue >> 16 ), (BYTE)( nRetValue >> 8 ), (BYTE)( nRetValue >> 16 ) );
-
- aSet.Put( XFillColorItem( String(), aColor ) );
- aSet.Put( XFillStyleItem( XFILL_SOLID ) );
- pObj->SetMergedItemSetAndBroadcast( aSet );
- }
-#endif
}
}
}
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 09a1566cc7f0..241ba8fc59b2 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -864,7 +864,6 @@ sal_Bool ImplSdPPTImport::Import()
{
if ( pMPage->GetPageKind() == PK_STANDARD )
{
-#ifdef NEWPBG
// transform data from imported background object to new form
// and delete the object. It was used as container to transport
// the attributes of the MasterPage background fill
@@ -888,37 +887,6 @@ sal_Bool ImplSdPPTImport::Import()
pMPage->RemoveObject(pObj->GetOrdNum());
SdrObject::Free(pObj);
-#else
- // Hintergrundobjekt gefunden (erstes Objekt der MasterPage)
- pObj->SetEmptyPresObj( TRUE );
- pObj->SetUserCall( pMPage );
- pObj->SetLayer( mnBackgroundLayerID );
-
- // Schatten am ersten Objekt (Hintergrundobjekt) entfernen (#57918#)
- SfxItemSet aTempAttr( mpDoc->GetPool() );
- aTempAttr.Put( pObj->GetMergedItemSet() );
-
- BOOL bShadowIsOn = ( (SdrShadowItem&)( aTempAttr.Get( SDRATTR_SHADOW ) ) ).GetValue();
- if( bShadowIsOn )
- {
- aTempAttr.Put( SdrShadowItem( FALSE ) );
- pObj->SetMergedItemSet( aTempAttr );
- }
- SfxStyleSheet* pSheet = pMPage->GetStyleSheetForPresObj( PRESOBJ_BACKGROUND );
- if ( pSheet )
- { // StyleSheet fuellen und dem Objekt zuweisen
- pSheet->GetItemSet().ClearItem();
- pSheet->GetItemSet().Put( pObj->GetMergedItemSet() );
- aTempAttr.ClearItem();
- pObj->SetMergedItemSet( aTempAttr );
- pObj->SetStyleSheet( pSheet, FALSE );
- }
- pMPage->InsertPresObj( pObj, PRESOBJ_BACKGROUND );
-
- // #110094#-15
- // tell the page that it's visualization has changed
- pMPage->ActionChanged();
-#endif
}
}
}
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 8affe9314d3c..420f6d762065 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -279,7 +279,6 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
}
else
{
-#ifdef NEWPBG
// Only this page, get attributes for background fill
const SfxItemSet& rBackgroundAttributes = mpPage->getSdrPageProperties().GetItemSet();
@@ -303,23 +302,6 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
aMergedAttr.Put(XFillStyleItem(XFILL_NONE));
}
}
-#else
- // Only this page, check if there is a background-object on that page
- SdrObject* pObj = mpPage->GetBackgroundObj();
- if( pObj )
- {
- aMergedAttr.Put(pObj->GetMergedItemSet());
- }
- 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() );
- else
- aMergedAttr.Put( XFillStyleItem( XFILL_NONE ) );
- }
-#endif
}
}
@@ -400,7 +382,6 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
if( mbPageBckgrdDeleted )
{
-#ifdef NEWPBG
mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction(
*mpDoc, *mpPage, mpPage->getSdrPageProperties().GetItemSet());
@@ -409,14 +390,6 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
// on normal pages, switch off fill attribute usage
mpPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE));
}
-#else
- mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction( *mpDoc, *mpPage, mpPage->GetBackgroundObj() );
- mpPage->SetBackgroundObj( NULL );
-
- // #110094#-15
- // tell the page that it's visualization has changed
- mpPage->ActionChanged();
-#endif
}
}
@@ -443,24 +416,12 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
mpDoc->SetChanged(TRUE);
-#ifdef NEWPBG
// 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 (!)");
-#else
- 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);
- }
-#endif
}
aNewAttr.Put(*(pTempSet.get()));
@@ -585,36 +546,11 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
if( !mbMasterPage && !mbPageBckgrdDeleted )
{
// Only this page
-#ifdef NEWPBG
delete mpBackgroundObjUndoAction;
mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction(
*mpDoc, *mpPage, mpPage->getSdrPageProperties().GetItemSet());
mpPage->getSdrPageProperties().ClearItem();
mpPage->getSdrPageProperties().PutItemSet(*pArgs);
-#else
- 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();
-#endif
}
}
diff --git a/sd/source/ui/func/undoback.cxx b/sd/source/ui/func/undoback.cxx
index 47cd4c8262b2..9df74fb26e97 100644
--- a/sd/source/ui/func/undoback.cxx
+++ b/sd/source/ui/func/undoback.cxx
@@ -35,10 +35,7 @@
#include "sdpage.hxx"
#include "sdresid.hxx"
#include "strings.hrc"
-
-#ifdef NEWPBG
#include <svl/itemset.hxx>
-#endif
// ---------------------------
// - BackgroundObjUndoAction -
@@ -48,7 +45,6 @@ TYPEINIT1( SdBackgroundObjUndoAction, SdUndoAction );
// -----------------------------------------------------------------------------
-#ifdef NEWPBG
SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
SdDrawDocument& rDoc,
SdPage& rPage,
@@ -56,12 +52,6 @@ SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
: SdUndoAction(&rDoc),
mrPage(rPage),
mpItemSet(new SfxItemSet(rItenSet))
-#else
-SdBackgroundObjUndoAction::SdBackgroundObjUndoAction( SdDrawDocument& rDoc, SdPage& rPage, const SdrObject* pBackgroundObj ) :
- SdUndoAction( &rDoc ),
- mrPage( rPage ),
- mpBackgroundObj( pBackgroundObj ? pBackgroundObj->Clone() : NULL )
-#endif
{
String aString( SdResId( STR_UNDO_CHANGE_PAGEFORMAT ) );
SetComment( aString );
@@ -71,32 +61,18 @@ SdBackgroundObjUndoAction::SdBackgroundObjUndoAction( SdDrawDocument& rDoc, SdPa
SdBackgroundObjUndoAction::~SdBackgroundObjUndoAction()
{
-#ifdef NEWPBG
delete mpItemSet;
-#else
- SdrObject::Free( mpBackgroundObj );
-#endif
}
// -----------------------------------------------------------------------------
void SdBackgroundObjUndoAction::ImplRestoreBackgroundObj()
{
-#ifdef NEWPBG
SfxItemSet* pNew = new SfxItemSet(mrPage.getSdrPageProperties().GetItemSet());
mrPage.getSdrPageProperties().ClearItem();
mrPage.getSdrPageProperties().PutItemSet(*mpItemSet);
delete mpItemSet;
mpItemSet = pNew;
-#else
- SdrObject* pOldObj = mrPage.GetBackgroundObj();
-
- if( pOldObj )
- pOldObj = pOldObj->Clone();
-
- mrPage.SetBackgroundObj( mpBackgroundObj );
- mpBackgroundObj = pOldObj;
-#endif
// #110094#-15
// tell the page that it's visualization has changed
@@ -121,9 +97,5 @@ void SdBackgroundObjUndoAction::Redo()
SdUndoAction* SdBackgroundObjUndoAction::Clone() const
{
-#ifdef NEWPBG
return new SdBackgroundObjUndoAction(*mpDoc, mrPage, *mpItemSet);
-#else
- return new SdBackgroundObjUndoAction( *mpDoc, mrPage, mpBackgroundObj );
-#endif
}
diff --git a/sd/source/ui/inc/drawview.hxx b/sd/source/ui/inc/drawview.hxx
index fa3d3a13b1e2..37a2608d7390 100644
--- a/sd/source/ui/inc/drawview.hxx
+++ b/sd/source/ui/inc/drawview.hxx
@@ -77,10 +77,6 @@ public:
void PresPaint(const Region& rRegion);
-#ifndef NEWPBG
- virtual SdrObject* GetMaxToBtmObj(SdrObject* pObj) const;
-#endif
-
virtual void DeleteMarked(); // from SdrView
protected:
virtual void ModelHasChanged();
diff --git a/sd/source/ui/inc/undoback.hxx b/sd/source/ui/inc/undoback.hxx
index aac9640a4c46..f99c55adf25d 100644
--- a/sd/source/ui/inc/undoback.hxx
+++ b/sd/source/ui/inc/undoback.hxx
@@ -31,18 +31,11 @@
#ifndef _SD_UNDOBACK_HXX
#define _SD_UNDOBACK_HXX
-#define NEWPBG
-
#include "sdundo.hxx"
class SdDrawDocument;
class SdPage;
-
-#ifdef NEWPBG
class SfxItemSet;
-#else
-class SdrObject;
-#endif
// -----------------------------
// - SdBackgroundObjUndoAction -
@@ -53,11 +46,7 @@ class SdBackgroundObjUndoAction : public SdUndoAction
private:
SdPage& mrPage;
-#ifdef NEWPBG
SfxItemSet* mpItemSet;
-#else
- SdrObject* mpBackgroundObj;
-#endif
void ImplRestoreBackgroundObj();
@@ -65,14 +54,10 @@ public:
TYPEINFO();
-#ifdef NEWPBG
SdBackgroundObjUndoAction(
SdDrawDocument& rDoc,
SdPage& rPage,
const SfxItemSet& rItenSet);
-#else
- SdBackgroundObjUndoAction( SdDrawDocument& rDoc, SdPage& rPage, const SdrObject* pBackgroundObj );
-#endif
virtual ~SdBackgroundObjUndoAction();
virtual void Undo();
diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
index 499faea57abf..ac45b53ffc37 100644
--- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
+++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
@@ -46,9 +46,7 @@
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include "stlpool.hxx"
-#ifdef NEWPBG
#include <svx/xfillit0.hxx>
-#endif
using namespace ::com::sun::star;
namespace sd { namespace toolpanel { namespace controls {
@@ -450,18 +448,11 @@ void DocumentHelper::AssignMasterPageToPage (
// 1. Remove the background object (so that that, if it exists, does
// not override the new master page) and assign the master page to
// the regular slide.
-#ifdef NEWPBG
pDocument->GetDocSh()->GetUndoManager()->AddUndoAction(
new SdBackgroundObjUndoAction(
*pDocument, *pPage, pPage->getSdrPageProperties().GetItemSet()),
TRUE);
pPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE));
-#else
- pDocument->GetDocSh()->GetUndoManager()->AddUndoAction(
- new SdBackgroundObjUndoAction(*pDocument, *pPage, pPage->GetBackgroundObj()),
- TRUE);
- pPage->SetBackgroundObj(NULL);
-#endif
pDocument->SetMasterPage (
(pPage->GetPageNum()-1)/2,
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index e2a7f66dfd2f..8e5990d672cf 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -460,24 +460,9 @@ void SdXImpressDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if( hasEventListeners() )
{
-#ifndef NEWPBG
- bool bBackgroundShape = false;
-
- // the background shape itself has no api representation, so filter all notifies for it
- const SdrObject* pSdrObj = pSdrHint->GetObject();
- if( pSdrObj && (pSdrObj->GetObjInventor() == SdrInventor) && (pSdrObj->GetObjIdentifier() == OBJ_RECT) )
- {
- SdPage* pPage = (SdPage*)pSdrObj->GetPage();
- bBackgroundShape = pPage && (pPage->GetPresObjKind(const_cast<SdrObject*>(pSdrObj)) == PRESOBJ_BACKGROUND);
- }
-
- if( !bBackgroundShape )
-#endif
- {
- document::EventObject aEvent;
- if( SvxUnoDrawMSFactory::createEvent( mpDoc, pSdrHint, aEvent ) )
- notifyEvent( aEvent );
- }
+ document::EventObject aEvent;
+ if( SvxUnoDrawMSFactory::createEvent( mpDoc, pSdrHint, aEvent ) )
+ notifyEvent( aEvent );
}
if( pSdrHint->GetKind() == HINT_MODELCLEARED )
@@ -2750,18 +2735,8 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn
mpDoc->InsertMasterPage(pMPage, (USHORT)nInsertPos);
{
-#ifdef NEWPBG
// ensure default MasterPage fill
pMPage->EnsureMasterPageDefaultBackground();
-#else
- // insert background object
- Point aBackgroundPos ( pMPage->GetLftBorder(), pMPage->GetUppBorder() );
- Size aBackgroundSize ( pMPage->GetSize() );
- aBackgroundSize.Width() -= pMPage->GetLftBorder() + pMPage->GetRgtBorder() - 1;
- aBackgroundSize.Height() -= pMPage->GetUppBorder() + pMPage->GetLwrBorder() - 1;
- Rectangle aBackgroundRect (aBackgroundPos, aBackgroundSize);
- pMPage->CreatePresObj(PRESOBJ_BACKGROUND, FALSE, aBackgroundRect, sal_True );
-#endif
}
xDrawPage = uno::Reference< drawing::XDrawPage >::query( pMPage->getUnoPage() );
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 37e874eecbf4..9b1416db0dac 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -364,7 +364,6 @@ SdGenericDrawPage::SdGenericDrawPage( SdXImpressDocument* _pModel, SdPage* pInPa
mpModel ( _pModel ),
mpSdrModel(0),
mpPropSet ( _pSet ),
- mbHasBackgroundObject(sal_False),
mbIsImpressDocument(false)
{
mpSdrModel = SvxFmDrawPage::mpModel;
@@ -1392,11 +1391,6 @@ Reference< drawing::XShape > SdGenericDrawPage::_CreateShape( SdrObject *pObj )
case PRESOBJ_TABLE:
aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("TableShape") );
break;
-#ifndef NEWPBG
- case PRESOBJ_BACKGROUND:
- DBG_ASSERT( sal_False, "Danger! Someone got hold of the horrible background shape!" );
- break;
-#endif
case PRESOBJ_PAGE:
aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("PageShape") );
break;
@@ -2471,47 +2465,11 @@ void SdDrawPage::setBackground( const Any& rValue )
if( !xSet.is() )
{
-#ifdef NEWPBG
// the easy case, no background set. Set XFILL_NONE to represent this
GetPage()->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE));
-#else
- // the easy case, clear the background obj
- GetPage()->SetBackgroundObj( NULL );
-
- // #110094#-15
- // tell the page that it's visualization has changed
- GetPage()->ActionChanged();
-#endif
-
return;
}
-#ifndef NEWPBG
- // prepare background object
- SdrObject* pObj = GetPage()->GetBackgroundObj();
- if( NULL == pObj )
- {
- pObj = new SdrRectObj();
- GetPage()->SetBackgroundObj( pObj );
-
- // #110094#-15
- // tell the page that it's visualization has changed
- GetPage()->ActionChanged();
- }
-
- const sal_Int32 nLeft = GetPage()->GetLftBorder();
- const sal_Int32 nRight = GetPage()->GetRgtBorder();
- const sal_Int32 nUpper = GetPage()->GetUppBorder();
- const sal_Int32 nLower = GetPage()->GetLwrBorder();
-
- Point aPos ( nLeft, nRight );
- Size aSize( GetPage()->GetSize() );
- aSize.Width() -= nLeft + nRight - 1;
- aSize.Height() -= nUpper + nLower - 1;
- Rectangle aRect( aPos, aSize );
- pObj->SetLogicRect( aRect );
-#endif
-
// is it our own implementation?
SdUnoPageBackground* pBack = SdUnoPageBackground::getImplementation( xSet );
@@ -2549,22 +2507,14 @@ void SdDrawPage::setBackground( const Any& rValue )
//-/ pObj->NbcSetAttributes( aSet, sal_False );
if( aSet.Count() == 0 )
{
-#ifdef NEWPBG
// no background fill, represent by setting XFILL_NONE
GetPage()->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE));
-#else
- GetPage()->SetBackgroundObj( NULL );
-#endif
}
else
{
-#ifdef NEWPBG
// background fill, set at page (not sure if ClearItem is needed)
GetPage()->getSdrPageProperties().ClearItem();
GetPage()->getSdrPageProperties().PutItemSet(aSet);
-#else
- pObj->SetMergedItemSet(aSet);
-#endif
}
// repaint only
@@ -2595,7 +2545,6 @@ Reference< XAnnotationEnumeration > SAL_CALL SdGenericDrawPage::createAnnotation
void SdDrawPage::getBackground( Any& rValue ) throw()
{
-#ifdef NEWPBG
const SfxItemSet& rFillAttributes = GetPage()->getSdrPageProperties().GetItemSet();
if(XFILL_NONE == ((const XFillStyleItem&)rFillAttributes.Get(XATTR_FILLSTYLE)).GetValue())
@@ -2611,18 +2560,6 @@ void SdDrawPage::getBackground( Any& rValue ) throw()
&GetPage()->getSdrPageProperties().GetItemSet()));
rValue <<= xSet;
}
-#else
- SdrObject* pObj = GetPage()->GetBackgroundObj();
- if( NULL == pObj )
- {
- rValue.clear();
- }
- else
- {
- Reference< beans::XPropertySet > xSet( new SdUnoPageBackground( GetModel()->GetDoc(), pObj ) );
- rValue <<= xSet;
- }
-#endif
}
void SdGenericDrawPage::setNavigationOrder( const Any& rValue )
@@ -2724,7 +2661,6 @@ Any SdGenericDrawPage::getNavigationOrder()
SdMasterPage::SdMasterPage( SdXImpressDocument* pModel, SdPage* pPage ) throw()
: SdGenericDrawPage( pModel, pPage, ImplGetMasterPagePropertySet( pPage ? pPage->GetPageKind() : PK_STANDARD ) )
{
- mbHasBackgroundObject = pPage && GetPage()->GetPageKind() == PK_STANDARD;
}
SdMasterPage::~SdMasterPage() throw()
@@ -2869,7 +2805,7 @@ sal_Bool SAL_CALL SdMasterPage::hasElements() throw(uno::RuntimeException)
if( SvxFmDrawPage::mpPage == NULL )
return sal_False;
- return (SvxFmDrawPage::mpPage->GetObjCount() > 1) || (!mbHasBackgroundObject && SvxFmDrawPage::mpPage->GetObjCount() == 1 );
+ return SvxFmDrawPage::mpPage->GetObjCount() > 0;
}
uno::Type SAL_CALL SdMasterPage::getElementType()
@@ -2886,13 +2822,7 @@ sal_Int32 SAL_CALL SdMasterPage::getCount()
throwIfDisposed();
- sal_Int32 nCount = SdGenericDrawPage::getCount();
- DBG_ASSERT( !mbHasBackgroundObject || (nCount > 0), "possible wrong shape count!" );
-
- if( mbHasBackgroundObject && ( nCount > 0 ) )
- nCount--;
-
- return nCount;
+ return SdGenericDrawPage::getCount();
}
Any SAL_CALL SdMasterPage::getByIndex( sal_Int32 Index )
@@ -2902,9 +2832,6 @@ Any SAL_CALL SdMasterPage::getByIndex( sal_Int32 Index )
throwIfDisposed();
- if( mbHasBackgroundObject )
- Index++;
-
return SdGenericDrawPage::getByIndex(Index);
}
@@ -3004,21 +2931,9 @@ void SdMasterPage::setBackground( const Any& rValue )
}
}
-#ifdef NEWPBG
// if no background style is available, set at page directly. This
// is an error and should NOT happen (and will be asserted from the SdrPage)
GetPage()->getSdrPageProperties().PutItemSet(aSet);
-#else
- // if no background style is available, try the background object
- SdrObject* pObj = GetPage()->GetPresObj(PRESOBJ_BACKGROUND);
- if( pObj == NULL )
- return;
-
- pObj->SetMergedItemSet(aSet);
-
- // repaint only
- SvxFmDrawPage::mpPage->ActionChanged();
-#endif
}
}
catch( Exception& )
@@ -3061,7 +2976,6 @@ void SdMasterPage::getBackground( Any& rValue ) throw()
}
}
-#ifdef NEWPBG
// No style found, use fill attributes from page background. This
// should NOT happen and is an error
const SfxItemSet& rFallbackItemSet(SvxFmDrawPage::mpPage->getSdrPageProperties().GetItemSet());
@@ -3075,24 +2989,6 @@ void SdMasterPage::getBackground( Any& rValue ) throw()
{
rValue.clear();
}
-#else
- // no stylesheet? try old fashion background rectangle
- SdrObject* pObj = NULL;
- if( SvxFmDrawPage::mpPage->GetObjCount() >= 1 )
- {
- pObj = SvxFmDrawPage::mpPage->GetObj(0);
- if( pObj->GetObjInventor() != SdrInventor || pObj->GetObjIdentifier() != OBJ_RECT )
- pObj = NULL;
- }
-
- if( pObj )
- {
- rValue <<= Reference< beans::XPropertySet >( new SdUnoPageBackground( GetModel()->GetDoc(), pObj ) );
- return;
- }
-
- rValue.clear();
-#endif
}
}
catch( Exception& )
diff --git a/sd/source/ui/unoidl/unopage.hxx b/sd/source/ui/unoidl/unopage.hxx
index 5d4c76bd9e82..3277b15938bb 100644
--- a/sd/source/ui/unoidl/unopage.hxx
+++ b/sd/source/ui/unoidl/unopage.hxx
@@ -97,7 +97,6 @@ protected:
void SetWidth( sal_Int32 nWidth );
void SetHeight( sal_Int32 nHeight );
- sal_Bool mbHasBackgroundObject;
bool mbIsImpressDocument;
virtual void disposing() throw();
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx
index 305b0438f447..78a4acf31ea6 100644
--- a/sd/source/ui/unoidl/unopback.cxx
+++ b/sd/source/ui/unoidl/unopback.cxx
@@ -67,28 +67,9 @@ const SvxItemPropertySet* ImplGetPageBackgroundPropertySet()
UNO3_GETIMPLEMENTATION_IMPL( SdUnoPageBackground );
-#ifndef NEWPBG
-SdUnoPageBackground::SdUnoPageBackground( SdDrawDocument* pDoc /* = NULL */, SdrObject* pObj /* = NULL */ ) throw()
-: mpPropSet( ImplGetPageBackgroundPropertySet() ), mpSet( NULL ), mpDoc( pDoc )
-{
- if( pDoc )
- {
- StartListening( *pDoc );
- mpSet = new SfxItemSet( pDoc->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
-
- if( pObj )
- mpSet->Put(pObj->GetMergedItemSet());
- }
-}
-#endif
-
-#ifdef NEWPBG
SdUnoPageBackground::SdUnoPageBackground(
SdDrawDocument* pDoc /* = NULL */,
const SfxItemSet* pSet /* = NULL */) throw()
-#else
-SdUnoPageBackground::SdUnoPageBackground( SdDrawDocument* pDoc, const SfxItemSet* pSet ) throw()
-#endif
: mpPropSet(ImplGetPageBackgroundPropertySet()),
mpSet(NULL),
mpDoc(pDoc)
diff --git a/sd/source/ui/unoidl/unopback.hxx b/sd/source/ui/unoidl/unopback.hxx
index b82993a50ffe..03121b0d837a 100644
--- a/sd/source/ui/unoidl/unopback.hxx
+++ b/sd/source/ui/unoidl/unopback.hxx
@@ -42,13 +42,7 @@
#include <cppuhelper/implbase4.hxx>
-#define NEWPBG
-
const SvxItemPropertySet* ImplGetPageBackgroundPropertySet();
-
-#ifndef NEWPBG
-class SdrObject;
-#endif
class SdDrawDocument;
class SfxItemSet;
@@ -66,12 +60,7 @@ protected:
const SfxItemPropertySimpleEntry* getPropertyMapEntry( const ::rtl::OUString& rPropertyName ) const throw();
public:
-#ifdef NEWPBG
SdUnoPageBackground( SdDrawDocument* pDoc = NULL, const SfxItemSet* pSet = NULL) throw();
-#else
- SdUnoPageBackground( SdDrawDocument* pDoc = NULL, SdrObject* pObj = NULL ) throw();
- SdUnoPageBackground( SdDrawDocument* pDoc, const SfxItemSet* pSet ) throw();
-#endif
~SdUnoPageBackground() throw();
// internal
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 676437ed14fe..948b751720fb 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -305,14 +305,8 @@ BOOL DrawView::SetAttributes(const SfxItemSet& rSet,
PresObjKind ePresObjKind = rPage.GetPresObjKind(pObject);
String aTemplateName(aLayoutName);
-#ifdef NEWPBG
if (ePresObjKind == PRESOBJ_TITLE ||
ePresObjKind == PRESOBJ_NOTES)
-#else
- if (ePresObjKind == PRESOBJ_TITLE ||
- ePresObjKind == PRESOBJ_NOTES ||
- ePresObjKind == PRESOBJ_BACKGROUND)
-#endif
{
// Presentation object (except outline)
SfxStyleSheet* pSheet = rPage.GetStyleSheetForPresObj( ePresObjKind );
@@ -585,19 +579,6 @@ void DrawView::HideSdrPage()
::sd::View::HideSdrPage();
}
-#ifndef NEWPBG
-SdrObject* DrawView::GetMaxToBtmObj(SdrObject* pObj) const
-{
- if( pObj )
- {
- SdPage* pPage = (SdPage*)pObj->GetPage();
- if( pPage && pPage->IsMasterPage() )
- return pPage->GetPresObj( PRESOBJ_BACKGROUND ) ;
- }
- return NULL;
-}
-#endif
-
void DrawView::DeleteMarked()
{
sd::UndoManager* pUndoManager = mpDoc->GetUndoManager();
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 4806e33be464..6021f4fcd907 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -264,13 +264,7 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP
if( !bSubContentProcessing || !pObject->IsNotVisibleAsMaster() )
{
eKind = pObjectsSdPage ? pObjectsSdPage->GetPresObjKind(pObject) : PRESOBJ_NONE;
-
-#ifndef NEWPBG
- if( eKind != PRESOBJ_BACKGROUND )
-#endif
- {
- bCreateOutline = true;
- }
+ bCreateOutline = true;
}
}
else if( ( pObject->GetObjInventor() == SdrInventor ) && ( pObject->GetObjIdentifier() == OBJ_TEXT ) )