Kaydet (Commit) 15037b01 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#705781 Resource leak

Change-Id: Ia802df9c36b59a0130931436be7f5dbea07c0c8c
üst 2bb0bd5a
...@@ -78,8 +78,6 @@ SvXMLImportContext *PageStyleContext::CreateChildContext( ...@@ -78,8 +78,6 @@ SvXMLImportContext *PageStyleContext::CreateChildContext(
const OUString& rLocalName, const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList > & xAttrList ) const uno::Reference< xml::sax::XAttributeList > & xAttrList )
{ {
SvXMLImportContext *pContext = NULL;
if( XML_NAMESPACE_STYLE == nPrefix && if( XML_NAMESPACE_STYLE == nPrefix &&
((IsXMLToken(rLocalName, XML_HEADER_STYLE )) || ((IsXMLToken(rLocalName, XML_HEADER_STYLE )) ||
(IsXMLToken(rLocalName, XML_FOOTER_STYLE )) ) ) (IsXMLToken(rLocalName, XML_FOOTER_STYLE )) ) )
...@@ -119,10 +117,11 @@ SvXMLImportContext *PageStyleContext::CreateChildContext( ...@@ -119,10 +117,11 @@ SvXMLImportContext *PageStyleContext::CreateChildContext(
} }
if (!bEnd) if (!bEnd)
nEndIndex = nIndex; nEndIndex = nIndex;
pContext = new PageHeaderFooterContext(GetImport(), nPrefix, rLocalName, return new PageHeaderFooterContext(GetImport(), nPrefix, rLocalName,
xAttrList, GetProperties(), xImpPrMap, nStartIndex, nEndIndex, bHeader); xAttrList, GetProperties(), xImpPrMap, nStartIndex, nEndIndex, bHeader);
} }
} }
if( XML_NAMESPACE_STYLE == nPrefix && if( XML_NAMESPACE_STYLE == nPrefix &&
IsXMLToken(rLocalName, XML_PAGE_LAYOUT_PROPERTIES) ) IsXMLToken(rLocalName, XML_PAGE_LAYOUT_PROPERTIES) )
{ {
...@@ -148,7 +147,7 @@ SvXMLImportContext *PageStyleContext::CreateChildContext( ...@@ -148,7 +147,7 @@ SvXMLImportContext *PageStyleContext::CreateChildContext(
if (!bEnd) if (!bEnd)
nEndIndex = nIndex; nEndIndex = nIndex;
PageContextType aType = Page; PageContextType aType = Page;
pContext = new PagePropertySetContext( GetImport(), nPrefix, return new PagePropertySetContext( GetImport(), nPrefix,
rLocalName, xAttrList, rLocalName, xAttrList,
XML_TYPE_PROP_PAGE_LAYOUT, XML_TYPE_PROP_PAGE_LAYOUT,
GetProperties(), GetProperties(),
...@@ -156,10 +155,7 @@ SvXMLImportContext *PageStyleContext::CreateChildContext( ...@@ -156,10 +155,7 @@ SvXMLImportContext *PageStyleContext::CreateChildContext(
} }
} }
if (!pContext) return XMLPropStyleContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName,
xAttrList );
return pContext;
} }
void PageStyleContext::FillPropertySet(const uno::Reference<beans::XPropertySet > & rPropSet) void PageStyleContext::FillPropertySet(const uno::Reference<beans::XPropertySet > & rPropSet)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment