diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-23 13:58:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-23 14:54:51 +0100 |
commit | 15037b018f81d6e5d5bb21921845a11922c301ca (patch) | |
tree | 93ab01628d39875b82d7650706c80e1258812ee8 /xmloff | |
parent | 2bb0bd5a4a80ae5eaf2d9025ba1a300ba720d3b3 (diff) |
coverity#705781 Resource leak
Change-Id: Ia802df9c36b59a0130931436be7f5dbea07c0c8c
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/PageMasterImportContext.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/xmloff/source/style/PageMasterImportContext.cxx b/xmloff/source/style/PageMasterImportContext.cxx index 283075cdebcd..42c40e741d84 100644 --- a/xmloff/source/style/PageMasterImportContext.cxx +++ b/xmloff/source/style/PageMasterImportContext.cxx @@ -78,8 +78,6 @@ SvXMLImportContext *PageStyleContext::CreateChildContext( const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = NULL; - if( XML_NAMESPACE_STYLE == nPrefix && ((IsXMLToken(rLocalName, XML_HEADER_STYLE )) || (IsXMLToken(rLocalName, XML_FOOTER_STYLE )) ) ) @@ -119,10 +117,11 @@ SvXMLImportContext *PageStyleContext::CreateChildContext( } if (!bEnd) nEndIndex = nIndex; - pContext = new PageHeaderFooterContext(GetImport(), nPrefix, rLocalName, + return new PageHeaderFooterContext(GetImport(), nPrefix, rLocalName, xAttrList, GetProperties(), xImpPrMap, nStartIndex, nEndIndex, bHeader); } } + if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken(rLocalName, XML_PAGE_LAYOUT_PROPERTIES) ) { @@ -148,7 +147,7 @@ SvXMLImportContext *PageStyleContext::CreateChildContext( if (!bEnd) nEndIndex = nIndex; PageContextType aType = Page; - pContext = new PagePropertySetContext( GetImport(), nPrefix, + return new PagePropertySetContext( GetImport(), nPrefix, rLocalName, xAttrList, XML_TYPE_PROP_PAGE_LAYOUT, GetProperties(), @@ -156,10 +155,7 @@ SvXMLImportContext *PageStyleContext::CreateChildContext( } } - if (!pContext) - pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName, - xAttrList ); - return pContext; + return XMLPropStyleContext::CreateChildContext(nPrefix, rLocalName, xAttrList); } void PageStyleContext::FillPropertySet(const uno::Reference<beans::XPropertySet > & rPropSet) |