diff options
author | Noel Power <noel.power@suse.com> | 2013-02-05 10:25:49 +0000 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-02-07 09:32:00 +0000 |
commit | 6644caf9048495ddb6174d7ec30daa7e20e2828e (patch) | |
tree | 4b92c92da7d57a7873320f6933d959660743f2f3 /basic/source | |
parent | d68310c185886c6755849640d568c4597456282e (diff) |
fix for fdo#60065
squash errors trying to gain object for rhs ( where no object yet exists (
Change-Id: I81548d1c6a32f0445dc18e31c84c3df85163ed45
Reviewed-on: https://gerrit.libreoffice.org/2003
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/runtime/step0.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 5e41425b1748..2388722acbe5 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -388,7 +388,17 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe if ( aAny.getValueType().getTypeClass() == TypeClass_STRUCT ) { refVar->SetType( SbxOBJECT ); + 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(); + SbUnoStructRefObject* pUnoStructObj = PTR_CAST(SbUnoStructRefObject,(SbxObject*)xVarObj); if ( ( !pUnoVal && !pUnoStructVal ) ) |