From 863e269cd3d37034e634d9ad730d8e87a46ceb76 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 5 Dec 2017 17:26:35 +0100 Subject: Resolves: tdf#114232 reset error after unsuccessful GetObject() query Probably broken already since commit 0b21b8b146fc4b982c7c9bbb866b9ff18a29332a Date: Wed Oct 6 10:16:27 2010 +0100 initial commit for vba blob ( not including container_control stuff ) Change-Id: Iecce564851a76921b491ff101365c70883ad7475 --- basic/source/runtime/methods.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index e91893d76d50..161fa4887d48 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2461,10 +2461,18 @@ void SbRtl_IsError(StarBASIC *, SbxArray & rPar, bool) SbUnoObject* pObj = dynamic_cast( pVar ); if ( !pObj ) { + // GetObject() sets error if the variable was not an object, so + // remember and reset if it isn't. + ErrCode eOld = SbxBase::GetError(); if ( SbxBase* pBaseObj = pVar->GetObject() ) { pObj = dynamic_cast( pBaseObj ); } + else + { + SbxBase::ResetError(); + SbxBase::SetError( eOld ); + } } uno::Reference< script::XErrorQuery > xError; if ( pObj ) -- cgit