Kaydet (Commit) 15f32b5a authored tarafından Michael Stahl's avatar Michael Stahl

basic: replace boost::ptr_vector with std::vector<std::unique_ptr>>

Change-Id: I96ea97c1df7903a28387d8e1171075be55a80ca7
üst ce6466f5
......@@ -328,20 +328,20 @@ SbxInfo::~SbxInfo()
void SbxInfo::AddParam(const OUString& rName, SbxDataType eType, SbxFlagBits nFlags)
{
aParams.push_back(new SbxParamInfo(rName, eType, nFlags));
m_Params.push_back(std::unique_ptr<SbxParamInfo>(new SbxParamInfo(rName, eType, nFlags)));
}
const SbxParamInfo* SbxInfo::GetParam( sal_uInt16 n ) const
{
if( n < 1 || n > aParams.size() )
if (n < 1 || n > m_Params.size())
return NULL;
else
return &(aParams[n - 1]);
return m_Params[n - 1].get();
}
bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
{
aParams.clear();
m_Params.clear();
sal_uInt16 nParam;
aComment = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm,
RTL_TEXTENCODING_ASCII_US);
......@@ -359,7 +359,7 @@ bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
if( nVer > 1 )
rStrm.ReadUInt32( nUserData );
AddParam( aName, (SbxDataType) nType, nFlags );
SbxParamInfo& p(aParams.back());
SbxParamInfo& p(*m_Params.back());
p.nUserData = nUserData;
}
return true;
......@@ -371,8 +371,8 @@ bool SbxInfo::StoreData( SvStream& rStrm ) const
RTL_TEXTENCODING_ASCII_US );
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aHelpFile,
RTL_TEXTENCODING_ASCII_US);
rStrm.WriteUInt32( nHelpId ).WriteUInt16( aParams.size() );
for(SbxParams::const_iterator i = aParams.begin(); i != aParams.end(); ++i)
rStrm.WriteUInt32( nHelpId ).WriteUInt16( m_Params.size() );
for (auto const& i : m_Params)
{
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, i->aName,
RTL_TEXTENCODING_ASCII_US);
......
......@@ -228,7 +228,7 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const
// Request parameter-information (not for objects)
const_cast<SbxVariable*>(this)->GetInfo();
// Append nothing, if it is a simple property (no empty brackets)
if( !pInfo || ( pInfo->aParams.empty() && GetClass() == SbxCLASS_PROPERTY ))
if (!pInfo || (pInfo->m_Params.empty() && GetClass() == SbxCLASS_PROPERTY))
{
return maName;
}
......@@ -249,10 +249,11 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const
}
aTmp += "(";
for(SbxParams::const_iterator i = pInfo->aParams.begin(); i != pInfo->aParams.end(); ++i)
for (SbxParams::const_iterator iter = pInfo->m_Params.begin(); iter != pInfo->m_Params.end(); ++iter)
{
auto const& i = *iter;
int nt = i->eType & 0x0FFF;
if( i != pInfo->aParams.begin() )
if (iter != pInfo->m_Params.begin())
{
aTmp += ",";
}
......@@ -639,11 +640,12 @@ bool SbxVariable::StoreData( SvStream& rStrm ) const
////////////////////////////// SbxInfo
SbxInfo::SbxInfo() : aHelpFile(), nHelpId( 0 ), aParams()
SbxInfo::SbxInfo()
: aHelpFile(), nHelpId(0)
{}
SbxInfo::SbxInfo( const OUString& r, sal_uInt32 n )
: aHelpFile( r ), nHelpId( n ), aParams()
: aHelpFile( r ), nHelpId( n )
{}
////////////////////////////// SbxAlias
......
......@@ -31,8 +31,8 @@
#include <basic/sbxmeth.hxx>
#include <basic/basicdllapi.h>
#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
#include <memory>
class SvStream;
class SbxBase;
......@@ -59,7 +59,7 @@ struct SbxParamInfo
~SbxParamInfo() {}
};
typedef boost::ptr_vector<SbxParamInfo> SbxParams;
typedef std::vector<std::unique_ptr<SbxParamInfo>> SbxParams;
class BASIC_DLLPUBLIC SbxInfo : public SvRefBase
{
......@@ -69,7 +69,7 @@ class BASIC_DLLPUBLIC SbxInfo : public SvRefBase
OUString aComment;
OUString aHelpFile;
sal_uInt32 nHelpId;
SbxParams aParams;
SbxParams m_Params;
protected:
bool LoadData( SvStream&, sal_uInt16 );
......
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