Kaydet (Commit) 09a9234c authored tarafından Ian's avatar Ian Kaydeden (comit) Noel Grandin

tdf#90222: Removed ScaStringList and replaced all uses with std::vector

Change-Id: Icd12e4a1557b39fd387173ce261118c27200dd2b
Reviewed-on: https://gerrit.libreoffice.org/17543Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 46791546
......@@ -62,12 +62,6 @@ void ScaList::_Grow()
pData = pNewData;
}
ScaStringList::~ScaStringList()
{
for( OUString* pStr = First(); pStr; pStr = Next() )
delete pStr;
}
ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) :
ResId( nId, rResMgr )
{
......@@ -109,7 +103,7 @@ ScaFuncData::ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rResMgr ) :
const ResStringArray& rArr = aArrLoader.GetStringArray();
for( sal_uInt32 nIndex = 0; nIndex < rArr.Count(); nIndex++ )
aCompList.Append( rArr.GetString( nIndex ) );
aCompList.push_back( rArr.GetString( nIndex ) );
}
ScaFuncData::~ScaFuncData()
......@@ -445,14 +439,14 @@ uno::Sequence< sheet::LocalizedName > SAL_CALL ScaDateAddIn::getCompatibilityNam
if( !pFData )
return uno::Sequence< sheet::LocalizedName >( 0 );
const ScaStringList& rStrList = pFData->GetCompNameList();
sal_uInt32 nCount = rStrList.Count();
const std::vector<OUString>& rStrList = pFData->GetCompNameList();
sal_uInt32 nCount = rStrList.size();
uno::Sequence< sheet::LocalizedName > aRet( nCount );
sheet::LocalizedName* pArray = aRet.getArray();
for( sal_uInt32 nIndex = 0; nIndex < nCount; nIndex++ )
pArray[ nIndex ] = sheet::LocalizedName( GetLocale( nIndex ), *rStrList.Get( nIndex ) );
pArray[ nIndex ] = sheet::LocalizedName( GetLocale( nIndex ), rStrList.at( nIndex ) );
return aRet;
}
......
......@@ -23,6 +23,7 @@
#define INCLUDED_SCADDINS_SOURCE_DATEFUNC_DATEFUNC_HXX
#include <string.h>
#include <vector>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
......@@ -78,45 +79,6 @@ inline void ScaList::Append( void* pNew )
}
class ScaStringList : protected ScaList
{
public:
inline ScaStringList() : ScaList() {};
virtual ~ScaStringList();
using ScaList::Count;
inline const OUString* Get( sal_uInt32 nIndex ) const;
inline OUString* First();
inline OUString* Next();
using ScaList::Append;
inline void Append( const OUString& rNew );
};
inline const OUString* ScaStringList::Get( sal_uInt32 nIndex ) const
{
return static_cast< const OUString* >( ScaList::GetObject( nIndex ) );
}
inline OUString* ScaStringList::First()
{
return static_cast< OUString* >( ScaList::First() );
}
inline OUString* ScaStringList::Next()
{
return static_cast< OUString* >( ScaList::Next() );
}
inline void ScaStringList::Append( const OUString& rNew )
{
ScaList::Append( new OUString( rNew ) );
}
class ScaResId : public ResId
{
public:
......@@ -214,7 +176,7 @@ private:
sal_uInt16 nDescrID; // leads also to parameter descriptions!
sal_uInt16 nCompListID; // resource ID to list of valid names
sal_uInt16 nParamCount; // num of parameters
ScaStringList aCompList; // list of all valid names
std::vector<OUString> aCompList; // list of all valid names
ScaCategory eCat; // function category
bool bDouble; // name already exist in Calc
bool bWithOpt; // first parameter is internal
......@@ -232,7 +194,7 @@ public:
inline bool Is( const OUString& rCompare ) const
{ return aIntName == rCompare; }
inline const ScaStringList& GetCompNameList() const { return aCompList; }
inline const std::vector<OUString>& GetCompNameList() const { return aCompList; }
};
......
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