From 778e9a65bf5af07c4caeff969a0324e43a78e66b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 19 Feb 2016 10:52:20 +0200 Subject: new loplugin: find write-only fields Change-Id: I0f83939babacf92485420ee63f290a297d7cb717 Reviewed-on: https://gerrit.libreoffice.org/22498 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- xmlscript/source/xml_helper/xml_impctx.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx index 694b8ed83dd7..c24312532ade 100644 --- a/xmlscript/source/xml_helper/xml_impctx.cxx +++ b/xmlscript/source/xml_helper/xml_impctx.cxx @@ -327,7 +327,6 @@ class ExtendedAttributes : { sal_Int32 m_nAttributes; sal_Int32 * m_pUids; - OUString * m_pPrefixes; OUString * m_pLocalNames; OUString * m_pQNames; OUString * m_pValues; @@ -337,7 +336,7 @@ class ExtendedAttributes : public: inline ExtendedAttributes( sal_Int32 nAttributes, - sal_Int32 * pUids, OUString * pPrefixes, + sal_Int32 * pUids, OUString * pLocalNames, OUString * pQNames, Reference< xml::sax::XAttributeList > const & xAttributeList, DocumentHandlerImpl * pHandler ); @@ -374,13 +373,12 @@ public: inline ExtendedAttributes::ExtendedAttributes( sal_Int32 nAttributes, - sal_Int32 * pUids, OUString * pPrefixes, + sal_Int32 * pUids, OUString * pLocalNames, OUString * pQNames, Reference< xml::sax::XAttributeList > const & xAttributeList, DocumentHandlerImpl * pHandler ) : m_nAttributes( nAttributes ) , m_pUids( pUids ) - , m_pPrefixes( pPrefixes ) , m_pLocalNames( pLocalNames ) , m_pQNames( pQNames ) , m_pValues( new OUString[ nAttributes ] ) @@ -399,7 +397,6 @@ ExtendedAttributes::~ExtendedAttributes() throw () m_pHandler->release(); delete [] m_pUids; - delete [] m_pPrefixes; delete [] m_pLocalNames; delete [] m_pQNames; delete [] m_pValues; @@ -577,10 +574,11 @@ void DocumentHandlerImpl::startElement( pUids[ nPos ] = getUidByPrefix( pPrefixes[ nPos ] ); } } + delete[] pPrefixes; // ownership of arrays belongs to attribute list xAttributes = static_cast< xml::input::XAttributes * >( new ExtendedAttributes( - nAttribs, pUids, pPrefixes, pLocalNames, pQNames, + nAttribs, pUids, pLocalNames, pQNames, xAttribs, this ) ); getElementName( rQElementName, &nUid, &aLocalName ); -- cgit