X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fmathml_editor%2Fsrc%2FTPushParser.cc;h=325b9aa3c129f9a9bd31500aeec01ed6850184f1;hb=7bea7bddf7ca13260f4d3965182dc4fb58d035e7;hp=d3dd893d73c494ad8b6648fd4ae74242b557349f;hpb=bf29ef82dc843dcb1929b413b36801ac26441fbd;p=helm.git diff --git a/helm/DEVEL/mathml_editor/src/TPushParser.cc b/helm/DEVEL/mathml_editor/src/TPushParser.cc index d3dd893d7..325b9aa3c 100644 --- a/helm/DEVEL/mathml_editor/src/TPushParser.cc +++ b/helm/DEVEL/mathml_editor/src/TPushParser.cc @@ -1,13 +1,14 @@ +#include "ALogger.hh" #include "TPushParser.hh" -#include "TListener.hh" +#include "AMathMLFactory.hh" -TPushParser::TPushParser(const TDictionary& d) : dictionary(d), listener(0) +TPushParser::TPushParser(ALogger& l, const TDictionary& d) : APushParser(l), dictionary(d) { init(); } -TPushParser::TPushParser(const TDictionary& d, TListener& l) : dictionary(d), listener(&l) +TPushParser::TPushParser(ALogger& l, AMathMLFactory& f, const TDictionary& d) : APushParser(l, f), dictionary(d) { init(); } @@ -1178,7 +1179,7 @@ TPushParser::push(const TToken& token) cout << "ignored token" << endl; } - if (listener) listener->callback(doc); //it shoul be repristened if you remove the comment in the else above + //if (listener) listener->callback(doc); //it shoul be repristened if you remove the comment in the else above } // this end corresponds to the if ((doc.root().first() && doc.root().first().is("math")) || token.category == TToken::SHIFT) else @@ -1188,8 +1189,7 @@ TPushParser::push(const TToken& token) cout << "push: ignored token...you have to enter in math mode...insert $" << endl; } - - //if (listener) listener->callback(doc); + if (factory) factory->documentModified(doc); if (frames.empty()) cout << "stack vuoto" << endl; else cout << "stack non vuoto" << endl; @@ -1231,8 +1231,8 @@ TPushParser::advance(const TNode& node) } void -TPushParser::setCursor(const std::string& c) +TPushParser::setCursorHint(const std::string& c) { cursor["val"] = c; - if (listener) listener->callback(doc); + if (factory) factory->documentModified(doc); }