Kaydet (Commit) bb6d9b01 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Remove this class that only derives from std::vector and not much else.

Change-Id: Ibc584f4148cec49a9ac34a240cc2fa3e87daf443
üst 54c6f08c
...@@ -36,15 +36,6 @@ public: ...@@ -36,15 +36,6 @@ public:
~SbxVarEntry() { delete pAlias; } ~SbxVarEntry() { delete pAlias; }
}; };
typedef SbxVarEntry* SbxVarEntryPtr;
typedef vector< SbxVarEntryPtr > SbxVarEntryPtrVector;
class SbxVarRefs : public SbxVarEntryPtrVector
{
public:
SbxVarRefs( void ) {}
};
TYPEINIT1(SbxArray,SbxBase) TYPEINIT1(SbxArray,SbxBase)
TYPEINIT1(SbxDimArray,SbxArray) TYPEINIT1(SbxDimArray,SbxArray)
...@@ -52,7 +43,7 @@ TYPEINIT1(SbxDimArray,SbxArray) ...@@ -52,7 +43,7 @@ TYPEINIT1(SbxDimArray,SbxArray)
SbxArray::SbxArray( SbxDataType t ) : SbxBase() SbxArray::SbxArray( SbxDataType t ) : SbxBase()
{ {
pData = new SbxVarRefs; pData = new VarEntriesType;
eType = t; eType = t;
if( t != SbxVARIANT ) if( t != SbxVARIANT )
SetFlag( SBX_FIXED ); SetFlag( SBX_FIXED );
...@@ -61,7 +52,7 @@ SbxArray::SbxArray( SbxDataType t ) : SbxBase() ...@@ -61,7 +52,7 @@ SbxArray::SbxArray( SbxDataType t ) : SbxBase()
SbxArray::SbxArray( const SbxArray& rArray ) : SbxArray::SbxArray( const SbxArray& rArray ) :
SvRefBase( rArray ), SbxBase() SvRefBase( rArray ), SbxBase()
{ {
pData = new SbxVarRefs; pData = new VarEntriesType;
if( rArray.eType != SbxVARIANT ) if( rArray.eType != SbxVARIANT )
SetFlag( SBX_FIXED ); SetFlag( SBX_FIXED );
*this = rArray; *this = rArray;
...@@ -73,14 +64,14 @@ SbxArray& SbxArray::operator=( const SbxArray& rArray ) ...@@ -73,14 +64,14 @@ SbxArray& SbxArray::operator=( const SbxArray& rArray )
{ {
eType = rArray.eType; eType = rArray.eType;
Clear(); Clear();
SbxVarRefs* pSrc = rArray.pData; VarEntriesType* pSrc = rArray.pData;
for( sal_uInt32 i = 0; i < pSrc->size(); i++ ) for( sal_uInt32 i = 0; i < pSrc->size(); i++ )
{ {
SbxVarEntryPtr pSrcRef = (*pSrc)[i]; SbxVarEntry* pSrcRef = (*pSrc)[i];
const SbxVariable* pSrc_ = *pSrcRef; const SbxVariable* pSrc_ = *pSrcRef;
if( !pSrc_ ) if( !pSrc_ )
continue; continue;
SbxVarEntryPtr pDstRef = new SbxVarEntry; SbxVarEntry* pDstRef = new SbxVarEntry;
*((SbxVariableRef*) pDstRef) = *((SbxVariableRef*) pSrcRef); *((SbxVariableRef*) pDstRef) = *((SbxVariableRef*) pSrcRef);
if( pSrcRef->pAlias ) if( pSrcRef->pAlias )
{ {
...@@ -151,8 +142,7 @@ SbxVariableRef& SbxArray::GetRef32( sal_uInt32 nIdx ) ...@@ -151,8 +142,7 @@ SbxVariableRef& SbxArray::GetRef32( sal_uInt32 nIdx )
} }
while( pData->size() <= nIdx ) while( pData->size() <= nIdx )
{ {
const SbxVarEntryPtr p = new SbxVarEntry; pData->push_back(new SbxVarEntry);
pData->push_back( p );
} }
return *((*pData)[nIdx]); return *((*pData)[nIdx]);
} }
...@@ -169,8 +159,7 @@ SbxVariableRef& SbxArray::GetRef( sal_uInt16 nIdx ) ...@@ -169,8 +159,7 @@ SbxVariableRef& SbxArray::GetRef( sal_uInt16 nIdx )
} }
while( pData->size() <= nIdx ) while( pData->size() <= nIdx )
{ {
const SbxVarEntryPtr p = new SbxVarEntry; pData->push_back(new SbxVarEntry);
pData->push_back( p );
} }
return *((*pData)[nIdx]); return *((*pData)[nIdx]);
} }
...@@ -291,9 +280,9 @@ void SbxArray::Insert32( SbxVariable* pVar, sal_uInt32 nIdx ) ...@@ -291,9 +280,9 @@ void SbxArray::Insert32( SbxVariable* pVar, sal_uInt32 nIdx )
{ {
return; return;
} }
SbxVarEntryPtr p = new SbxVarEntry; SbxVarEntry* p = new SbxVarEntry;
*((SbxVariableRef*) p) = pVar; *((SbxVariableRef*) p) = pVar;
SbxVarEntryPtrVector::size_type nSize = pData->size(); size_t nSize = pData->size();
if( nIdx > nSize ) if( nIdx > nSize )
{ {
nIdx = nSize; nIdx = nSize;
...@@ -370,7 +359,7 @@ void SbxArray::Merge( SbxArray* p ) ...@@ -370,7 +359,7 @@ void SbxArray::Merge( SbxArray* p )
sal_uInt32 nSize = p->Count(); sal_uInt32 nSize = p->Count();
for( sal_uInt32 i = 0; i < nSize; i++ ) for( sal_uInt32 i = 0; i < nSize; i++ )
{ {
SbxVarEntryPtr pRef1 = (*(p->pData))[i]; SbxVarEntry* pRef1 = (*(p->pData))[i];
// Is the element by name already inside? // Is the element by name already inside?
// Then overwrite! // Then overwrite!
SbxVariable* pVar = *pRef1; SbxVariable* pVar = *pRef1;
...@@ -390,9 +379,8 @@ void SbxArray::Merge( SbxArray* p ) ...@@ -390,9 +379,8 @@ void SbxArray::Merge( SbxArray* p )
} }
if( pRef1 ) if( pRef1 )
{ {
SbxVarEntryPtr pRef = new SbxVarEntry; SbxVarEntry* pRef = new SbxVarEntry;
const SbxVarEntryPtr pTemp = pRef; pData->push_back(pRef);
pData->push_back( pTemp );
*((SbxVariableRef*) pRef) = *((SbxVariableRef*) pRef1); *((SbxVariableRef*) pRef) = *((SbxVariableRef*) pRef1);
if( pRef1->pAlias ) if( pRef1->pAlias )
{ {
......
...@@ -115,17 +115,19 @@ public: ...@@ -115,17 +115,19 @@ public:
// The variables convert from SbxVariablen. Put()/Insert() into the // The variables convert from SbxVariablen. Put()/Insert() into the
// declared datatype, if they are not SbxVARIANT. // declared datatype, if they are not SbxVARIANT.
class SbxVarRefs; class SbxVarEntry;
class BASIC_DLLPUBLIC SbxArray : public SbxBase class BASIC_DLLPUBLIC SbxArray : public SbxBase
{ {
typedef std::vector<SbxVarEntry*> VarEntriesType;
// #100883 Method to set method directly to parameter array // #100883 Method to set method directly to parameter array
friend class SbMethod; friend class SbMethod;
friend class SbClassModuleObject; friend class SbClassModuleObject;
friend SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ); friend SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj );
BASIC_DLLPRIVATE void PutDirect( SbxVariable* pVar, sal_uInt32 nIdx ); BASIC_DLLPRIVATE void PutDirect( SbxVariable* pVar, sal_uInt32 nIdx );
SbxVarRefs* pData; // The variables VarEntriesType* pData; // The variables
protected: protected:
SbxDataType eType; // Data type of the array SbxDataType eType; // Data type of the array
......
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