summaryrefslogtreecommitdiff
path: root/xmloff/source/style/xmlnumfi.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-04-14 23:44:25 +0200
committerMichael Stahl <mstahl@redhat.com>2012-04-18 15:30:03 +0200
commit9013644f99950a348d8406352d0696443e6be659 (patch)
treefc3e3ab169e11d2097b77d56fcf83a51372ba27c /xmloff/source/style/xmlnumfi.cxx
parent850bfeeda8ceae207417c2a1733c2304056fdcb2 (diff)
Convert SV_DECL_PTRARR_DEL to boost::ptr_vector
Diffstat (limited to 'xmloff/source/style/xmlnumfi.cxx')
-rw-r--r--xmloff/source/style/xmlnumfi.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index bd953a31b28c..3bb00d19a5b5 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -51,6 +51,8 @@
#include <xmloff/families.hxx>
#include <xmloff/xmltoken.hxx>
+#include <boost/ptr_container/ptr_vector.hpp>
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -69,8 +71,7 @@ struct SvXMLNumFmtEntry
aName(rN), nKey(nK), bRemoveAfterUse(bR) {}
};
-typedef SvXMLNumFmtEntry* SvXMLNumFmtEntryPtr;
-SV_DECL_PTRARR_DEL( SvXMLNumFmtEntryArr, SvXMLNumFmtEntryPtr, 4 )
+class SvXMLNumFmtEntryArr : public boost::ptr_vector<SvXMLNumFmtEntry> {};
struct SvXMLEmbeddedElement
{
@@ -379,7 +380,6 @@ static SvXMLDefaultDateFormat aDefaultDateFormats[] =
//-------------------------------------------------------------------------
-SV_IMPL_PTRARR( SvXMLNumFmtEntryArr, SvXMLNumFmtEntryPtr );
SV_IMPL_OP_PTRARR_SORT( SvXMLEmbeddedElementArr, SvXMLEmbeddedElementPtr );
//-------------------------------------------------------------------------
@@ -414,10 +414,10 @@ SvXMLNumImpData::~SvXMLNumImpData()
sal_uInt32 SvXMLNumImpData::GetKeyForName( const rtl::OUString& rName )
{
- sal_uInt16 nCount = aNameEntries.Count();
+ sal_uInt16 nCount = aNameEntries.size();
for (sal_uInt16 i=0; i<nCount; i++)
{
- const SvXMLNumFmtEntry* pObj = aNameEntries[i];
+ const SvXMLNumFmtEntry* pObj = &aNameEntries[i];
if ( pObj->aName == rName )
return pObj->nKey; // found
}
@@ -431,10 +431,10 @@ void SvXMLNumImpData::AddKey( sal_uInt32 nKey, const rtl::OUString& rName, sal_B
// if there is already an entry for this key without the bRemoveAfterUse flag,
// clear the flag for this entry, too
- sal_uInt16 nCount = aNameEntries.Count();
+ sal_uInt16 nCount = aNameEntries.size();
for (sal_uInt16 i=0; i<nCount; i++)
{
- SvXMLNumFmtEntry* pObj = aNameEntries[i];
+ SvXMLNumFmtEntry* pObj = &aNameEntries[i];
if ( pObj->nKey == nKey && !pObj->bRemoveAfterUse )
{
bRemoveAfterUse = sal_False; // clear flag for new entry
@@ -449,15 +449,15 @@ void SvXMLNumImpData::AddKey( sal_uInt32 nKey, const rtl::OUString& rName, sal_B
}
SvXMLNumFmtEntry* pObj = new SvXMLNumFmtEntry( rName, nKey, bRemoveAfterUse );
- aNameEntries.Insert( pObj, aNameEntries.Count() );
+ aNameEntries.push_back( pObj );
}
void SvXMLNumImpData::SetUsed( sal_uInt32 nKey )
{
- sal_uInt16 nCount = aNameEntries.Count();
+ sal_uInt16 nCount = aNameEntries.size();
for (sal_uInt16 i=0; i<nCount; i++)
{
- SvXMLNumFmtEntry* pObj = aNameEntries[i];
+ SvXMLNumFmtEntry* pObj = &aNameEntries[i];
if ( pObj->nKey == nKey )
{
pObj->bRemoveAfterUse = sal_False; // used -> don't remove
@@ -478,10 +478,10 @@ void SvXMLNumImpData::RemoveVolatileFormats()
if ( !pFormatter )
return;
- sal_uInt16 nCount = aNameEntries.Count();
+ sal_uInt16 nCount = aNameEntries.size();
for (sal_uInt16 i=0; i<nCount; i++)
{
- const SvXMLNumFmtEntry* pObj = aNameEntries[i];
+ const SvXMLNumFmtEntry* pObj = &aNameEntries[i];
if ( pObj->bRemoveAfterUse )
{
const SvNumberformat* pFormat = pFormatter->GetEntry(pObj->nKey);