[ObjectHandler-cvs] ObjectHandler/ohxl functioncall.cpp,1.3,1.4
Brought to you by:
ericehlers,
nando
From: Eric E. <eri...@us...> - 2006-06-07 22:09:26
|
Update of /cvsroot/objecthandler/ObjectHandler/ohxl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8493/ohxl Modified Files: functioncall.cpp Log Message: prevent unhandled exceptions Index: functioncall.cpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/functioncall.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functioncall.cpp 1 Jun 2006 10:52:08 -0000 1.3 --- functioncall.cpp 6 Jun 2006 14:12:40 -0000 1.4 *************** *** 65,80 **** const std::string &FunctionCall::getAddressString() { ! if (address_.empty()) { ! XLOPER xAddress; ! try { ! Excel(xlfGetCell, &xAddress, 2, TempNum(1), getCallerReference()); ! operToScalar(address_, xAddress); ! Excel(xlFree, 0, 1, &xAddress); ! } catch (const std::exception &e) { ! Excel(xlFree, 0, 1, &xAddress); ! std::ostringstream err; ! err << "FunctionCall::getAddressString(): " << e.what(); ! throw Exception(err.str()); } } return address_; --- 65,86 ---- const std::string &FunctionCall::getAddressString() { ! // addins call this function from within their catch() ! // so this function must not throw ! try { ! if (address_.empty()) { ! XLOPER xAddress; ! try { ! Excel(xlfGetCell, &xAddress, 2, TempNum(1), getCallerReference()); ! operToScalar(address_, xAddress); ! Excel(xlFree, 0, 1, &xAddress); ! } catch (const std::exception &e) { ! Excel(xlFree, 0, 1, &xAddress); ! std::ostringstream err; ! err << "FunctionCall::getAddressString(): " << e.what(); ! throw Exception(err.str()); ! } } + } catch (...) { + address_ = "caller address unknown"; } return address_; |