summaryrefslogtreecommitdiff
path: root/basic/source
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-02-05 10:25:49 +0000
committerNoel Power <noel.power@suse.com>2013-02-05 10:36:05 +0000
commit6d0f1f66392515a0789f15c90a430b7047ca1f04 (patch)
tree6db210cf8418b1a77d7a4a9744e47a407db30678 /basic/source
parent1385896fe760fe61b19a682cb7dc7fdf31d31490 (diff)
fix for fdo#60065
squash errors trying to gain object for rhs ( where no object yet exists ( Change-Id: I81548d1c6a32f0445dc18e31c84c3df85163ed45
Diffstat (limited to 'basic/source')
-rw-r--r--basic/source/runtime/step0.cxx10
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 ) )