Update of /cvsroot/objecthandler/ObjectHandler/ohxl
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16552/ohxl
Modified Files:
callingrange.cpp callingrange.hpp functioncall.cpp
functioncall.hpp objecthandlerxl.cpp objecthandlerxl.hpp
Log Message:
separate error message for each iteration in a loop function
Index: objecthandlerxl.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** objecthandlerxl.cpp 31 Aug 2006 11:00:47 -0000 1.15
--- objecthandlerxl.cpp 18 Sep 2006 11:20:37 -0000 1.16
***************
*** 157,164 ****
if (objectIDCount_ == ULONG_MAX) {
std::ostringstream msg;
! msg << "ObjectHandler has exceeded the maximum limit of " << ULONG_MAX
! << " names that can be automatically generated for 'anonymous objects'"
! << " (objects where the user has supplied an empty string as an ID)."
! << " Please invoke ohDeleteAllObjects(TRUE) or restart the application.";
throw Exception(msg.str());
}
--- 157,164 ----
if (objectIDCount_ == ULONG_MAX) {
std::ostringstream msg;
! msg << "ObjectHandler has exceeded the maximum limit of " << ULONG_MAX <<
! " names that can be automatically generated for 'anonymous objects'"
! " (objects where the user has supplied an empty string as an ID)."
! " Please invoke ohDeleteAllObjects(TRUE) or restart the application.";
throw Exception(msg.str());
}
***************
*** 212,220 ****
}
! void ObjectHandlerXL::logError(const std::string& message) {
logMessage(message, 2);
if (FunctionCall::instance().getCallerType() == Cell) {
boost::shared_ptr<CallingRange> callingRange = getCallingRange(true);
! callingRange->setErrorMessage(message);
}
}
--- 212,220 ----
}
! void ObjectHandlerXL::logError(const std::string& message, const bool &append) {
logMessage(message, 2);
if (FunctionCall::instance().getCallerType() == Cell) {
boost::shared_ptr<CallingRange> callingRange = getCallingRange(true);
! callingRange->setErrorMessage(message, append);
}
}
***************
*** 229,231 ****
--- 229,236 ----
}
+ void ObjectHandlerXL::clearError() {
+ boost::shared_ptr<CallingRange> callingRange = getCallingRange();
+ if (callingRange) callingRange->clearError();
+ }
+
}
Index: objecthandlerxl.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.hpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** objecthandlerxl.hpp 31 Aug 2006 11:00:47 -0000 1.12
--- objecthandlerxl.hpp 18 Sep 2006 11:20:37 -0000 1.13
***************
*** 69,74 ****
virtual void dump(std::ostream&);
! void logError(const std::string&);
std::string retrieveError(const std::string&);
private:
boost::shared_ptr<CallingRange> getCallingRange(bool createIfNone = false);
--- 69,75 ----
virtual void dump(std::ostream&);
! void logError(const std::string &message, const bool &append = false);
std::string retrieveError(const std::string&);
+ void clearError();
private:
boost::shared_ptr<CallingRange> getCallingRange(bool createIfNone = false);
Index: callingrange.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** callingrange.hpp 31 Aug 2006 11:00:47 -0000 1.7
--- callingrange.hpp 18 Sep 2006 11:20:37 -0000 1.8
***************
*** 46,57 ****
friend std::ostream &operator<<(std::ostream&, const CallingRange&);
bool empty() {
! return (residentObjects_.size() == 0);
! }
! void setErrorMessage(const std::string &errorMessage) {
! errorMessage_ = errorMessage;
}
const std::string errorMessage() const {
return errorMessage_;
}
std::string getAddressString() const;
private:
--- 46,58 ----
friend std::ostream &operator<<(std::ostream&, const CallingRange&);
bool empty() {
! return (residentObjects_.empty());
}
+ void setErrorMessage(const std::string &errorMessage, const bool &append);
const std::string errorMessage() const {
return errorMessage_;
}
+ void clearError() {
+ errorMessage_ = "";
+ }
std::string getAddressString() const;
private:
Index: functioncall.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/functioncall.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** functioncall.cpp 17 Jul 2006 17:46:46 -0000 1.9
--- functioncall.cpp 18 Sep 2006 11:20:37 -0000 1.10
***************
*** 88,91 ****
--- 88,95 ----
}
+ const std::string &FunctionCall::getFunctionName() {
+ return functionName_;
+ }
+
const std::string &FunctionCall::getFormula() {
if (formula_.empty()) {
Index: callingrange.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** callingrange.cpp 31 Aug 2006 11:00:47 -0000 1.8
--- callingrange.cpp 18 Sep 2006 11:20:37 -0000 1.9
***************
*** 165,168 ****
--- 165,178 ----
}
+ void CallingRange::setErrorMessage(const std::string &errorMessage, const bool &append) {
+ if (append) {
+ std::ostringstream err;
+ err << errorMessage_ << std::endl << std::endl << errorMessage;
+ errorMessage_ = err.str();
+ } else {
+ errorMessage_ = errorMessage;
+ }
+ }
+
// FIXME use boost::regex here
void CallingRange::setInvocationCount() {
Index: functioncall.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/functioncall.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** functioncall.hpp 17 Jul 2006 17:46:46 -0000 1.6
--- functioncall.hpp 18 Sep 2006 11:20:37 -0000 1.7
***************
*** 49,52 ****
--- 49,53 ----
const XLOPER *getCallerArray();
const std::string &getAddressString();
+ const std::string &getFunctionName();
const std::string &getFormula();
//bool outerFunction();
|