summarylogtreecommitdiffstats
path: root/skip_epub_version_check.patch
diff options
context:
space:
mode:
Diffstat (limited to 'skip_epub_version_check.patch')
-rw-r--r--skip_epub_version_check.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/skip_epub_version_check.patch b/skip_epub_version_check.patch
new file mode 100644
index 000000000000..b00f876b0952
--- /dev/null
+++ b/skip_epub_version_check.patch
@@ -0,0 +1,27 @@
+Subject: [PATCH] skip epub version check
+Description: allows changing from epub2 to epub3 by directly editing the opf
+ some data is lost and needs to be recreated (eg, table of contents)
+
+--- sigil.old/src/ResourceObjects/OPFResource.cpp
++++ sigil.new/src/ResourceObjects/OPFResource.cpp
+@@ -1310,20 +1310,6 @@
+ QString OPFResource::ValidatePackageVersion(const QString& source)
+ {
+ QString newsource = source;
+- QString orig_version = GetEpubVersion();
+- QRegularExpression pkgversion_search(PKG_VERSION, QRegularExpression::CaseInsensitiveOption);
+- QRegularExpressionMatch mo = pkgversion_search.match(newsource);
+- if (mo.hasMatch()) {
+- QString version = mo.captured(1);
+- if (version != orig_version) {
+- newsource.replace(mo.capturedStart(1), mo.capturedLength(1), orig_version);
+- if (!m_WarnedAboutVersion && !version.startsWith('1')) {
+- Utility::DisplayStdWarningDialog("Changing package version inside Sigil is not supported",
+- "Use an appropriate output plugin to make the initial conversion");
+- m_WarnedAboutVersion = true;
+- }
+- }
+- }
+ return newsource;
+ }
+