diff options
author | Noel Power <noel.power@suse.com> | 2012-12-14 15:50:55 +0000 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-12-14 15:50:55 +0000 |
commit | 8309553c5e9fb1b70c2c0827c9407f78c9ebf3ec (patch) | |
tree | 7255709cf25d3995819419fb82f8abaeacdf8b85 | |
parent | f851a46abac1460376d9030bf8525c509ed590ce (diff) |
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
-rw-r--r-- | basic/source/runtime/step0.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
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 ) { |