diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-09-04 17:27:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-09-04 20:53:22 +0200 |
commit | 41092fe0bb0d2f49948bf2a1f27acb53f21a84aa (patch) | |
tree | fadc83af7778ce362610dfc72954e8ef98f8ad2e /external/libepubgen | |
parent | 72b19aa29f9adcab6dd20d1517208f3b999d055e (diff) |
EPUB export: write author metadata
<meta:initial-creator> is the author and <dc:creator> is the "last
modified by" in ODF (it seems), so map the first to EPUB's <dc:creator>.
Change-Id: Id701c8c38b0901ae14fbbc7b32d01b43d6d03f68
Reviewed-on: https://gerrit.libreoffice.org/41903
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'external/libepubgen')
-rw-r--r-- | external/libepubgen/libepubgen-epub3.patch.1 | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/external/libepubgen/libepubgen-epub3.patch.1 b/external/libepubgen/libepubgen-epub3.patch.1 index d1d35c102022..0415bf340e78 100644 --- a/external/libepubgen/libepubgen-epub3.patch.1 +++ b/external/libepubgen/libepubgen-epub3.patch.1 @@ -1862,3 +1862,47 @@ index 4ce2964..1661064 100644 -- 2.12.3 +From 7e3b5186616326534b1ae95c6d2d188c5e522c7f Mon Sep 17 00:00:00 2001 +From: Miklos Vajna <vmiklos@collabora.co.uk> +Date: Mon, 4 Sep 2017 17:18:49 +0200 +Subject: [PATCH] EPUBGenerator: always write author and title + +Some EPUB3 readers categorize books by author and then title, so if +these are empty, then it's next to impossible to reach the export result +there. +--- + src/lib/EPUBGenerator.cpp | 11 ++++++++--- + src/test/EPUBTextGeneratorTest.cpp | 11 +++++++++++ + 2 files changed, 19 insertions(+), 3 deletions(-) + +diff --git a/src/lib/EPUBGenerator.cpp b/src/lib/EPUBGenerator.cpp +index 1661064..3340643 100644 +--- a/src/lib/EPUBGenerator.cpp ++++ b/src/lib/EPUBGenerator.cpp +@@ -260,15 +260,20 @@ void EPUBGenerator::writeRoot() + sink.insertCharacters(identifierCharactrs.c_str()); + sink.closeElement("dc:identifier"); + +- // Zero-width space as it must be at least one character in length after +- // white space has been trimmed. +- RVNGString title("\u200b"); ++ RVNGString title("Unknown Title"); + if (m_metadata["dc:title"] && !m_metadata["dc:title"]->getStr().empty()) + title = m_metadata["dc:title"]->getStr(); + sink.openElement("dc:title"); + sink.insertCharacters(title); + sink.closeElement("dc:title"); + ++ RVNGString creator("Unknown Author"); ++ if (m_metadata["meta:initial-creator"] && !m_metadata["meta:initial-creator"]->getStr().empty()) ++ creator = m_metadata["meta:initial-creator"]->getStr(); ++ sink.openElement("dc:creator"); ++ sink.insertCharacters(creator); ++ sink.closeElement("dc:creator"); ++ + RVNGString language("en"); + if (m_metadata["dc:language"] && !m_metadata["dc:language"]->getStr().empty()) + language = m_metadata["dc:language"]->getStr(); +-- +2.12.3 + |