[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 7 22:31:50 UTC 2018


 sc/source/filter/oox/stylesbuffer.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit d278f59c6112d39ae0f0cf23ec04697d87bbf870
Author:     Markus Mohrhard <markus.mohrhard at googlemail.com>
AuthorDate: Tue Nov 6 22:35:41 2018 +0100
Commit:     Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Wed Nov 7 23:30:09 2018 +0100

    tdf#120168, adapt horizontal alignment based on text rotation
    
    See ยง18.8.1 of Part1 of the XLSX spec.
    
    Change-Id: Id1822e3d0ddaa0d19fa4e9adc7f469e6ef334ef1
    Reviewed-on: https://gerrit.libreoffice.org/62979
    Tested-by: Jenkins
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index ec1dce320cec..e8701b7aa2ec 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1115,10 +1115,22 @@ Alignment::Alignment( const WorkbookHelper& rHelper ) :
 
 void Alignment::importAlignment( const AttributeList& rAttribs )
 {
-    maModel.mnHorAlign     = rAttribs.getToken( XML_horizontal, XML_general );
     maModel.mnVerAlign     = rAttribs.getToken( XML_vertical, XML_bottom );
     maModel.mnTextDir      = rAttribs.getInteger( XML_readingOrder, OOX_XF_TEXTDIR_CONTEXT );
     maModel.mnRotation     = rAttribs.getInteger( XML_textRotation, OOX_XF_ROTATION_NONE );
+    sal_Int32 nDefaultHorAlign = XML_general;
+    if (maModel.mnRotation != OOX_XF_ROTATION_NONE)
+    {
+        if (maModel.mnRotation < 90 || maModel.mnRotation == 180)
+        {
+            nDefaultHorAlign = XML_left;
+        }
+        else
+        {
+            nDefaultHorAlign = XML_right;
+        }
+    }
+    maModel.mnHorAlign     = rAttribs.getToken( XML_horizontal, nDefaultHorAlign );
     maModel.mnIndent       = rAttribs.getInteger( XML_indent, OOX_XF_INDENT_NONE );
     maModel.mbWrapText     = rAttribs.getBool( XML_wrapText, false );
     maModel.mbShrink       = rAttribs.getBool( XML_shrinkToFit, false );


More information about the Libreoffice-commits mailing list