summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starmath/source/document.cxx2
-rw-r--r--sw/inc/doc.hxx6
-rw-r--r--sw/inc/swatrset.hxx3
-rw-r--r--sw/source/core/attr/swatrset.cxx3
-rw-r--r--sw/source/core/doc/doc.cxx2
-rw-r--r--sw/source/core/doc/docdraw.cxx16
-rw-r--r--sw/source/core/doc/docnew.cxx15
-rw-r--r--sw/source/core/fields/docufld.cxx2
-rw-r--r--sw/source/core/unocore/SwXTextDefaults.cxx4
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx10
-rw-r--r--sw/source/ui/app/swmodule.cxx4
11 files changed, 39 insertions, 28 deletions
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index cc89640da0cb..546af49b2df1 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -729,7 +729,7 @@ SmDocShell::~SmDocShell()
EndListening(*pp->GetConfig());
delete pEditEngine;
- delete pEditEngineItemPool;
+ SfxItemPool::Free(pEditEngineItemPool);
delete pTree;
delete pPrinter;
}
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index da5c9c70d3f1..8fe60d0fb8c7 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -303,7 +303,7 @@ class SW_DLLPUBLIC SwDoc :
// die Objecte
SwNodes aNodes; // Inhalt des Dokumentes
SwNodes aUndoNodes; // Inhalt fuer das Undo
- SwAttrPool aAttrPool; // der Attribut Pool
+ SwAttrPool* mpAttrPool; // der Attribut Pool
SwPageDescs aPageDescs; // PageDescriptoren
Link aOle2Link; // OLE 2.0-Benachrichtigung
/* @@@MAINTAINABILITY-HORROR@@@
@@ -1782,8 +1782,8 @@ public:
const sal_uInt16 nId, const String& rCharacterStyle, SdrObject& rObj );
// erfrage den Attribut Pool
- const SwAttrPool& GetAttrPool() const { return aAttrPool; }
- SwAttrPool& GetAttrPool() { return aAttrPool; }
+ const SwAttrPool& GetAttrPool() const { return *mpAttrPool; }
+ SwAttrPool& GetAttrPool() { return *mpAttrPool; }
// suche ueber das Layout eine EditShell und ggfs. eine ViewShell
SwEditShell* GetEditShell( ViewShell** ppSh = 0 ) const;
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index a800d1b1b649..3042f1def0c9 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -162,6 +162,9 @@ class SwAttrPool : public SfxItemPool
public:
SwAttrPool( SwDoc* pDoc );
+protected:
+ virtual ~SwAttrPool();
+public:
SwDoc* GetDoc() { return pDoc; }
const SwDoc* GetDoc() const { return pDoc; }
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index b53466b5b22b..4f9d3c3b77cc 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -72,6 +72,9 @@ SwAttrPool::SwAttrPool( SwDoc* pD )
SetVersionMap( 6, 1,136, pVersionMap6 );
}
+SwAttrPool::~SwAttrPool()
+{
+}
SwAttrSet::SwAttrSet( SwAttrPool& rPool, USHORT nWh1, USHORT nWh2 )
: SfxItemSet( rPool, nWh1, nWh2 ), pOldSet( 0 ), pNewSet( 0 )
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index b02551b4eead..1bb32049c16a 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -576,7 +576,7 @@ void SwDoc::setJobsetup(/*[in]*/ const JobSetup &rJobSetup )
if( !pPrt )
{
//Das ItemSet wird vom Sfx geloescht!
- SfxItemSet *pSet = new SfxItemSet( aAttrPool,
+ SfxItemSet *pSet = new SfxItemSet( GetAttrPool(),
FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER,
SID_HTML_MODE, SID_HTML_MODE,
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 61d35ece9df6..dc4c33e1c787 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -606,7 +606,7 @@ void SwDoc::InitDrawModel()
//zerstoert.
// 17.2.99: for Bug 73110 - for loading the drawing items. This must
// be loaded without RefCounts!
- SfxItemPool *pSdrPool = new SdrItemPool( &aAttrPool );
+ SfxItemPool *pSdrPool = new SdrItemPool( &GetAttrPool() );
// #75371# change DefaultItems for the SdrEdgeObj distance items
// to TWIPS.
if(pSdrPool)
@@ -624,13 +624,13 @@ void SwDoc::InitDrawModel()
}
SfxItemPool *pEEgPool = EditEngine::CreatePool( FALSE );
pSdrPool->SetSecondaryPool( pEEgPool );
- if ( !aAttrPool.GetFrozenIdRanges () )
- aAttrPool.FreezeIdRanges();
+ if ( !GetAttrPool().GetFrozenIdRanges () )
+ GetAttrPool().FreezeIdRanges();
else
pSdrPool->FreezeIdRanges();
// SJ: #95129# set FontHeight pool defaults without changing static SdrEngineDefaults
- aAttrPool.SetPoolDefaultItem(SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ));
+ GetAttrPool().SetPoolDefaultItem(SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ));
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create DrawDocument" );
//Das SdrModel gehoert dem Dokument, wir haben immer zwei Layer und eine
@@ -833,17 +833,17 @@ void SwDoc::ReleaseDrawModel()
//!!Den code im sw3io fuer Einfuegen Dokument mitpflegen!!
delete pDrawModel; pDrawModel = 0;
- SfxItemPool *pSdrPool = aAttrPool.GetSecondaryPool();
+ SfxItemPool *pSdrPool = GetAttrPool().GetSecondaryPool();
ASSERT( pSdrPool, "missing Pool" );
SfxItemPool *pEEgPool = pSdrPool->GetSecondaryPool();
ASSERT( !pEEgPool->GetSecondaryPool(), "i don't accept additional pools");
pSdrPool->Delete(); //Erst die Items vernichten lassen,
//dann erst die Verkettung loesen
- aAttrPool.SetSecondaryPool( 0 ); //Der ist ein muss!
+ GetAttrPool().SetSecondaryPool( 0 ); //Der ist ein muss!
pSdrPool->SetSecondaryPool( 0 ); //Der ist sicherer
- delete pSdrPool;
- delete pEEgPool;
+ SfxItemPool::Free(pSdrPool);
+ SfxItemPool::Free(pEEgPool);
}
}
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index aef17d024767..f469a03b5c24 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -217,13 +217,13 @@ BOOL lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
SwDoc::SwDoc() :
aNodes( this ),
aUndoNodes( this ),
- aAttrPool( this ),
- pDfltFrmFmt( new SwFrmFmt( aAttrPool, sFrmFmtStr, 0 ) ),
- pEmptyPageFmt( new SwFrmFmt( aAttrPool, sEmptyPageStr, pDfltFrmFmt ) ),
- pColumnContFmt( new SwFrmFmt( aAttrPool, sColumnCntStr, pDfltFrmFmt ) ),
- pDfltCharFmt( new SwCharFmt( aAttrPool, sCharFmtStr, 0 ) ),
- pDfltTxtFmtColl( new SwTxtFmtColl( aAttrPool, sTxtCollStr ) ),
- pDfltGrfFmtColl( new SwGrfFmtColl( aAttrPool, sGrfCollStr ) ),
+ mpAttrPool(new SwAttrPool(this)),
+ pDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ),
+ pEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, pDfltFrmFmt ) ),
+ pColumnContFmt( new SwFrmFmt( GetAttrPool(), sColumnCntStr, pDfltFrmFmt ) ),
+ pDfltCharFmt( new SwCharFmt( GetAttrPool(), sCharFmtStr, 0 ) ),
+ pDfltTxtFmtColl( new SwTxtFmtColl( GetAttrPool(), sTxtCollStr ) ),
+ pDfltGrfFmtColl( new SwGrfFmtColl( GetAttrPool(), sGrfCollStr ) ),
pFrmFmtTbl( new SwFrmFmts() ),
pCharFmtTbl( new SwCharFmts() ),
pSpzFrmFmtTbl( new SwSpzFrmFmts() ),
@@ -712,6 +712,7 @@ SwDoc::~SwDoc()
delete pLayoutCache;
delete pVirDev;
+ SfxItemPool::Free(mpAttrPool);
}
//---------------------------------------------------
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index ff7e6e2eb84b..b031ab747ca1 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1831,7 +1831,7 @@ SwField* SwPostItField::Copy() const
SwPostItField* pRet = new SwPostItField( (SwPostItFieldType*)GetTyp(), sAuthor,
sTxt, aDateTime);
if (mpText)
- pRet->SetTextObject( mpText->Clone() );
+ pRet->SetTextObject( new OutlinerParaObject(*mpText) );
return pRet;
}
/*--------------------------------------------------------------------
diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx
index 3ab3c8258f9e..0a21ef39956d 100644
--- a/sw/source/core/unocore/SwXTextDefaults.cxx
+++ b/sw/source/core/unocore/SwXTextDefaults.cxx
@@ -234,7 +234,7 @@ void SAL_CALL SwXTextDefaults::setPropertyToDefault( const OUString& rPropertyNa
throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
if ( pMap->nFlags & PropertyAttribute::READONLY)
throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertyToDefault: property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
- SfxItemPool rSet (pDoc->GetAttrPool());
+ SfxItemPool& rSet (pDoc->GetAttrPool());
rSet.ResetPoolDefaultItem ( pMap->nWID );
}
@@ -248,7 +248,7 @@ Any SAL_CALL SwXTextDefaults::getPropertyDefault( const OUString& rPropertyName
if (!pMap)
throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
Any aRet;
- SfxItemPool rSet (pDoc->GetAttrPool());
+ SfxItemPool& rSet (pDoc->GetAttrPool());
const SfxPoolItem *pItem = rSet.GetPoolDefaultItem ( pMap->nWID );
pItem->QueryValue( aRet, pMap->nMemberId );
return aRet;
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index e00a57fe7adf..d19a0869b1b1 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -105,6 +105,7 @@
#include "writerwordglue.hxx"
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <svx/editobj.hxx>
#include <math.h>
@@ -951,8 +952,10 @@ OutlinerParaObject* SwWW8ImplReader::ImportAsOutliner(String &rString, WW8_CP nS
mpDrawEditEngine->QuickDelete(aFirstChar);
}
- pRet = new OutlinerParaObject(*mpDrawEditEngine->CreateTextObject());
+ EditTextObject* pTemporaryText = mpDrawEditEngine->CreateTextObject();
+ pRet = new OutlinerParaObject(*pTemporaryText);
pRet->SetOutlinerMode( OUTLINERMODE_TEXTOBJECT );
+ delete pTemporaryText;
mpDrawEditEngine->SetText( aEmptyStr );
mpDrawEditEngine->SetParaAttribs(0, mpDrawEditEngine->GetEmptyItemSet());
@@ -1164,10 +1167,11 @@ SwFrmFmt* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
}
bool bVertical = pTextObj->IsVerticalWriting() ? true : false;
- OutlinerParaObject* pOp = new OutlinerParaObject(
- *mpDrawEditEngine->CreateTextObject());
+ EditTextObject* pTemporaryText = mpDrawEditEngine->CreateTextObject();
+ OutlinerParaObject* pOp = new OutlinerParaObject(*pTemporaryText);
pOp->SetOutlinerMode( OUTLINERMODE_TEXTOBJECT );
pOp->SetVertical( bVertical );
+ delete pTemporaryText;
pTextObj->NbcSetOutlinerParaObject( pOp );
pTextObj->SetVerticalWriting(bVertical);
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index d5c76d2323d8..694c2514ef93 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -295,7 +295,7 @@ uno::Reference< linguistic2::XLanguageGuessing > SwModule::GetLanguageGuesser()
SwModule::~SwModule()
{
SetPool(0);
- delete pAttrPool;
+ SfxItemPool::Free(pAttrPool);
delete pErrorHdl;
EndListening( *SFX_APP() );
}
@@ -514,7 +514,7 @@ void SwModule::InitAttrPool()
void SwModule::RemoveAttrPool()
{
SetPool(0);
- DELETEZ(pAttrPool);
+ SfxItemPool::Free(pAttrPool);
}