From 97dbbf7282b48eccedf60696ad65cf4e9987c7a9 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 9 Sep 2016 13:41:01 +0200 Subject: avoid manual memory management Change-Id: Ibc4e7191e5cbc5a14c32b32bab99116173070a87 --- xmloff/source/text/XMLTextListAutoStylePool.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx index bbdf2f77faae..f480cfdd93a3 100644 --- a/xmloff/source/text/XMLTextListAutoStylePool.cxx +++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include #include @@ -246,15 +248,10 @@ void XMLTextListAutoStylePool::exportXML() const if( !nCount ) return; - XMLTextListAutoStylePoolEntry_Impl **aExpEntries = - new XMLTextListAutoStylePoolEntry_Impl*[nCount]; + std::vector aExpEntries(nCount); sal_uInt32 i; for( i=0; i < nCount; i++ ) - { - aExpEntries[i] = nullptr; - } - for( i=0; i < nCount; i++ ) { XMLTextListAutoStylePoolEntry_Impl *pEntry = (*pPool)[i]; SAL_WARN_IF( pEntry->GetPos() >= nCount, "xmloff", "Illegal pos" ); @@ -269,7 +266,6 @@ void XMLTextListAutoStylePool::exportXML() const aNumRuleExp.exportNumberingRule( pEntry->GetName(), false, pEntry->GetNumRules() ); } - delete [] aExpEntries; } -- cgit