summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/style.hxx5
-rw-r--r--svl/source/items/style.cxx20
2 files changed, 11 insertions, 14 deletions
diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx
index 664ca5cb1ec2..af58cbc44327 100644
--- a/svl/inc/svl/style.hxx
+++ b/svl/inc/svl/style.hxx
@@ -37,10 +37,10 @@
#include <svl/stylesheetuser.hxx>
#include <svl/style.hrc>
+#include <boost/shared_ptr.hpp>
class SfxItemSet;
class SfxItemPool;
-
class SfxStyleSheetBasePool;
class SvStream;
@@ -192,6 +192,7 @@ private:
friend class SfxStyleSheetBasePool;
};
+typedef ::boost::shared_ptr< SfxStyleSheetIterator > SfxStyleSheetIteratorPtr;
//=========================================================================
class SfxStyleSheetBasePool_Impl;
@@ -228,7 +229,7 @@ public:
SfxItemPool& GetPool();
const SfxItemPool& GetPool() const;
- virtual SfxStyleSheetIterator* CreateIterator(SfxStyleFamily, sal_uInt16 nMask);
+ virtual SfxStyleSheetIteratorPtr CreateIterator(SfxStyleFamily, sal_uInt16 nMask);
virtual sal_uInt16 Count();
virtual SfxStyleSheetBase* operator[](sal_uInt16 nIdx);
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index cd44bea2bbb7..c2879e799f1a 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -83,10 +83,8 @@ SfxStyleSheetHint::SfxStyleSheetHint
class SfxStyleSheetBasePool_Impl
{
- public:
- SfxStyleSheetIterator *pIter;
- SfxStyleSheetBasePool_Impl() : pIter(0){}
- ~SfxStyleSheetBasePool_Impl(){delete pIter;}
+public:
+ SfxStyleSheetIteratorPtr pIter;
};
@@ -532,13 +530,12 @@ void SfxStyleSheetBasePool::Replace(
SfxStyleSheetIterator& SfxStyleSheetBasePool::GetIterator_Impl()
{
- SfxStyleSheetIterator*& rpIter = pImp->pIter;
- if( !rpIter || (rpIter->GetSearchMask() != nMask) || (rpIter->GetSearchFamily() != nSearchFamily) )
+ if( !pImp->pIter || (pImp->pIter->GetSearchMask() != nMask) || (pImp->pIter->GetSearchFamily() != nSearchFamily) )
{
- delete rpIter;
- rpIter = CreateIterator( nSearchFamily, nMask );
+ pImp->pIter = CreateIterator( nSearchFamily, nMask );
}
- return *rpIter;
+
+ return *pImp->pIter;
}
SfxStyleSheetBasePool::SfxStyleSheetBasePool( SfxItemPool& r )
@@ -603,14 +600,13 @@ sal_uInt16 SfxStyleSheetBasePool::GetSearchMask() const
return nMask;
}
-
-SfxStyleSheetIterator* SfxStyleSheetBasePool::CreateIterator
+SfxStyleSheetIteratorPtr SfxStyleSheetBasePool::CreateIterator
(
SfxStyleFamily eFam,
sal_uInt16 mask
)
{
- return new SfxStyleSheetIterator(this,eFam,mask);
+ return SfxStyleSheetIteratorPtr(new SfxStyleSheetIterator(this,eFam,mask));
}
SfxStyleSheetBase* SfxStyleSheetBasePool::Create