From 8309553c5e9fb1b70c2c0827c9407f78c9ebf3ec Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 14 Dec 2012 15:50:55 +0000 Subject: 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 --- basic/source/runtime/step0.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 69c748bf6042..607d5cbcfbe7 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 ) { -- cgit v1.2.3