From 187e2dbd6ece29c27c851a71bb02b2b52bb8d13f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 13 Sep 2016 10:00:52 +0100 Subject: coverity#1372877 I'm guessing this is what might have been the intent warning is 'Constant' variable guards dead code Change-Id: I06e65f576180d7ff62417828c26f969982788b55 --- xmloff/source/core/xmlimp.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 9ac8b593a675..87adeecd75eb 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -659,9 +659,9 @@ void SAL_CALL SvXMLImport::endDocument() } } -void SvXMLImport::processNSAttributes( const uno::Reference< xml::sax::XAttributeList >& xAttrList, - SvXMLNamespaceMap *pRewindMap ) +SvXMLNamespaceMap* SvXMLImport::processNSAttributes(const uno::Reference< xml::sax::XAttributeList >& xAttrList) { + SvXMLNamespaceMap *pRewindMap = nullptr; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { @@ -709,17 +709,17 @@ void SvXMLImport::processNSAttributes( const uno::Reference< xml::sax::XAttribut } } + return pRewindMap; } void SAL_CALL SvXMLImport::startElement( const OUString& rName, const uno::Reference< xml::sax::XAttributeList >& xAttrList ) throw(xml::sax::SAXException, uno::RuntimeException, std::exception) { - SvXMLNamespaceMap *pRewindMap = nullptr; // SAL_INFO("svg", "startElement " << rName); // Process namespace attributes. This must happen before creating the // context, because namespace decaration apply to the element name itself. - processNSAttributes( xAttrList, pRewindMap ); + SvXMLNamespaceMap *pRewindMap = processNSAttributes(xAttrList); // Get element's namespace and local name. OUString aLocalName; @@ -873,8 +873,7 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element, { rtl::Reference < comphelper::AttributeList > rAttrList = new comphelper::AttributeList; maNamespaceHandler->addNSDeclAttributes( rAttrList ); - SvXMLNamespaceMap *pRewindMap = nullptr; - processNSAttributes( rAttrList.get(), pRewindMap ); + SvXMLNamespaceMap *pRewindMap = processNSAttributes(rAttrList.get()); SvXMLImportContext *pContext = dynamic_cast( xContext.get() ); if( pContext && pRewindMap ) pContext->PutRewindMap( pRewindMap ); -- cgit