basic/source/sbx/sbxarray.cxx | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-)
New commits: commit 0fa6c88007f61176ac707cb5d77fd35cf1521123 Author: Arnaud Versini <arnaud.vers...@gmail.com> Date: Sun Apr 17 20:28:00 2016 +0200 BASIC : Simplify SbxArray Change-Id: I988fcfed2b03039cbc167eaee1d09bffe42cd411 Reviewed-on: https://gerrit.libreoffice.org/24171 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx index f78c376..b6b80c2 100644 --- a/basic/source/sbx/sbxarray.cxx +++ b/basic/source/sbx/sbxarray.cxx @@ -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 ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits