summaryrefslogtreecommitdiff
path: root/external/libwps
diff options
context:
space:
mode:
Diffstat (limited to 'external/libwps')
-rw-r--r--external/libwps/0001-Make-comparison-operator-member-functions-const.patch49
-rw-r--r--external/libwps/Library_wps.mk1
-rw-r--r--external/libwps/UnpackedTarball_libwps.mk4
-rw-r--r--external/libwps/libwps-lotus-version-tdf127887-upstream.patch111
4 files changed, 1 insertions, 164 deletions
diff --git a/external/libwps/0001-Make-comparison-operator-member-functions-const.patch b/external/libwps/0001-Make-comparison-operator-member-functions-const.patch
deleted file mode 100644
index c7bfb1e40aa2..000000000000
--- a/external/libwps/0001-Make-comparison-operator-member-functions-const.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 555b3e0c18ba16843541867d036da782ecdcdeb1 Mon Sep 17 00:00:00 2001
-From: Stephan Bergmann <sbergman@redhat.com>
-Date: Mon, 21 Oct 2019 16:19:13 +0200
-Subject: [PATCH] Make comparison operator member functions const
-
-...which avoids overload resolution ambiguities in C++20, when a synthesized
-candidate of operator == for a reversed-argument rewrite conflicts with the
-actual operator ==, due to the asymmetric const-ness of the implicit object
-parameter and the RHS parameter. (As observed with recent Clang 10 trunk with
--std=c++2a when building libwps as part of LibreOffice:
-
-> QuattroDosChart.cpp:399:18: error: use of overloaded operator '!=' is ambiguous (with operand types 'WKSChart::Position' and 'WKSChart::Position')
-> if (ranges[0]!=ranges[1])
-> ~~~~~~~~~^ ~~~~~~~~~
-> ./WKSChart.h:78:8: note: candidate function
-> bool operator!=(Position &pos) const
-> ^
-> ./WKSChart.h:73:8: note: candidate function
-> bool operator==(Position &pos) const
-> ^
-> ./WKSChart.h:73:8: note: candidate function (with reversed parameter order)
-
-)
----
- src/lib/WKSChart.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/lib/WKSChart.h b/src/lib/WKSChart.h
-index 268fa4a..e490357 100644
---- a/src/lib/WKSChart.h
-+++ b/src/lib/WKSChart.h
-@@ -70,12 +70,12 @@ public:
- //! operator<<
- friend std::ostream &operator<<(std::ostream &o, Position const &pos);
- //! operator==
-- bool operator==(Position &pos) const
-+ bool operator==(Position const &pos) const
- {
- return m_pos==pos.m_pos && m_sheetName==pos.m_sheetName;
- }
- //! operator!=
-- bool operator!=(Position &pos) const
-+ bool operator!=(Position const &pos) const
- {
- return !(operator==(pos));
- }
---
-2.21.0
-
diff --git a/external/libwps/Library_wps.mk b/external/libwps/Library_wps.mk
index 500a9ab196b2..349bdbe83c43 100644
--- a/external/libwps/Library_wps.mk
+++ b/external/libwps/Library_wps.mk
@@ -93,6 +93,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,wps,\
UnpackedTarball/libwps/src/lib/WPSTable \
UnpackedTarball/libwps/src/lib/WPSTextParser \
UnpackedTarball/libwps/src/lib/WPSTextSubDocument \
+ UnpackedTarball/libwps/src/lib/XYWrite \
UnpackedTarball/libwps/src/lib/libwps_internal \
UnpackedTarball/libwps/src/lib/libwps_tools_win \
))
diff --git a/external/libwps/UnpackedTarball_libwps.mk b/external/libwps/UnpackedTarball_libwps.mk
index 4fd566755170..f53a8fffc429 100644
--- a/external/libwps/UnpackedTarball_libwps.mk
+++ b/external/libwps/UnpackedTarball_libwps.mk
@@ -15,13 +15,9 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libwps,1))
$(eval $(call gb_UnpackedTarball_update_autoconf_configs,libwps))
-# * external/libwps/0001-Make-comparison-operator-member-functions-const.patch is upstream at
-# <https://sourceforge.net/p/libwps/patches/6/> "Make comparison operator member functions const":
$(eval $(call gb_UnpackedTarball_add_patches,libwps,\
$(if $(SYSTEM_REVENGE),,external/libwps/rpath.patch.0) \
external/libwps/libtool.patch.0 \
- external/libwps/0001-Make-comparison-operator-member-functions-const.patch \
- external/libwps/libwps-lotus-version-tdf127887-upstream.patch \
))
ifneq ($(OS),MACOSX)
diff --git a/external/libwps/libwps-lotus-version-tdf127887-upstream.patch b/external/libwps/libwps-lotus-version-tdf127887-upstream.patch
deleted file mode 100644
index 012a8a00e991..000000000000
--- a/external/libwps/libwps-lotus-version-tdf127887-upstream.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-This is a combination of upstream patches.
-
-commit d74790b4bd55a3a11b56dbbd670c3baa1331e6dd
-CommitDate: Thu Oct 31 11:26:08 2019 +0100
-
- lotus[wb1]: try to correct the retrieving of row references in formula...
-
-
-commit 39be60f9045a758178d90526ae66b0e3d24f348e
-CommitDate: Thu Oct 31 13:28:54 2019 +0100
-
- wks,wk1,...: try to read correctly the row cell's references...
-
-
-commit 188933f0d66c77a19ccb0b5f5151a4c9f7203fbc
-CommitDate: Thu Oct 31 14:30:26 2019 +0100
-
- wks,wk1: do not change the maximum number of columns...
-
-
-commit c1ba33b7505cff91f57d5aa7e8c6ff8706b63a21
-CommitDate: Thu Oct 31 15:09:19 2019 +0100
-
- WKS4Spreadsheet.cpp: simplify the code...
-
-
-diff --git a/src/lib/WKS4.cpp b/src/lib/WKS4.cpp
-index 2f222d3..a92eace 100644
---- a/src/lib/WKS4.cpp
-+++ b/src/lib/WKS4.cpp
-@@ -836,7 +836,7 @@ bool WKS4Parser::readZone()
- val=int(libwps::readU8(input));
- f << "Entries(ItCount):dos";
- if (val!=1) f << "=" << val << ",";
-- if (m_state->m_version==2)
-+ else if (m_state->m_version==2)
- m_state->m_version=1;
- isParsed = needWriteInAscii = true;
- break;
-diff --git a/src/lib/WKS4Spreadsheet.cpp b/src/lib/WKS4Spreadsheet.cpp
-index caaf4e1..582f377 100644
---- a/src/lib/WKS4Spreadsheet.cpp
-+++ b/src/lib/WKS4Spreadsheet.cpp
-@@ -1798,10 +1798,14 @@ bool WKS4Spreadsheet::readCell
- for (int dim = 0; dim < 2; dim++)
- {
- auto val = int(libwps::readU16(m_input));
-- if ((val & 0xF000) == 0); // absolue value ?
-- else if ((val & 0xc000) == 0x8000) // relative ?
-+ if ((val & 0x8000) == 0); // absolue value ?
-+ else
- {
-- if (version()==1)
-+ // relative
-+ // wb1: maximum row=0x2000, maximum col=0x100
-+ // wks dos (v3) maximum row=0x4000, maximum col=0x100
-+ // wdb maximum number of data ?
-+ if (version()==1 && dim==0)
- {
- val &= 0xFF;
- if ((val & 0x80) && val+actPos[dim] >= 0x100)
-@@ -1810,27 +1814,17 @@ bool WKS4Spreadsheet::readCell
- }
- else
- {
-- val &= 0x3FFF;
-- if (val & 0x2000) val = val - 0x4000;
-+ // 0x400 for old file(unsure), ie. find many problematic files on
-+ // the web, so maybe 0x4000 is ok and these files are
-+ // problematic
-+ int const maxVal= (dim==1 || m_mainParser.creator()==libwps::WPS_LOTUS) ? 0x2000 : version()==1 ? 0x400 : 0x4000;
-+ val &= (2*maxVal-1);
-+ if (val & maxVal) val = val - 2*maxVal;
-+ if (val+actPos[dim]>=maxVal) val-=maxVal;
- }
- val += actPos[dim];
- absolute[dim] = false;
- }
-- else if (val==0xFFFF)
-- {
-- static bool first=true;
-- if (first) // in general associated with a nan value, so maybe be normal
-- {
-- WPS_DEBUG_MSG(("WKS4Spreadsheet::readCell: find some ffff cell\n"));
-- first=false;
-- }
-- ok = false;
-- }
-- else
-- {
-- WPS_DEBUG_MSG(("WKS4Spreadsheet::readCell: can not read cell %x\n", unsigned(val)));
-- ok = false;
-- }
- pos[dim] = val;
- }
-
-diff --git a/src/lib/WPSDocument.cpp b/src/lib/WPSDocument.cpp
-index 7e974b6..5b18eb8 100644
---- a/src/lib/WPSDocument.cpp
-+++ b/src/lib/WPSDocument.cpp
-@@ -155,6 +155,10 @@ WPSLIB WPSConfidence WPSDocument::isFileFormatSupported(librevenge::RVNGInputStr
- 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;
- }