[Libreoffice-commits] core.git: sfx2/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Oct 7 02:04:54 PDT 2013
sfx2/source/doc/sfxbasemodel.cxx | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
New commits:
commit 3b3b37669a6fcc3b6437677c9ae9bfd15cb65629
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Oct 7 10:49:03 2013 +0200
sfx2: use a smart pointer in IMPL_SfxBaseModel_DataContainer
Change-Id: Ia13c94e05d26d66ebee00ca89030b6947c5efc0c
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 6f8c81e..d777659 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -214,7 +214,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
Reference< rdf::XDocumentMetadataAccess> m_xDocumentMetadata ;
::rtl::Reference< ::sfx2::DocumentUndoManager > m_pDocumentUndoManager ;
Sequence< document::CmisProperty> m_cmisProperties ;
- SfxGrabBagItem* m_pGrabBagItem ;
+ boost::shared_ptr<SfxGrabBagItem> m_pGrabBagItem ;
IMPL_SfxBaseModel_DataContainer( ::osl::Mutex& rMutex, SfxObjectShell* pObjectShell )
: m_pObjectShell ( pObjectShell )
@@ -233,7 +233,6 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
, m_xDocumentMetadata () // lazy
, m_pDocumentUndoManager ()
, m_cmisProperties ()
- , m_pGrabBagItem ( NULL )
{
// increase global instance counter.
++g_nInstanceCounter;
@@ -243,7 +242,6 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
virtual ~IMPL_SfxBaseModel_DataContainer()
{
- delete m_pGrabBagItem;
}
// ::sfx2::IModifiableDocument
@@ -3489,7 +3487,7 @@ sal_Bool SfxBaseModel::hasValidSignatures() const
void SfxBaseModel::getGrabBagItem(com::sun::star::uno::Any& rVal) const
{
- if (m_pData->m_pGrabBagItem != NULL)
+ if (m_pData->m_pGrabBagItem.get())
m_pData->m_pGrabBagItem->QueryValue(rVal);
else {
uno::Sequence<beans::PropertyValue> aValue(0);
@@ -3499,8 +3497,8 @@ void SfxBaseModel::getGrabBagItem(com::sun::star::uno::Any& rVal) const
void SfxBaseModel::setGrabBagItem(const com::sun::star::uno::Any& rVal)
{
- if (m_pData->m_pGrabBagItem == NULL)
- m_pData->m_pGrabBagItem = new SfxGrabBagItem;
+ if (!m_pData->m_pGrabBagItem.get())
+ m_pData->m_pGrabBagItem.reset(new SfxGrabBagItem);
m_pData->m_pGrabBagItem->PutValue(rVal);
}
More information about the Libreoffice-commits
mailing list