summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-05-16 09:35:18 +0200
committerMichael Stahl <mstahl@redhat.com>2012-05-25 00:17:03 +0200
commit84a0fb0900e3c1b708be8605f83ff94ca03c7482 (patch)
treec5a75965042d6a78f34ccda6909cdf1b05ceaaa0 /sw
parentbf799459d8e8eabd764450c82450036c5d0e742f (diff)
Convert SV_DECL_PTRARR(SwSortKeys) to std::vector
Change-Id: I4596da43e75c0b8c91039786c739c017ee16b6f2
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/sortopt.hxx3
-rw-r--r--sw/source/core/doc/docsort.cxx2
-rw-r--r--sw/source/core/doc/sortopt.cxx10
-rw-r--r--sw/source/core/unocore/unoobj.cxx8
-rw-r--r--sw/source/ui/misc/srtdlg.cxx6
5 files changed, 15 insertions, 14 deletions
diff --git a/sw/inc/sortopt.hxx b/sw/inc/sortopt.hxx
index 35e5982d52a3..aeeb72d5a91f 100644
--- a/sw/inc/sortopt.hxx
+++ b/sw/inc/sortopt.hxx
@@ -32,6 +32,7 @@
#include <svl/svarray.hxx>
#include <tools/string.hxx>
#include "swdllapi.h"
+#include <vector>
enum SwSortOrder { SRT_ASCENDING, SRT_DESCENDING };
enum SwSortDirection { SRT_COLUMNS, SRT_ROWS };
@@ -49,7 +50,7 @@ struct SW_DLLPUBLIC SwSortKey
sal_Bool bIsNumeric;
};
-SV_DECL_PTRARR(SwSortKeys, SwSortKey*, 3)
+typedef std::vector<SwSortKey*> SwSortKeys;
struct SW_DLLPUBLIC SwSortOptions
{
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 3cc31df8951e..512520711c4b 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -142,7 +142,7 @@ sal_Bool SwSortElement::operator<(const SwSortElement& rCmp)
{
// The actual comparison
- for(sal_uInt16 nKey = 0; nKey < pOptions->aKeys.Count(); ++nKey)
+ for(sal_uInt16 nKey = 0; nKey < pOptions->aKeys.size(); ++nKey)
{
const SwSortElement *pOrig, *pCmp;
diff --git a/sw/source/core/doc/sortopt.cxx b/sw/source/core/doc/sortopt.cxx
index f4cc8da8f5b7..d2157722c206 100644
--- a/sw/source/core/doc/sortopt.cxx
+++ b/sw/source/core/doc/sortopt.cxx
@@ -29,8 +29,7 @@
#include <i18npool/lang.h>
#include <sortopt.hxx>
-
-SV_IMPL_PTRARR(SwSortKeys, SwSortKey*)
+#include <boost/foreach.hpp>
/*--------------------------------------------------------------------
Description: Sort Key
@@ -77,16 +76,17 @@ SwSortOptions::SwSortOptions(const SwSortOptions& rOpt) :
bTable( rOpt.bTable ),
bIgnoreCase( rOpt.bIgnoreCase )
{
- for( sal_uInt16 i=0; i < rOpt.aKeys.Count(); ++i )
+ for( sal_uInt16 i=0; i < rOpt.aKeys.size(); ++i )
{
SwSortKey* pNew = new SwSortKey(*rOpt.aKeys[i]);
- aKeys.C40_INSERT( SwSortKey, pNew, aKeys.Count());
+ aKeys.push_back( pNew );
}
}
SwSortOptions::~SwSortOptions()
{
- aKeys.DeleteAndDestroy(0, aKeys.Count());
+ BOOST_FOREACH(SwSortKey *pKey, aKeys)
+ delete pKey;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 2bf8ead309f6..e478a6952158 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2822,18 +2822,18 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
if (pKey1->nColumnId != USHRT_MAX)
{
- rSortOpt.aKeys.C40_INSERT(SwSortKey, pKey1, rSortOpt.aKeys.Count());
+ rSortOpt.aKeys.push_back(pKey1);
}
if (pKey2->nColumnId != USHRT_MAX)
{
- rSortOpt.aKeys.C40_INSERT(SwSortKey, pKey2, rSortOpt.aKeys.Count());
+ rSortOpt.aKeys.push_back(pKey2);
}
if (pKey3->nColumnId != USHRT_MAX)
{
- rSortOpt.aKeys.C40_INSERT(SwSortKey, pKey3, rSortOpt.aKeys.Count());
+ rSortOpt.aKeys.push_back(pKey3);
}
- return bRet && rSortOpt.aKeys.Count() > 0;
+ return bRet && !rSortOpt.aKeys.empty();
}
void SAL_CALL
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index a1ef0698edff..2e5640a019b3 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -345,7 +345,7 @@ void SwSortDlg::Apply()
SwSortKey *pKey = new SwSortKey( nCol1, sEntry,
bAsc1 ? SRT_ASCENDING : SRT_DESCENDING );
- aOptions.aKeys.C40_INSERT(SwSortKey, pKey, aOptions.aKeys.Count());
+ aOptions.aKeys.push_back( pKey );
}
if( bCheck2 )
@@ -359,7 +359,7 @@ void SwSortDlg::Apply()
SwSortKey *pKey = new SwSortKey( nCol2, sEntry,
bAsc2 ? SRT_ASCENDING : SRT_DESCENDING );
- aOptions.aKeys.C40_INSERT( SwSortKey, pKey, aOptions.aKeys.Count() );
+ aOptions.aKeys.push_back( pKey );
}
if( bCheck3 )
@@ -373,7 +373,7 @@ void SwSortDlg::Apply()
SwSortKey *pKey = new SwSortKey( nCol3, sEntry,
bAsc3 ? SRT_ASCENDING : SRT_DESCENDING );
- aOptions.aKeys.C40_INSERT( SwSortKey, pKey, aOptions.aKeys.Count() );
+ aOptions.aKeys.push_back( pKey );
}
aOptions.eDirection = bCol ? SRT_COLUMNS : SRT_ROWS;