diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-12-22 14:26:05 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-12-24 00:03:04 +0100 |
commit | 9d0d97b4eb45ec58b171786e6d5c8b28dcd16d5d (patch) | |
tree | 641441f3feb77e0bedabe1bdcd34dc35a697771c /sw | |
parent | 21a7d4043dc79823168c042cee3a9bfa006004f7 (diff) |
use a proper smart pointer here
Change-Id: Ic413e08bbaf38a6858926b1309618762a9ed1444
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index e9d299a3f85c..8a07481ff20f 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -260,7 +260,7 @@ class SwXStyle : public cppu::WeakImplHelper bool m_bIsDescriptor : 1; bool m_bIsConditional : 1; OUString m_sParentStyleName; - SwStyleProperties_Impl* m_pPropertiesImpl; + std::unique_ptr<SwStyleProperties_Impl> m_pPropertiesImpl; void ApplyDescriptorProperties(); protected: @@ -270,7 +270,7 @@ protected: SfxStyleSheetBasePool* GetBasePool() {return m_pBasePool;} void SetStyleName(const OUString& rSet){ m_sStyleName = rSet;} - SwStyleProperties_Impl* GetPropImpl(){return m_pPropertiesImpl;} + SwStyleProperties_Impl& GetPropImpl(){return *m_pPropertiesImpl;} css::uno::Reference< css::beans::XPropertySet > mxStyleData; css::uno::Reference< css::container::XNameAccess > mxStyleFamily; @@ -1156,7 +1156,7 @@ SwXStyle::SwXStyle( SwDoc *pDoc, SfxStyleFamily eFam, bool bConditional) : default: ; } - m_pPropertiesImpl = new SwStyleProperties_Impl(aSwMapProvider.GetPropertySet(nMapId)->getPropertyMap()); + m_pPropertiesImpl = std::unique_ptr<SwStyleProperties_Impl>(new SwStyleProperties_Impl(aSwMapProvider.GetPropertySet(nMapId)->getPropertyMap())); } SwXStyle::SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam, @@ -1192,7 +1192,7 @@ SwXStyle::~SwXStyle() SolarMutexGuard aGuard; if(m_pBasePool) EndListening(*m_pBasePool); - delete m_pPropertiesImpl; + m_pPropertiesImpl.reset(); if(GetRegisteredIn()) GetRegisteredIn()->Remove( this ); } @@ -3463,7 +3463,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( } else if(IsDescriptor()) { - if(!GetPropImpl()->SetProperty(rPropName, pValues[nProp])) + if(!GetPropImpl().SetProperty(rPropName, pValues[nProp])) throw lang::IllegalArgumentException(); } else @@ -3764,7 +3764,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( else if(IsDescriptor()) { const uno::Any* pAny = nullptr; - GetPropImpl()->GetProperty(rPropName, pAny); + GetPropImpl().GetProperty(rPropName, pAny); if (!pAny->hasValue()) { SwStyleProperties_Impl::GetProperty(rPropName, mxStyleData, pRet[nProp]); |