summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-25 12:13:32 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-06-25 15:03:46 -0400
commitbb6d9b0123dcde32fe260f6d1c3e567d1ddfcb35 (patch)
tree9253edc8f67eb2e76fc25ca8938dc9210001a6f7
parent54c6f08c2061f1af1a545e6b50d447f14b806057 (diff)
Remove this class that only derives from std::vector and not much else.
Change-Id: Ibc584f4148cec49a9ac34a240cc2fa3e87daf443
-rw-r--r--basic/source/sbx/sbxarray.cxx36
-rw-r--r--include/basic/sbx.hxx6
2 files changed, 16 insertions, 26 deletions
diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx
index 61ff86e1821a..494b3213e2b2 100644
--- a/basic/source/sbx/sbxarray.cxx
+++ b/basic/source/sbx/sbxarray.cxx
@@ -36,15 +36,6 @@ public:
~SbxVarEntry() { delete pAlias; }
};
-typedef SbxVarEntry* SbxVarEntryPtr;
-typedef vector< SbxVarEntryPtr > SbxVarEntryPtrVector;
-class SbxVarRefs : public SbxVarEntryPtrVector
-{
-public:
- SbxVarRefs( void ) {}
-};
-
-
TYPEINIT1(SbxArray,SbxBase)
TYPEINIT1(SbxDimArray,SbxArray)
@@ -52,7 +43,7 @@ TYPEINIT1(SbxDimArray,SbxArray)
SbxArray::SbxArray( SbxDataType t ) : SbxBase()
{
- pData = new SbxVarRefs;
+ pData = new VarEntriesType;
eType = t;
if( t != SbxVARIANT )
SetFlag( SBX_FIXED );
@@ -61,7 +52,7 @@ SbxArray::SbxArray( SbxDataType t ) : SbxBase()
SbxArray::SbxArray( const SbxArray& rArray ) :
SvRefBase( rArray ), SbxBase()
{
- pData = new SbxVarRefs;
+ pData = new VarEntriesType;
if( rArray.eType != SbxVARIANT )
SetFlag( SBX_FIXED );
*this = rArray;
@@ -73,14 +64,14 @@ SbxArray& SbxArray::operator=( const SbxArray& rArray )
{
eType = rArray.eType;
Clear();
- SbxVarRefs* pSrc = rArray.pData;
+ VarEntriesType* pSrc = rArray.pData;
for( sal_uInt32 i = 0; i < pSrc->size(); i++ )
{
- SbxVarEntryPtr pSrcRef = (*pSrc)[i];
+ SbxVarEntry* pSrcRef = (*pSrc)[i];
const SbxVariable* pSrc_ = *pSrcRef;
if( !pSrc_ )
continue;
- SbxVarEntryPtr pDstRef = new SbxVarEntry;
+ SbxVarEntry* pDstRef = new SbxVarEntry;
*((SbxVariableRef*) pDstRef) = *((SbxVariableRef*) pSrcRef);
if( pSrcRef->pAlias )
{
@@ -151,8 +142,7 @@ SbxVariableRef& SbxArray::GetRef32( sal_uInt32 nIdx )
}
while( pData->size() <= nIdx )
{
- const SbxVarEntryPtr p = new SbxVarEntry;
- pData->push_back( p );
+ pData->push_back(new SbxVarEntry);
}
return *((*pData)[nIdx]);
}
@@ -169,8 +159,7 @@ SbxVariableRef& SbxArray::GetRef( sal_uInt16 nIdx )
}
while( pData->size() <= nIdx )
{
- const SbxVarEntryPtr p = new SbxVarEntry;
- pData->push_back( p );
+ pData->push_back(new SbxVarEntry);
}
return *((*pData)[nIdx]);
}
@@ -291,9 +280,9 @@ void SbxArray::Insert32( SbxVariable* pVar, sal_uInt32 nIdx )
{
return;
}
- SbxVarEntryPtr p = new SbxVarEntry;
+ SbxVarEntry* p = new SbxVarEntry;
*((SbxVariableRef*) p) = pVar;
- SbxVarEntryPtrVector::size_type nSize = pData->size();
+ size_t nSize = pData->size();
if( nIdx > nSize )
{
nIdx = nSize;
@@ -370,7 +359,7 @@ void SbxArray::Merge( SbxArray* p )
sal_uInt32 nSize = p->Count();
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?
// Then overwrite!
SbxVariable* pVar = *pRef1;
@@ -390,9 +379,8 @@ void SbxArray::Merge( SbxArray* p )
}
if( pRef1 )
{
- SbxVarEntryPtr pRef = new SbxVarEntry;
- const SbxVarEntryPtr pTemp = pRef;
- pData->push_back( pTemp );
+ SbxVarEntry* pRef = new SbxVarEntry;
+ pData->push_back(pRef);
*((SbxVariableRef*) pRef) = *((SbxVariableRef*) pRef1);
if( pRef1->pAlias )
{
diff --git a/include/basic/sbx.hxx b/include/basic/sbx.hxx
index c642e121e22a..55022a80323d 100644
--- a/include/basic/sbx.hxx
+++ b/include/basic/sbx.hxx
@@ -115,17 +115,19 @@ public:
// The variables convert from SbxVariablen. Put()/Insert() into the
// declared datatype, if they are not SbxVARIANT.
-class SbxVarRefs;
+class SbxVarEntry;
class BASIC_DLLPUBLIC SbxArray : public SbxBase
{
+ typedef std::vector<SbxVarEntry*> VarEntriesType;
+
// #100883 Method to set method directly to parameter array
friend class SbMethod;
friend class SbClassModuleObject;
friend SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj );
BASIC_DLLPRIVATE void PutDirect( SbxVariable* pVar, sal_uInt32 nIdx );
- SbxVarRefs* pData; // The variables
+ VarEntriesType* pData; // The variables
protected:
SbxDataType eType; // Data type of the array