Kaydet (Commit) 84a0fb09 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR(SwSortKeys) to std::vector

Change-Id: I4596da43e75c0b8c91039786c739c017ee16b6f2
üst bf799459
......@@ -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
{
......
......@@ -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;
......
......@@ -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: */
......@@ -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
......
......@@ -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;
......
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