[Libreoffice-commits] core.git: external/libepubgen writerperfect/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Nov 27 11:18:05 UTC 2017


 external/libepubgen/libepubgen-epub3.patch.1 |   42 +++++++++++++++++++++++++++
 writerperfect/source/writer/exp/txtstyli.cxx |    1 
 2 files changed, 43 insertions(+)

New commits:
commit 034c6ef667e734ee1f525daffc55d89cdc83b261
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Nov 27 08:21:06 2017 +0100

    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 at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

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 at 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
+
diff --git a/writerperfect/source/writer/exp/txtstyli.cxx b/writerperfect/source/writer/exp/txtstyli.cxx
index 88c63aa9063f..e8fe1a43bea0 100644
--- a/writerperfect/source/writer/exp/txtstyli.cxx
+++ b/writerperfect/source/writer/exp/txtstyli.cxx
@@ -260,6 +260,7 @@ void XMLStyleContext::startElement(const OUString &/*rName*/, const css::uno::Re
         OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8);
         m_aTextPropertyList.insert(sName.getStr(), sValue.getStr());
         m_aParagraphPropertyList.insert(sName.getStr(), sValue.getStr());
+        m_aGraphicPropertyList.insert(sName.getStr(), sValue.getStr());
     }
 }
 


More information about the Libreoffice-commits mailing list