remove manual memory management

Change-Id: Ic715adae42ff34be892d19802629aa50077dc120
This commit is contained in:
David Tardon
2016-09-08 15:40:23 +02:00
parent 7dd877b4be
commit 084de9dda4
2 changed files with 7 additions and 14 deletions

View File

@@ -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,

View File

@@ -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#)