summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-09 13:41:01 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 16:16:45 +0200
commit97dbbf7282b48eccedf60696ad65cf4e9987c7a9 (patch)
treebd39e0bfff5b9a87b29f7726345f0e38d8465eae
parent7469d7556919a4ebb54e71fbdf3be9c7f88afa13 (diff)
avoid manual memory management
Change-Id: Ibc4e7191e5cbc5a14c32b32bab99116173070a87
-rw-r--r--xmloff/source/text/XMLTextListAutoStylePool.cxx10
1 files 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 <vector>
+
#include <tools/debug.hxx>
#include <tools/solar.h>
#include <o3tl/sorted_vector.hxx>
@@ -246,16 +248,11 @@ void XMLTextListAutoStylePool::exportXML() const
if( !nCount )
return;
- XMLTextListAutoStylePoolEntry_Impl **aExpEntries =
- new XMLTextListAutoStylePoolEntry_Impl*[nCount];
+ std::vector<XMLTextListAutoStylePoolEntry_Impl*> 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" );
aExpEntries[pEntry->GetPos()] = pEntry;
@@ -269,7 +266,6 @@ void XMLTextListAutoStylePool::exportXML() const
aNumRuleExp.exportNumberingRule( pEntry->GetName(), false,
pEntry->GetNumRules() );
}
- delete [] aExpEntries;
}