summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-11 12:32:22 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-11 16:19:21 +0200
commitebf34ec31fb441d6226075a51f5f83ebf4668082 (patch)
tree43220eb2c5f1354d56de1df94dff931b8a700593 /external
parentc2917d90ed0f5b503662ec460605b3e1d34c70d9 (diff)
EPUB export: ignore line though type/style 'none'
In CSS this is a boolean property, but in ODF it's an enum, so map none to false and everything else to true. Change-Id: Id28d0a33121c9c1fd5a1ae6bf68280a9c4cffc03 Reviewed-on: https://gerrit.libreoffice.org/42159 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'external')
-rw-r--r--external/libepubgen/libepubgen-epub3.patch.161
1 files changed, 61 insertions, 0 deletions
diff --git a/external/libepubgen/libepubgen-epub3.patch.1 b/external/libepubgen/libepubgen-epub3.patch.1
index 0fdf0c72f070..0146310f46d0 100644
--- a/external/libepubgen/libepubgen-epub3.patch.1
+++ b/external/libepubgen/libepubgen-epub3.patch.1
@@ -1994,3 +1994,64 @@ index 0f7f1e0..1bd1e16 100644
--
2.12.3
+From 7be89d1881e175182039ca93a1546d79933cab85 Mon Sep 17 00:00:00 2001
+From: Miklos Vajna <vmiklos@collabora.co.uk>
+Date: Mon, 11 Sep 2017 11:03:03 +0200
+Subject: [PATCH] EPUBSpanStyleManager: ignore line though type/style 'none'
+
+In CSS this is a boolean property, but in ODF it's an enum, so map none
+to false and everything else to true.
+---
+ src/lib/EPUBSpanStyleManager.cpp | 11 +++++++-
+ src/lib/EPUBTextGenerator.cpp | 4 +--
+ src/test/EPUBTextGeneratorTest.cpp | 58 ++++++++++++++++++++++++++++++++++++--
+ 3 files changed, 68 insertions(+), 5 deletions(-)
+
+diff --git a/src/lib/EPUBSpanStyleManager.cpp b/src/lib/EPUBSpanStyleManager.cpp
+index 4887858..211946c 100644
+--- a/src/lib/EPUBSpanStyleManager.cpp
++++ b/src/lib/EPUBSpanStyleManager.cpp
+@@ -137,8 +137,17 @@ void EPUBSpanStyleManager::extractDecorations(RVNGPropertyList const &pList, EPU
+ // replaceme by text-decoration-line when its implementation will appear in browser
+ std::stringstream s;
+
+- if (pList["style:text-line-through-style"] || pList["style:text-line-through-type"])
++ // line-though style or type 'none' is not line-though, everything else is.
++ const librevenge::RVNGProperty *textLineThoughStyle = pList["style:text-line-through-style"];
++ bool lineThough = textLineThoughStyle && textLineThoughStyle->getStr() != "none";
++ if (!lineThough)
++ {
++ const librevenge::RVNGProperty *textLineThoughType = pList["style:text-line-through-type"];
++ lineThough = textLineThoughType && textLineThoughType->getStr() != "none";
++ }
++ if (lineThough)
+ s << " line-through";
++
+ if (pList["style:text-overline-style"] || pList["style:text-overline-type"])
+ s << " overline";
+ if (pList["style:text-underline-style"] || pList["style:text-underline-type"])
+diff --git a/src/lib/EPUBTextGenerator.cpp b/src/lib/EPUBTextGenerator.cpp
+index 1bd1e16..07aa50d 100644
+--- a/src/lib/EPUBTextGenerator.cpp
++++ b/src/lib/EPUBTextGenerator.cpp
+@@ -596,7 +596,7 @@ void EPUBTextGenerator::closeFrame()
+ }
+
+ /// Checks if the media type is an EPUB 3 Core Media Type or not.
+-static bool isValidMimeType(const RVNGString& mediaType)
++static bool isValidMimeType(const RVNGString &mediaType)
+ {
+ // Defined at <https://idpf.github.io/epub-cmt/v3/#sec-cmt-supported>.
+ static char const *(types[])=
+@@ -607,7 +607,7 @@ static bool isValidMimeType(const RVNGString& mediaType)
+ "image/svg+xml"
+ };
+
+- for (const auto& i : types)
++ for (const auto &i : types)
+ {
+ if (mediaType == i)
+ return true;
+--
+2.12.3
+