# HG changeset patch
# User insilmaril
# Date 1212481983 0
# Node ID 02f683ded0308dad1b4ebd98e6b5e803ab4b3657
# Parent  16ff14c745cc8cd6a5ee0b48816753b264292902
Workaround for unreadable file with Qt 4.4

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("<!DOCTYPE.*>");
+	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 (pos<n.length())
 	{
 		if (n.mid(pos,1)=="<") 
@@ -190,7 +196,7 @@
 			int sl=s.length();
 			if (s.count("style=\"")>1)
 			{
-				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");
 }
 
diff -r 16ff14c745cc -r 02f683ded030 version.h
--- a/version.h	Tue May 20 12:53:49 2008 +0000
+++ b/version.h	Tue Jun 03 08:33:03 2008 +0000
@@ -7,7 +7,7 @@
 #define __VYM_VERSION "1.12.0"
 #define __VYM_CODENAME "Codename: RC-2"
 //#define __VYM_CODENAME "Codename: development version"
-#define __VYM_BUILD_DATE "2008-05-14"
+#define __VYM_BUILD_DATE "2008-06-02"
 
 
 bool checkVersion(const QString &);