summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-08 15:40:23 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 07:30:30 +0200
commit084de9dda40095937dfb990fc39edea31626dba3 (patch)
treee5614bbfd64b8cee09af41a00a97b475c8d1d985
parent7dd877b4be3ca9cad441b88e4510d5917d25b5b6 (diff)
remove manual memory management
Change-Id: Ic715adae42ff34be892d19802629aa50077dc120
-rw-r--r--include/xmloff/txtstyli.hxx3
-rw-r--r--xmloff/source/text/txtstyli.cxx18
2 files changed, 7 insertions, 14 deletions
diff --git a/include/xmloff/txtstyli.hxx b/include/xmloff/txtstyli.hxx
index bfcd7fc03f51..3b7cb23ba4c0 100644
--- a/include/xmloff/txtstyli.hxx
+++ b/include/xmloff/txtstyli.hxx
@@ -53,7 +53,7 @@ private:
// Introduce import of empty list style (#i69523#)
bool mbListStyleSet : 1;
- XMLEventsImportContext* pEventContext;
+ css::uno::Reference<XMLEventsImportContext> mxEventContext;
protected:
@@ -69,7 +69,6 @@ public:
const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList,
SvXMLStylesContext& rStyles, sal_uInt16 nFamily,
bool bDefaultStyle = false );
- virtual ~XMLTextStyleContext();
virtual SvXMLImportContext *CreateChildContext(
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index 5564408560ce..f6036990b8af 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -146,11 +146,6 @@ XMLTextStyleContext::XMLTextStyleContext( SvXMLImport& rImport,
, bHasCombinedCharactersLetter( false )
// Inherited paragraph style lost information about unset numbering (#i69523#)
, mbListStyleSet( false )
-, pEventContext( nullptr )
-{
-}
-
-XMLTextStyleContext::~XMLTextStyleContext()
{
}
@@ -192,10 +187,9 @@ SvXMLImportContext *XMLTextStyleContext::CreateChildContext(
{
// create and remember events import context
// (for delayed processing of events)
- pEventContext = new XMLEventsImportContext( GetImport(), nPrefix,
- rLocalName);
- pEventContext->AddFirstRef();
- pContext = pEventContext;
+ mxEventContext.set(new XMLEventsImportContext( GetImport(), nPrefix,
+ rLocalName));
+ pContext = mxEventContext.get();
}
if( !pContext )
@@ -230,12 +224,12 @@ void XMLTextStyleContext::CreateAndInsert( bool bOverwrite )
}
// tell the style about it's events (if applicable)
- if (nullptr != pEventContext)
+ if (mxEventContext.is())
{
// set event suppplier and release reference to context
Reference<document::XEventsSupplier> xEventsSupplier(xStyle,UNO_QUERY);
- pEventContext->SetEvents(xEventsSupplier);
- pEventContext->ReleaseRef();
+ mxEventContext->SetEvents(xEventsSupplier);
+ mxEventContext.clear();
}
// XML import: reconstrution of assignment of paragraph style to outline levels (#i69629#)