Kaydet (Commit) 97dbbf72 authored tarafından David Tardon's avatar David Tardon

avoid manual memory management

Change-Id: Ibc4e7191e5cbc5a14c32b32bab99116173070a87
üst 7469d755
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <vector>
#include <tools/debug.hxx> #include <tools/debug.hxx>
#include <tools/solar.h> #include <tools/solar.h>
#include <o3tl/sorted_vector.hxx> #include <o3tl/sorted_vector.hxx>
...@@ -246,15 +248,10 @@ void XMLTextListAutoStylePool::exportXML() const ...@@ -246,15 +248,10 @@ void XMLTextListAutoStylePool::exportXML() const
if( !nCount ) if( !nCount )
return; return;
XMLTextListAutoStylePoolEntry_Impl **aExpEntries = std::vector<XMLTextListAutoStylePoolEntry_Impl*> aExpEntries(nCount);
new XMLTextListAutoStylePoolEntry_Impl*[nCount];
sal_uInt32 i; sal_uInt32 i;
for( i=0; i < nCount; i++ ) for( i=0; i < nCount; i++ )
{
aExpEntries[i] = nullptr;
}
for( i=0; i < nCount; i++ )
{ {
XMLTextListAutoStylePoolEntry_Impl *pEntry = (*pPool)[i]; XMLTextListAutoStylePoolEntry_Impl *pEntry = (*pPool)[i];
SAL_WARN_IF( pEntry->GetPos() >= nCount, "xmloff", "Illegal pos" ); SAL_WARN_IF( pEntry->GetPos() >= nCount, "xmloff", "Illegal pos" );
...@@ -269,7 +266,6 @@ void XMLTextListAutoStylePool::exportXML() const ...@@ -269,7 +266,6 @@ void XMLTextListAutoStylePool::exportXML() const
aNumRuleExp.exportNumberingRule( pEntry->GetName(), false, aNumRuleExp.exportNumberingRule( pEntry->GetName(), false,
pEntry->GetNumRules() ); pEntry->GetNumRules() );
} }
delete [] aExpEntries;
} }
......
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