summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@gmail.com>2016-04-18 20:18:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-04-19 07:41:48 +0000
commita7e23e7f7b5489da2441adf5b8afbee507709821 (patch)
tree58c972f664fb4b3a20bdde2d214b48b82cabbfba /basic
parent75dcd65a8630c531d3b240b139749faa2e190d9c (diff)
BASIC : Partially revert SbxArray simplification.
Revert partially commit 0fa6c88007f61176ac707cb5d77fd35cf1521123 (BASIC : Simplify SbxArray) to make sure SbxArray::Put add too much objects behind 65k limit. Change-Id: I2d86f213711665f8cb522879ff78ff5bc9f42b31 Reviewed-on: https://gerrit.libreoffice.org/24223 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/sbx/sbxarray.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx
index b6b80c28c55d..d3b09ecccc9b 100644
--- a/basic/source/sbx/sbxarray.cxx
+++ b/basic/source/sbx/sbxarray.cxx
@@ -198,7 +198,22 @@ void SbxArray::Put32( SbxVariable* pVar, sal_uInt32 nIdx )
void SbxArray::Put( SbxVariable* pVar, sal_uInt16 nIdx )
{
- Put32(pVar, 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 );
+ }
+ }
}
OUString SbxArray::GetAlias( sal_uInt16 nIdx )