Kaydet (Commit) 9ca80b55 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in ExtendedAttributes

Change-Id: I86af2614ac9e3282ecd2aba5d23f6a075712968f
Reviewed-on: https://gerrit.libreoffice.org/59351
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e159948c
...@@ -310,8 +310,9 @@ class ExtendedAttributes : ...@@ -310,8 +310,9 @@ class ExtendedAttributes :
public: public:
inline ExtendedAttributes( inline ExtendedAttributes(
sal_Int32 nAttributes, sal_Int32 nAttributes,
sal_Int32 * pUids, std::unique_ptr<sal_Int32[]> pUids,
OUString * pLocalNames, OUString * pQNames, std::unique_ptr<OUString[]> pLocalNames,
std::unique_ptr<OUString[]> pQNames,
Reference< xml::sax::XAttributeList > const & xAttributeList ); Reference< xml::sax::XAttributeList > const & xAttributeList );
// XAttributes // XAttributes
...@@ -336,13 +337,13 @@ public: ...@@ -336,13 +337,13 @@ public:
inline ExtendedAttributes::ExtendedAttributes( inline ExtendedAttributes::ExtendedAttributes(
sal_Int32 nAttributes, sal_Int32 nAttributes,
sal_Int32 * pUids, std::unique_ptr<sal_Int32[]> pUids,
OUString * pLocalNames, OUString * pQNames, std::unique_ptr<OUString[]> pLocalNames, std::unique_ptr<OUString[]> pQNames,
Reference< xml::sax::XAttributeList > const & xAttributeList ) Reference< xml::sax::XAttributeList > const & xAttributeList )
: m_nAttributes( nAttributes ) : m_nAttributes( nAttributes )
, m_pUids( pUids ) , m_pUids( std::move(pUids) )
, m_pLocalNames( pLocalNames ) , m_pLocalNames( std::move(pLocalNames) )
, m_pQNames( pQNames ) , m_pQNames( std::move(pQNames) )
, m_pValues( new OUString[ nAttributes ] ) , m_pValues( new OUString[ nAttributes ] )
{ {
for ( sal_Int32 nPos = 0; nPos < nAttributes; ++nPos ) for ( sal_Int32 nPos = 0; nPos < nAttributes; ++nPos )
...@@ -441,10 +442,10 @@ void DocumentHandlerImpl::startElement( ...@@ -441,10 +442,10 @@ void DocumentHandlerImpl::startElement(
sal_Int16 nAttribs = xAttribs->getLength(); sal_Int16 nAttribs = xAttribs->getLength();
// save all namespace ids // save all namespace ids
sal_Int32 * pUids = new sal_Int32[ nAttribs ]; std::unique_ptr<sal_Int32[]> pUids(new sal_Int32[ nAttribs ]);
OUString * pPrefixes = new OUString[ nAttribs ]; OUString * pPrefixes = new OUString[ nAttribs ];
OUString * pLocalNames = new OUString[ nAttribs ]; std::unique_ptr<OUString[]> pLocalNames(new OUString[ nAttribs ]);
OUString * pQNames = new OUString[ nAttribs ]; std::unique_ptr<OUString[]> pQNames(new OUString[ nAttribs ]);
// first recognize all xmlns attributes // first recognize all xmlns attributes
sal_Int16 nPos; sal_Int16 nPos;
...@@ -511,7 +512,7 @@ void DocumentHandlerImpl::startElement( ...@@ -511,7 +512,7 @@ void DocumentHandlerImpl::startElement(
// ownership of arrays belongs to attribute list // ownership of arrays belongs to attribute list
xAttributes = static_cast< xml::input::XAttributes * >( xAttributes = static_cast< xml::input::XAttributes * >(
new ExtendedAttributes( new ExtendedAttributes(
nAttribs, pUids, pLocalNames, pQNames, nAttribs, std::move(pUids), std::move(pLocalNames), std::move(pQNames),
xAttribs ) ); xAttribs ) );
getElementName( rQElementName, &nUid, &aLocalName ); getElementName( rQElementName, &nUid, &aLocalName );
......
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