diff -r 16ff14c745cc -r 02f683ded030 noteobj.cpp --- a/noteobj.cpp Tue May 20 12:53:49 2008 +0000 +++ b/noteobj.cpp Tue Jun 03 08:33:03 2008 +0000 @@ -165,6 +165,13 @@ QString NoteObj::saveToDir () { + QString n=note; + + // Remove the doctype, which will confuse parsing + // with XmlReader in Qt >= 4.4 + QRegExp rx(""); + n.replace (rx,""); + // QTextEdit may generate fontnames with unquoted &, like // in "Lucida B&H". This is invalid in XML and thus would crash // the XML parser @@ -175,7 +182,6 @@ bool inbracket=false; int begin_bracket=0; bool inquot=false; - QString n=note; while (pos1) { - QRegExp rx("style=\\s*\"(.*)\"\\s*style=\\s*\"(.*)\""); + rx.setPattern("style=\\s*\"(.*)\"\\s*style=\\s*\"(.*)\""); rx.setMinimal (true); s.replace(rx,"style=\"\\1 \\2\""); n.replace (begin_bracket,sl,s); @@ -212,6 +218,8 @@ } pos++; } + + return beginElement ("htmlnote",attribut("fonthint",fonthint)) + "\n"+ n+ "\n" +endElement ("htmlnote"); }