[Libreoffice-commits] core.git: basic/source

Arnaud Versini arnaud.versini at gmail.com
Tue Apr 19 07:42:11 UTC 2016


 basic/source/sbx/sbxarray.cxx |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit a7e23e7f7b5489da2441adf5b8afbee507709821
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Mon Apr 18 20:18:51 2016 +0200

    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 at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx
index b6b80c2..d3b09ec 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 )


More information about the Libreoffice-commits mailing list