diff options
Diffstat (limited to 'external')
-rw-r--r-- | external/libwps/UnpackedTarball_libwps.mk | 1 | ||||
-rw-r--r-- | external/libwps/libwps-lotus-version-tdf127887.patch.1 | 44 |
2 files changed, 45 insertions, 0 deletions
diff --git a/external/libwps/UnpackedTarball_libwps.mk b/external/libwps/UnpackedTarball_libwps.mk index f53a8fffc429..d0855de0ef99 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; + } |