diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-27 08:21:06 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-27 12:17:21 +0100 |
commit | 034c6ef667e734ee1f525daffc55d89cdc83b261 (patch) | |
tree | 0bd8f2a3d6bfad7ddb15ed8299e3b9e33ec4efeb /external | |
parent | 0b3a408cfdd0a212423bb172f091f2a0d1c83423 (diff) |
EPUB export: handle horizontal left/right positioning of non-as-char images
The change in XMLStyleContext::startElement() just makes sure that
properties from the parent graphic styles are read, but currently it's
just a nice-to-have addition, we don't depend on this yet, so no test.
Change-Id: Ieac599dd47049edea57cb0860aa483f1045b47fd
Reviewed-on: https://gerrit.libreoffice.org/45308
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'external')
-rw-r--r-- | external/libepubgen/libepubgen-epub3.patch.1 | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/external/libepubgen/libepubgen-epub3.patch.1 b/external/libepubgen/libepubgen-epub3.patch.1 index c226c51d4388..70a77b101a5c 100644 --- a/external/libepubgen/libepubgen-epub3.patch.1 +++ b/external/libepubgen/libepubgen-epub3.patch.1 @@ -3577,3 +3577,45 @@ index 4ffa55d..d81a905 100644 -- 2.13.6 +From 0f5073481b094562f2c78481475a660fb6826cdb Mon Sep 17 00:00:00 2001 +From: Miklos Vajna <vmiklos@collabora.co.uk> +Date: Thu, 9 Nov 2017 11:32:27 +0100 +Subject: [PATCH] EPUBImageManager: initial horizontal positioning + +For now position everything to the left, except for explicit "right". +--- + src/lib/EPUBImageManager.cpp | 17 ++++++++++ + src/test/EPUBTextGeneratorTest.cpp | 66 ++++++++++++++++++++++++++++++++++++++ + 2 files changed, 83 insertions(+) + +diff --git a/src/lib/EPUBImageManager.cpp b/src/lib/EPUBImageManager.cpp +index 2311e76..8414da5 100644 +--- a/src/lib/EPUBImageManager.cpp ++++ b/src/lib/EPUBImageManager.cpp +@@ -133,6 +133,23 @@ std::string EPUBImageManager::getImageStyle(librevenge::RVNGPropertyList const & + + void EPUBImageManager::extractImageProperties(librevenge::RVNGPropertyList const &pList, EPUBCSSProperties &cssProps) const + { ++ // Positioning. ++ librevenge::RVNGString anchorType; ++ if (pList["text:anchor-type"]) ++ anchorType = pList["text:anchor-type"]->getStr(); ++ if (anchorType != "as-char") ++ { ++ // Horizontal position. ++ librevenge::RVNGString horizontalPos; ++ if (pList["style:horizontal-pos"]) ++ horizontalPos = pList["style:horizontal-pos"]->getStr(); ++ ++ if (horizontalPos == "right") ++ cssProps["float"] = "right"; ++ else ++ cssProps["float"] = "left"; ++ } ++ + // Extract borders. + static char const *(type[]) = {"border", "border-left", "border-top", "border-right", "border-bottom" }; + for (int i = 0; i < 5; i++) +-- +2.13.6 + |