summaryrefslogtreecommitdiffstats
path: root/svl
diff options
context:
space:
mode:
authorNigel Hawkins <n.hawkins@gmx.com>2011-08-09 15:23:32 +0100
committerNigel Hawkins <n.hawkins@gmx.com>2011-08-09 15:23:32 +0100
commitbb8ea3fc5f69522073a490782e99c81aed96d02f (patch)
tree05dea5b84a7536992b95cd0608da6f85f3baa31b /svl
parentReplace SvUShorts with vector in editeng/impedit.hxx and cascade changes. (diff)
downloadcore-bb8ea3fc5f69522073a490782e99c81aed96d02f.tar.gz
core-bb8ea3fc5f69522073a490782e99c81aed96d02f.zip
Replace SvUShorts with vector in aeitem.[ch]xx
LGPLv3+/MPL1.1
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/aeitem.hxx6
-rw-r--r--svl/source/items/aeitem.cxx15
2 files changed, 7 insertions, 14 deletions
diff --git a/svl/inc/svl/aeitem.hxx b/svl/inc/svl/aeitem.hxx
index 47c437f8a177..edb98f3db0d5 100644
--- a/svl/inc/svl/aeitem.hxx
+++ b/svl/inc/svl/aeitem.hxx
@@ -31,14 +31,14 @@
#include "svl/svldllapi.h"
#include <svl/poolitem.hxx>
#include <svl/eitem.hxx>
+#include <vector>
class SfxAllEnumValueArr;
-class SvUShorts;
class SVL_DLLPUBLIC SfxAllEnumItem: public SfxEnumItem
{
- SfxAllEnumValueArr* pValues;
- SvUShorts* pDisabledValues;
+ SfxAllEnumValueArr* pValues;
+ std::vector<sal_uInt16>* pDisabledValues;
protected:
sal_uInt16 _GetPosByValue( sal_uInt16 nValue ) const;
diff --git a/svl/source/items/aeitem.cxx b/svl/source/items/aeitem.cxx
index e45c6acbaa26..e81c67d2d041 100644
--- a/svl/source/items/aeitem.cxx
+++ b/svl/source/items/aeitem.cxx
@@ -31,8 +31,6 @@
#include <tools/string.hxx>
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
#include <svl/svarray.hxx>
#include <svl/aeitem.hxx>
@@ -129,12 +127,7 @@ SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem &rCopy):
if( rCopy.pDisabledValues )
{
- pDisabledValues = new SvUShorts;
- for ( sal_uInt16 nPos = 0; nPos < rCopy.pDisabledValues->Count(); ++nPos )
- {
- pDisabledValues->Insert( rCopy.pDisabledValues->GetObject(nPos),
- nPos );
- }
+ pDisabledValues = new std::vector<sal_uInt16>( *(rCopy.pDisabledValues) );
}
}
@@ -272,16 +265,16 @@ void SfxAllEnumItem::DisableValue( sal_uInt16 nValue )
{
DBG_CHKTHIS(SfxAllEnumItem, 0);
if ( !pDisabledValues )
- pDisabledValues = new SvUShorts;
+ pDisabledValues = new std::vector<sal_uInt16>;
- pDisabledValues->Insert( nValue, pDisabledValues->Count() );
+ pDisabledValues->push_back( nValue );
}
sal_Bool SfxAllEnumItem::IsEnabled( sal_uInt16 nValue ) const
{
if ( pDisabledValues )
{
- for ( sal_uInt16 i=0; i<pDisabledValues->Count(); i++ )
+ for ( size_t i=0; i<pDisabledValues->size(); i++ )
if ( (*pDisabledValues)[i] == nValue )
return sal_False;
}