r14907 by jghali - #8949: Cannot open saved file: "is not in an acceptable format"
scribus-commit
scribus-commit at lists.scribus.net
Sat Mar 20 02:30:27 CET 2010
Revision: 14907
Author: jghali
Date: 2010-03-20T01:24:05.016832Z
Commit message: #8949: Cannot open saved file: "is not in an acceptable format"
Changeset:
M /branches/Version135/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
Diffs:
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp (revision 14906)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp (revision 14907)
@@ -122,10 +122,9 @@
}
// if (docBytes.left(16) == "<SCRIBUSUTF8NEW " && docBytes.left(35).contains("Version=\"1.3.4"))
// return true;
+ QRegExp regExp("Version=\"1.3.[4-9]");
int startElemPos = docBytes.left(512).indexOf("<SCRIBUSUTF8NEW ");
- return startElemPos >= 0 && ((docBytes.mid(startElemPos, 64).indexOf("Version=\"1.3.4") >= 0) ||
- (docBytes.mid(startElemPos, 64).indexOf("Version=\"1.3.5") >= 0) ||
- (docBytes.mid(startElemPos, 64).indexOf("Version=\"1.3.6") >= 0));
+ return startElemPos >= 0 && (regExp.indexIn(docBytes.mid(startElemPos, 64)) >= 0);
}
QString Scribus134Format::readSLA(const QString & fileName)
@@ -145,10 +144,9 @@
loadRawText(fileName, docBytes);
}
QString docText("");
+ QRegExp regExp("Version=\"1.3.[4-9]");
int startElemPos = docBytes.left(512).indexOf("<SCRIBUSUTF8NEW ");
- if (startElemPos >= 0 && ((docBytes.mid(startElemPos, 64).indexOf("Version=\"1.3.4") >= 0) ||
- (docBytes.mid(startElemPos, 64).indexOf("Version=\"1.3.5") >= 0) ||
- (docBytes.mid(startElemPos, 64).indexOf("Version=\"1.3.6") >= 0)))
+ if (startElemPos >= 0 && (regExp.indexIn(docBytes.mid(startElemPos, 64)) >= 0))
docText = QString::fromUtf8(docBytes);
else
return QString::null;
More information about the scribus-commit
mailing list