summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-08 10:44:26 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 07:30:30 +0200
commit6c285099289b2d73c9e7da503341e22728be1787 (patch)
tree6b6faf8f94e5e1de7999aec841e9124c7d50e1ba /sw/source/filter
parente501c39a48ab3f73f1994ab03a7f194774ed7ff4 (diff)
remove direct memory management
Change-Id: I9696b1c0ffe100c8089494197940377d3c6223f5
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/xml/xmltbli.cxx19
-rw-r--r--sw/source/filter/xml/xmltbli.hxx2
2 files changed, 7 insertions, 14 deletions
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 06878d7d79c6..ea99b369ac24 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1286,7 +1286,6 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport,
m_pBoxFormat( nullptr ),
m_pLineFormat( nullptr ),
m_pSharedBoxFormats(nullptr),
- m_pDDESource(nullptr),
m_bFirstSection( true ),
m_bRelWidth( true ),
m_bHasSubTables( false ),
@@ -1429,7 +1428,6 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport,
m_pLineFormat( nullptr ),
m_pSharedBoxFormats(nullptr),
m_xParentTable( pTable ),
- m_pDDESource(nullptr),
m_bFirstSection( false ),
m_bRelWidth( true ),
m_bHasSubTables( false ),
@@ -1491,14 +1489,9 @@ SvXMLImportContext *SwXMLTableContext::CreateChildContext( sal_uInt16 nPrefix,
// save context for later processing (discard old context, if approp.)
if( IsValid() )
{
- if (m_pDDESource != nullptr)
- {
- m_pDDESource->ReleaseRef();
- }
- m_pDDESource = new SwXMLDDETableContext_Impl( GetSwImport(), nPrefix,
- rLocalName );
- m_pDDESource->AddFirstRef();
- pContext = m_pDDESource;
+ m_xDDESource.set(new SwXMLDDETableContext_Impl( GetSwImport(), nPrefix,
+ rLocalName ));
+ pContext = m_xDDESource.get();
}
break;
}
@@ -2789,15 +2782,15 @@ void SwXMLTableContext::MakeTable()
rRow->Dispose();
// now that table is complete, change into DDE table (if appropriate)
- if (nullptr != m_pDDESource)
+ if (m_xDDESource.is())
{
// change existing table into DDE table:
// 1) Get DDE field type (get data from dde-source context),
- SwDDEFieldType* pFieldType = lcl_GetDDEFieldType( m_pDDESource,
+ SwDDEFieldType* pFieldType = lcl_GetDDEFieldType( m_xDDESource.get(),
m_pTableNode );
// 2) release the DDE source context,
- m_pDDESource->ReleaseRef();
+ m_xDDESource.set(nullptr);
// 3) create new DDE table, and
SwDDETable* pDDETable = new SwDDETable( m_pTableNode->GetTable(),
diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx
index f12039777ef7..11fd9c222669 100644
--- a/sw/source/filter/xml/xmltbli.hxx
+++ b/sw/source/filter/xml/xmltbli.hxx
@@ -80,7 +80,7 @@ class SwXMLTableContext : public XMLTextTableContext
SvXMLImportContextRef m_xParentTable; // if table is a sub table
- SwXMLDDETableContext_Impl *m_pDDESource;
+ uno::Reference<SwXMLDDETableContext_Impl> m_xDDESource;
bool m_bFirstSection : 1;
bool m_bRelWidth : 1;