From: jerome l. <jle...@us...> - 2003-03-08 22:16:30
|
Update of /cvsroot/xlw/xlw/xlw In directory sc8-pr-cvs1:/tmp/cvs-serv21409 Modified Files: XlfFuncDesc.cpp XlfFuncDesc.h Log Message: Added recalcPolicy to let user register function as volatile (unconditionally recalculated). Note that default is still not volatile Index: XlfFuncDesc.cpp =================================================================== RCS file: /cvsroot/xlw/xlw/xlw/XlfFuncDesc.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** XlfFuncDesc.cpp 14 May 2002 02:29:03 -0000 1.4 --- XlfFuncDesc.cpp 8 Mar 2003 22:16:27 -0000 1.5 *************** *** 36,40 **** { //! Ctor. ! XlfFuncDescImpl(const std::string& category): category_(category) {} //! Category where the function is displayed in the function wizzard. std::string category_; --- 36,44 ---- { //! Ctor. ! XlfFuncDescImpl(XlfFuncDesc::RecalcPolicy recalcPolicy, ! const std::string& category): recalcPolicy_(recalcPolicy), category_(category) ! {} ! //! Recalculation policy ! XlfFuncDesc::RecalcPolicy recalcPolicy_; //! Category where the function is displayed in the function wizzard. std::string category_; *************** *** 48,58 **** \param comment The first 3 argument are directly passed to XlfAbstractCmdDesc::XlfAbstractCmdDesc. ! \param category Category in which the function should appear in Excel function wizard. */ ! XlfFuncDesc::XlfFuncDesc(const std::string& name, const std::string& alias, const std::string& comment, const std::string& category) :XlfAbstractCmdDesc(name, alias, comment), impl_(0) { ! impl_ = new XlfFuncDescImpl(category); } --- 52,65 ---- \param comment The first 3 argument are directly passed to XlfAbstractCmdDesc::XlfAbstractCmdDesc. ! \param category Category in which the function should appear. ! \param recalcPolicy Policy to recalculate the cell. in Excel function wizard. */ ! XlfFuncDesc::XlfFuncDesc(const std::string& name, const std::string& alias, ! const std::string& comment, const std::string& category, ! RecalcPolicy recalcPolicy) :XlfAbstractCmdDesc(name, alias, comment), impl_(0) { ! impl_ = new XlfFuncDescImpl(recalcPolicy,category); } *************** *** 93,97 **** argnames+=", "; } ! args[nbargs + 1] = 0; LPXLOPER *rgx = new LPXLOPER[10 + nbargs]; LPXLOPER *px = rgx; --- 100,110 ---- argnames+=", "; } ! if (impl_->recalcPolicy_ == XlfFuncDesc::Volatile) ! { ! args+="!"; ! args[nbargs + 2] = 0; ! } ! else ! args[nbargs + 1] = 0; LPXLOPER *rgx = new LPXLOPER[10 + nbargs]; LPXLOPER *px = rgx; Index: XlfFuncDesc.h =================================================================== RCS file: /cvsroot/xlw/xlw/xlw/XlfFuncDesc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** XlfFuncDesc.h 12 Mar 2002 09:15:30 -0000 1.3 --- XlfFuncDesc.h 8 Mar 2003 22:16:27 -0000 1.4 *************** *** 40,46 **** { public: //! Ctor XlfFuncDesc(const std::string& name, const std::string& alias, ! const std::string& comment, const std::string& category); //! Dtor. ~XlfFuncDesc(); --- 40,50 ---- { public: + //! Policy to reclalculate cells + enum RecalcPolicy { NotVolatile, Volatile } ; + //! Ctor XlfFuncDesc(const std::string& name, const std::string& alias, ! const std::string& comment, const std::string& category, ! RecalcPolicy recalcPolicy = NotVolatile); //! Dtor. ~XlfFuncDesc(); |