[Libreoffice-bugs] [Bug 131812] Exporting to html doesn't preserve RTL property

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sat Apr 11 08:33:20 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=131812

--- Comment #10 from Julien Nabet <serval2412 at yahoo.fr> ---
Created attachment 159485
  --> https://bugs.documentfoundation.org/attachment.cgi?id=159485&action=edit
another test

Here's another test.

The patch would be:
diff --git
a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
index da123b1e5146..3a83ec200a06 100644
--- a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
@@ -123,10 +123,10 @@
             <xsl:when test="contains(., 'end')">
                 <xsl:choose>
                     <xsl:when test="parent::*/@style:writing-mode and
contains(parent::*/@style:writing-mode, 'rl')">
-                        <xsl:text>text-align:left ! important;</xsl:text>
+                        <xsl:text>text-align:right ! important;</xsl:text>
                     </xsl:when>
                     <xsl:otherwise>
-                        <xsl:text>text-align:right ! important; </xsl:text>
+                        <xsl:text>text-align:left ! important; </xsl:text>
                     </xsl:otherwise>
                 </xsl:choose>
             </xsl:when>
@@ -290,8 +290,20 @@
     </xsl:template>
     <xsl:template match="@style:writing-mode">
         <xsl:text>writing-mode:</xsl:text>
-        <xsl:value-of select="."/>
-        <xsl:text>; </xsl:text>
+        <xsl:choose>
+            <xsl:when test=".='rl-tb'">
+                <xsl:text>horizontal-tb; direction=rtl; </xsl:text>
+            </xsl:when>
+            <xsl:when test=".='lr-tb'">
+                <xsl:text>horizontal-tb; direction=ltr; </xsl:text>
+            </xsl:when>
+            <xsl:when test=".='tb-rl'">
+                <xsl:text>vertical-rl; </xsl:text>
+            </xsl:when>
+            <xsl:when test=".='tb-lr'">
+                <xsl:text>vertical-lr; </xsl:text>
+            </xsl:when>
+        </xsl:choose>
     </xsl:template>
     <!-- *** Properties with a no 'fo:' or 'style:' prefix *** -->
     <xsl:template match="@table:align">

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200411/a08ddbe5/attachment.htm>


More information about the Libreoffice-bugs mailing list