2 #include <qtextstream.h>
3 #include <qmessagebox.h>
8 /////////////////////////////////////////////////////////////////
10 /////////////////////////////////////////////////////////////////
17 void NoteObj::copy (NoteObj other)
20 fonthint=other.fonthint;
31 void NoteObj::setNote (const QString &s)
36 QString NoteObj::getNote()
41 void NoteObj::setFontHint (const QString &s)
43 // only for backward compatibility (pre 1.5 )
47 QString NoteObj::getFontHint()
49 // only for backward compatibility (pre 1.5 )
53 void NoteObj::setFilenameHint (const QString &s)
58 QString NoteObj::getFilenameHint()
63 bool NoteObj::isEmpty ()
65 return note.isEmpty();
68 QString NoteObj::saveToDir ()
70 // QTextEdit may generate fontnames with unquoted &, like
71 // in "Lucida B&H". This is invalid in XML and thus would crash
77 while (pos<note.length())
79 if (note.mid(pos,1)=="<") inbracket=true;
80 if (note.mid(pos,1)==">") inbracket=false;
81 if (note.mid(pos,1)=="\"" && inbracket)
88 if (note.mid(pos,1)=="&" && inquot)
90 // Now we are inside < " " >
93 while (note.mid(pos2,1)!=";" && note.mid(pos2,1)!="\"")
95 if (note.mid(pos2,1)=="\"")
97 note.replace(pos,1,"&");
103 return beginElement ("htmlnote",attribut("fonthint",fonthint)) + "\n"+ note+ "\n" +endElement ("htmlnote");