[Libreoffice-commits] .: Branch 'distro/suse/suse-3.6' - basic/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 14 07:57:06 PST 2012


 basic/source/runtime/step0.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 8309553c5e9fb1b70c2c0827c9407f78c9ebf3ec
Author: Noel Power <noel.power at suse.com>
Date:   Fri Dec 14 15:50:55 2012 +0000

    bnc#792048 - squash error accessing object ( for ole property )
    
    strange scenario where lhs property which is assigned to an object,
    in this case ( the property ) ADODB.Recordset.Source can assigned a
    String or ASODB.Command, however the Property will only return a string.
    This confuses the basic runtime. But... this happens in checkUnoStruct so
    really in this case the scenario is harmless, but.. we need to either
    squash the error ( or retain any previous error ) as appropriate
    
    Change-Id: I091877315a0c956b46fab8ff59feeb7e0572a169

diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 69c748b..607d5cb 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -345,8 +345,17 @@ inline void checkUnoStructCopy( SbxVariableRef& refVal, SbxVariableRef& refVar )
     // #115826: Exclude ProcedureProperties to avoid call to Property Get procedure
     if( refVar->ISA(SbProcedureProperty) )
         return;
-
+    SbxError eOldErr = refVar->GetError();
+    // There are some circumstances when calling GetObject
+    // will trigger an error, we need to squash those here.
+    // Alternatively it is possible that the same scenario
+    // could overwrite and existing error. Lets prevent that
     SbxObjectRef xVarObj = (SbxObject*)refVar->GetObject();
+    if ( eOldErr != SbxERR_OK )
+        refVar->SetError( eOldErr );
+    else
+        refVar->ResetError();
+
     SbxDataType eValType = refVal->GetType();
     if( eValType == SbxOBJECT && xVarObj == xValObj )
     {


More information about the Libreoffice-commits mailing list