Kaydet (Commit) 0fa6c880 authored tarafından Arnaud Versini's avatar Arnaud Versini Kaydeden (comit) Noel Grandin

BASIC : Simplify SbxArray

Change-Id: I988fcfed2b03039cbc167eaee1d09bffe42cd411
Reviewed-on: https://gerrit.libreoffice.org/24171Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst e781dfe8
......@@ -124,7 +124,7 @@ SbxVariableRef& SbxArray::GetRef32( sal_uInt32 nIdx )
}
while( mpVarEntries->size() <= nIdx )
{
mpVarEntries->push_back(SbxVarEntry());
mpVarEntries->emplace_back();
}
return (*mpVarEntries)[nIdx].mpVar;
}
......@@ -141,7 +141,7 @@ SbxVariableRef& SbxArray::GetRef( sal_uInt16 nIdx )
}
while( mpVarEntries->size() <= nIdx )
{
mpVarEntries->push_back(SbxVarEntry());
mpVarEntries->emplace_back();
}
return (*mpVarEntries)[nIdx].mpVar;
}
......@@ -198,22 +198,7 @@ void SbxArray::Put32( SbxVariable* pVar, sal_uInt32 nIdx )
void SbxArray::Put( SbxVariable* pVar, sal_uInt16 nIdx )
{
if( !CanWrite() )
SetError( ERRCODE_SBX_PROP_READONLY );
else
{
if( pVar )
if( eType != SbxVARIANT )
// Convert no objects
if( eType != SbxOBJECT || pVar->GetClass() != SbxCLASS_OBJECT )
pVar->Convert( eType );
SbxVariableRef& rRef = GetRef( nIdx );
if( static_cast<SbxVariable*>(rRef) != pVar )
{
rRef = pVar;
SetFlag( SbxFlagBits::Modified );
}
}
Put32(pVar, nIdx);
}
OUString SbxArray::GetAlias( sal_uInt16 nIdx )
......@@ -294,11 +279,7 @@ void SbxArray::Remove32( sal_uInt32 nIdx )
void SbxArray::Remove( sal_uInt16 nIdx )
{
if( nIdx < mpVarEntries->size() )
{
mpVarEntries->erase( mpVarEntries->begin() + nIdx );
SetFlag( SbxFlagBits::Modified );
}
Remove32(nIdx);
}
void SbxArray::Remove( SbxVariable* pVar )
......
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