diff options
author | Nigel Hawkins <n.hawkins@gmx.com> | 2011-08-09 15:23:32 +0100 |
---|---|---|
committer | Nigel Hawkins <n.hawkins@gmx.com> | 2011-08-09 15:23:32 +0100 |
commit | bb8ea3fc5f69522073a490782e99c81aed96d02f (patch) | |
tree | 05dea5b84a7536992b95cd0608da6f85f3baa31b | |
parent | Replace SvUShorts with vector in editeng/impedit.hxx and cascade changes. (diff) | |
download | core-bb8ea3fc5f69522073a490782e99c81aed96d02f.tar.gz core-bb8ea3fc5f69522073a490782e99c81aed96d02f.zip |
Replace SvUShorts with vector in aeitem.[ch]xx
LGPLv3+/MPL1.1
-rw-r--r-- | svl/inc/svl/aeitem.hxx | 6 | ||||
-rw-r--r-- | svl/source/items/aeitem.cxx | 15 |
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; } |