[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - external/libwps
Eike Rathke (via logerrit)
logerrit at kemper.freedesktop.org
Fri Oct 4 09:02:11 UTC 2019
external/libwps/UnpackedTarball_libwps.mk | 1
external/libwps/libwps-lotus-version-tdf127887.patch.1 | 44 +++++++++++++++++
2 files changed, 45 insertions(+)
New commits:
commit ce15460e7b7a5e4930574f88660d03ed3d11fbfe
Author: Eike Rathke <erack at redhat.com>
AuthorDate: Tue Oct 1 17:58:35 2019 +0200
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Fri Oct 4 11:01:32 2019 +0200
Resolves: tdf#127887 Fix libwps wrong Lotus version detection
Also return the proper kind and creator values set in
WKS4Parser::checkHeader() to callers of
WPSDocument::isFileFormatSupported()
Change-Id: I3adfde0e18669b80956a9b577080fe8388dd3b1f
Reviewed-on: https://gerrit.libreoffice.org/79981
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Jenkins
(cherry picked from commit 5a7d4ee6c4dd92758e0fd213671251e96d6e7f08)
Reviewed-on: https://gerrit.libreoffice.org/80015
Tested-by: Xisco FaulĂ <xiscofauli at libreoffice.org>
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/external/libwps/UnpackedTarball_libwps.mk b/external/libwps/UnpackedTarball_libwps.mk
index a383a2d12377..22186c9aed52 100644
--- a/external/libwps/UnpackedTarball_libwps.mk
+++ b/external/libwps/UnpackedTarball_libwps.mk
@@ -24,6 +24,7 @@ ifneq ($(OS),MACOSX)
ifneq ($(OS),WNT)
$(eval $(call gb_UnpackedTarball_add_patches,libwps,\
external/libwps/libwps-bundled-soname.patch.0 \
+ external/libwps/libwps-lotus-version-tdf127887.patch.1 \
))
endif
endif
diff --git a/external/libwps/libwps-lotus-version-tdf127887.patch.1 b/external/libwps/libwps-lotus-version-tdf127887.patch.1
new file mode 100644
index 000000000000..3427ef1f0813
--- /dev/null
+++ b/external/libwps/libwps-lotus-version-tdf127887.patch.1
@@ -0,0 +1,44 @@
+diff -ur libwps.org/src/lib/WKS4.cpp libwps/src/lib/WKS4.cpp
+--- libwps.org/src/lib/WKS4.cpp 2018-08-06 10:51:12.000000000 +0200
++++ libwps/src/lib/WKS4.cpp 2019-10-01 17:28:59.497500545 +0200
+@@ -477,7 +477,7 @@
+ }
+ else if (val==0x406)
+ {
+- m_state->m_version=1;
++ m_state->m_version=2;
+ f << "lotus,";
+ creatorId=libwps::WPS_LOTUS;
+ }
+@@ -830,14 +830,15 @@
+ isParsed = true;
+ break;
+ case 0x2f: // iteration count: only in dos file Wk1, Wks(dos), Wq[12] ?
++ // Maybe, but that does not mean it would not be used
++ // in Lotus version 2 files (that are also .WK1), so do
++ // not reset an already detected version here.
+ if (sz!=1) break;
+ input->seek(pos+4, librevenge::RVNG_SEEK_SET);
+ f.str("");
+ val=int(libwps::readU8(input));
+ f << "Entries(ItCount):dos";
+ if (val!=1) f << "=" << val << ",";
+- if (m_state->m_version==2)
+- m_state->m_version=1;
+ isParsed = needWriteInAscii = true;
+ break;
+ case 0x41: // graph record name
+diff -ur libwps.org/src/lib/WPSDocument.cpp libwps/src/lib/WPSDocument.cpp
+--- libwps.org/src/lib/WPSDocument.cpp 2018-08-02 12:12:26.000000000 +0200
++++ libwps/src/lib/WPSDocument.cpp 2019-10-01 16:00:41.172596186 +0200
+@@ -155,6 +155,10 @@
+ WKS4Parser parser(header->getInput(), header);
+ if (!parser.checkHeader(header.get(), true))
+ return WPS_CONFIDENCE_NONE;
++ // checkHeader() may set new kind and creator values,
++ // pass them up to caller.
++ kind = header->getKind();
++ creator = header->getCreator();
+ needEncoding=header->getNeedEncoding();
+ return header->getIsEncrypted() ? WPS_CONFIDENCE_SUPPORTED_ENCRYPTION : WPS_CONFIDENCE_EXCELLENT;
+ }
More information about the Libreoffice-commits
mailing list