Ronen Abravanel wrote: > Pavel -- Thanks. I removed big portion of the code that was not needed.
good news > I can refactor both XYMatrix and Diagram class to have one common base > class, but it will take me a while. How urgent things should be ready for > 2.0? personally i would prefer not to touch XYMatrix ;) (basically because i dont know all its features and can't test whether we killed something...) so my proposal was rather that Diagram would be child of XYMatrix, althought i understand the philosophical point behind common virtual class. so in case other devs are not against, i would choose the simpler route... but as i have written before the class is so small that i would accept even the current version if the inheritance bussiness makes things complicated ;) > +def revert_diagram(document): > + i = 0 > + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) > + while True: > + i = find_token(document.body, '\\begin_inset Formula', i) > + if i == -1: > + print "returning" debug output is not needed > + return > + j = find_end_of_inset(document.body, i) > + if j == -1: > + print "Melformed document!" typo > + return > + m = re_diagram.search("\n".join(document.body[i:j])) i'm surprised about this newline, but you are right its there. strange. i still think the postscript output will be the same but who knows... > + * \file InsetMathDiagram.h > + * This file is part of LyX, the document processor. > + * Licence details can be found in the file COPYING. > + * > + * \author André Pönitz > +* \author Ronen Abravanel whitespace pavel