r14908 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:47 CET 2010
Revision: 14908
Author: jghali
Date: 2010-03-20T01:24:46.565017Z
Commit message: #8949: Cannot open saved file: "is not in an acceptable format"
Changeset:
M /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
Diffs:
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp (revision 14907)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp (revision 14908)
@@ -124,10 +124,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)
@@ -147,10 +146,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