diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-05-13 21:05:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-05-20 15:23:07 +0100 |
commit | aed7428945c044aacaff3e80c09bf5fb07715cf1 (patch) | |
tree | e9be5edad22a40e9fbb1799575a6230afdc318a0 /sfx2 | |
parent | b46dc3d47c23e8272d394007c66699138b2c3249 (diff) |
remove leak and refactor to make less ugly
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/fcontnr.hxx | 13 | ||||
-rw-r--r-- | sfx2/source/doc/docfac.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 2 |
3 files changed, 10 insertions, 7 deletions
diff --git a/sfx2/inc/sfx2/fcontnr.hxx b/sfx2/inc/sfx2/fcontnr.hxx index 246bfe4a6b..b1dcca5f0f 100644 --- a/sfx2/inc/sfx2/fcontnr.hxx +++ b/sfx2/inc/sfx2/fcontnr.hxx @@ -40,6 +40,8 @@ #include <sfx2/docfilt.hxx> #include <sfx2/sfxdefs.hxx> +#include <boost/utility.hpp> + class Window; class SfxFilter; class SfxFilterArr_Impl; @@ -124,10 +126,10 @@ public: class SfxFilterMatcher_Impl; -class SFX2_DLLPUBLIC SfxFilterMatcher +class SFX2_DLLPUBLIC SfxFilterMatcher : private boost::noncopyable { friend class SfxFilterMatcherIter; - SfxFilterMatcher_Impl *pImpl; + SfxFilterMatcher_Impl &m_rImpl; public: SfxFilterMatcher( const String& rFact ); SfxFilterMatcher(); @@ -152,17 +154,18 @@ public: }; class SfxFilterContainer_Impl; -class SFX2_DLLPUBLIC SfxFilterMatcherIter +class SFX2_DLLPUBLIC SfxFilterMatcherIter : private boost::noncopyable + { SfxFilterFlags nOrMask; SfxFilterFlags nAndMask; sal_uInt16 nCurrent; - const SfxFilterMatcher_Impl *pMatch; + const SfxFilterMatcher_Impl &m_rMatch; SAL_DLLPRIVATE const SfxFilter* Find_Impl(); public: - SfxFilterMatcherIter( const SfxFilterMatcher* pMatchP, SfxFilterFlags nMask = 0, SfxFilterFlags nNotMask = SFX_FILTER_NOTINSTALLED ); + SfxFilterMatcherIter( const SfxFilterMatcher& rMatcher, SfxFilterFlags nMask = 0, SfxFilterFlags nNotMask = SFX_FILTER_NOTINSTALLED ); const SfxFilter* First(); const SfxFilter* Next(); }; diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 70b18aa44e..7963f0c39d 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -351,7 +351,7 @@ const SfxFilter* SfxObjectFactory::GetTemplateFilter() const { sal_uInt16 nVersion=0; SfxFilterMatcher aMatcher ( String::CreateFromAscii( pShortName ) ); - SfxFilterMatcherIter aIter( &aMatcher ); + SfxFilterMatcherIter aIter( aMatcher ); const SfxFilter *pFilter = 0; const SfxFilter *pTemp = aIter.First(); while ( pTemp ) diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 0e15aeb0d6..c49b980423 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -285,7 +285,7 @@ void SfxObjectShell::SetTemplate(sal_Bool bIs) { pImp->bIsTemplate=bIs; SfxFilterMatcher aMatcher( GetFactory().GetFactoryName() ); - SfxFilterMatcherIter aIter( &aMatcher, SFX_FILTER_TEMPLATEPATH ); + SfxFilterMatcherIter aIter( aMatcher, SFX_FILTER_TEMPLATEPATH ); SfxMedium* pMed = GetMedium(); if( pMed ) pMed->SetFilter( aIter.First() ); } |