Update of /cvsroot/objecthandler/ObjectHandler/ohxl
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20243/ohxl
Modified Files:
functioncall.cpp functioncall.hpp objecthandlerxl.cpp
Log Message:
only execute resetCaller() if XLL called from a cell formula
Index: objecthandlerxl.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** objecthandlerxl.cpp 17 Jul 2006 10:11:40 -0000 1.11
--- objecthandlerxl.cpp 17 Jul 2006 17:46:46 -0000 1.12
***************
*** 99,102 ****
--- 99,104 ----
void ObjectHandlerXL::resetCaller(bool createIfNone) {
+ if (FunctionCall::instance().getCallerType() != Cell)
+ return;
boost::shared_ptr<CallingRange> callingRange = getCallingRange();
if (!callingRange) {
Index: functioncall.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/functioncall.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** functioncall.hpp 14 Jun 2006 15:25:57 -0000 1.5
--- functioncall.hpp 17 Jul 2006 17:46:46 -0000 1.6
***************
*** 32,35 ****
--- 32,36 ----
enum CallerDimensions { Uninitialized, Row, Column, /* Matrix, Scalar */ };
+ enum CallerType { Uninitialized2, Cell, /* Menu, VBA, */ Unknown };
//! Singleton encapsulating state relating to Excel function call.
***************
*** 51,54 ****
--- 52,56 ----
//bool outerFunction();
CallerDimensions getCallerDimensions();
+ CallerType getCallerType();
bool IsCalledByFuncWiz();
private:
***************
*** 61,64 ****
--- 63,67 ----
std::string functionName_;
CallerDimensions callerDimensions_;
+ CallerType callerType_;
};
Index: functioncall.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/functioncall.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** functioncall.cpp 16 Jul 2006 17:11:19 -0000 1.8
--- functioncall.cpp 17 Jul 2006 17:46:46 -0000 1.9
***************
*** 29,33 ****
FunctionCall::FunctionCall(const std::string functionName)
! : functionName_(functionName), callerDimensions_(Uninitialized) {
if (instance_)
throw Exception("Multiple attempts to initialize global FunctionCall object");
--- 29,34 ----
FunctionCall::FunctionCall(const std::string functionName)
! : functionName_(functionName), callerDimensions_(Uninitialized),
! callerType_(Uninitialized2){
if (instance_)
throw Exception("Multiple attempts to initialize global FunctionCall object");
***************
*** 157,159 ****
--- 158,174 ----
}
+ CallerType FunctionCall::getCallerType() {
+ if (callerType_ == Uninitialized2) {
+ const XLOPER *xCaller = getCallerReference();
+ if (xCaller->xltype == xltypeRef || xCaller->xltype == xltypeSRef)
+ callerType_ = Cell;
+ //else if (xCaller->xltype == xltypeMulti)
+ // callerType_ = Menu;
+ //else if (xCaller->xltype == xltypeErr)
+ // callerType_ = VBA;
+ else
+ callerType_ = Unknown;
+ }
+ return callerType_;
+ }
}
|