summaryrefslogtreecommitdiff
path: root/xmloff/source/text/XMLTextShapeStyleContext.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-09-21 12:12:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-09-22 11:01:53 +0200
commit442df6cf8345f8029d5a3b470bc4981a5aa2bf20 (patch)
tree9efa6f2b29f41d79f968d1e8ad2588c323305776 /xmloff/source/text/XMLTextShapeStyleContext.cxx
parenta411d7729ab2bed05c3c5d22a8cbcf5dde034b91 (diff)
ofz: don't leak in face of exceptions
Change-Id: Ic15590a13bd3770ee5dd7db76b21c830a4fe73e2 Reviewed-on: https://gerrit.libreoffice.org/42587 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff/source/text/XMLTextShapeStyleContext.cxx')
-rw-r--r--xmloff/source/text/XMLTextShapeStyleContext.cxx32
1 files changed, 16 insertions, 16 deletions
diff --git a/xmloff/source/text/XMLTextShapeStyleContext.cxx b/xmloff/source/text/XMLTextShapeStyleContext.cxx
index 10c3add0ad9e..cd4392b4ad57 100644
--- a/xmloff/source/text/XMLTextShapeStyleContext.cxx
+++ b/xmloff/source/text/XMLTextShapeStyleContext.cxx
@@ -51,7 +51,7 @@ public:
const rtl::Reference < SvXMLImportPropertyMapper > &rMap );
using SvXMLPropertySetContext::CreateChildContext;
- virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix,
const OUString& rLocalName,
const Reference< XAttributeList >& xAttrList,
::std::vector< XMLPropertyState > &rProperties,
@@ -70,20 +70,20 @@ XMLTextShapePropertySetContext_Impl::XMLTextShapePropertySetContext_Impl(
{
}
-SvXMLImportContext *XMLTextShapePropertySetContext_Impl::CreateChildContext(
+SvXMLImportContextRef XMLTextShapePropertySetContext_Impl::CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
const Reference< XAttributeList > & xAttrList,
::std::vector< XMLPropertyState > &rProperties,
const XMLPropertyState& rProp )
{
- SvXMLImportContext *pContext = nullptr;
+ SvXMLImportContextRef xContext;
switch( mxMapper->getPropertySetMapper()
->GetEntryContextId( rProp.mnIndex ) )
{
case CTF_TEXTCOLUMNS:
- pContext = new XMLTextColumnsContext( GetImport(), nPrefix,
+ xContext = new XMLTextColumnsContext( GetImport(), nPrefix,
rLocalName, xAttrList, rProp,
rProperties );
break;
@@ -98,7 +98,7 @@ SvXMLImportContext *XMLTextShapePropertySetContext_Impl::CreateChildContext(
CTF_BACKGROUND_FILTER == mxMapper->getPropertySetMapper()
->GetEntryContextId( rProp.mnIndex-1 ),
"invalid property map!");
- pContext =
+ xContext =
new XMLBackgroundImageContext( GetImport(), nPrefix,
rLocalName, xAttrList,
rProp,
@@ -110,11 +110,11 @@ SvXMLImportContext *XMLTextShapePropertySetContext_Impl::CreateChildContext(
break;
}
- if( !pContext )
- pContext = XMLShapePropertySetContext::CreateChildContext(
+ if (!xContext)
+ xContext = XMLShapePropertySetContext::CreateChildContext(
nPrefix, rLocalName, xAttrList, rProperties, rProp );
- return pContext;
+ return xContext;
}
void XMLTextShapeStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
@@ -149,12 +149,12 @@ XMLTextShapeStyleContext::~XMLTextShapeStyleContext()
{
}
-SvXMLImportContext *XMLTextShapeStyleContext::CreateChildContext(
+SvXMLImportContextRef XMLTextShapeStyleContext::CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
const Reference< XAttributeList > & xAttrList )
{
- SvXMLImportContext *pContext = nullptr;
+ SvXMLImportContextRef xContext;
if( XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix )
{
@@ -171,7 +171,7 @@ SvXMLImportContext *XMLTextShapeStyleContext::CreateChildContext(
GetStyles()->GetImportPropertyMapper( GetFamily() );
if( xImpPrMap.is() )
{
- pContext = new XMLTextShapePropertySetContext_Impl(
+ xContext = new XMLTextShapePropertySetContext_Impl(
GetImport(), nPrefix, rLocalName, xAttrList, nFamily,
GetProperties(), xImpPrMap );
}
@@ -182,16 +182,16 @@ SvXMLImportContext *XMLTextShapeStyleContext::CreateChildContext(
{
// create and remember events import context
// (for delayed processing of events)
- pContext = new XMLEventsImportContext( GetImport(), nPrefix,
+ xContext = new XMLEventsImportContext( GetImport(), nPrefix,
rLocalName);
- xEventContext = pContext;
+ xEventContext = xContext;
}
- if( !pContext )
- pContext = XMLShapeStyleContext::CreateChildContext( nPrefix, rLocalName,
+ if (!xContext)
+ xContext = XMLShapeStyleContext::CreateChildContext( nPrefix, rLocalName,
xAttrList );
- return pContext;
+ return xContext;
}
void XMLTextShapeStyleContext::CreateAndInsert( bool bOverwrite )