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

Kohei Yoshida kohei.yoshida at gmail.com
Tue Feb 6 03:09:48 UTC 2018


 sc/source/filter/inc/orcusinterface.hxx |    6 ++-
 sc/source/filter/orcus/interface.cxx    |   58 ++++++++++++++++++++------------
 2 files changed, 42 insertions(+), 22 deletions(-)

New commits:
commit 8a0b61172a14b8b766a2e85f27762db3558d3af7
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Mon Feb 5 20:59:34 2018 -0500

    Import distributed text alignment settings correctly from orcus.
    
    Change-Id: Id04e2bd19475d6d7b98560835bc5aaad4bb8addf
    Reviewed-on: https://gerrit.libreoffice.org/49265
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 5d6cc1f55135..d1b4cfb5e6b1 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -387,8 +387,10 @@ private:
         size_t mnStyleXf;
         bool mbAlignment;
 
-        SvxCellHorJustify meHor_alignment;
-        SvxCellVerJustify meVer_alignment;
+        SvxCellHorJustify meHorAlignment;
+        SvxCellVerJustify meVerAlignment;
+        SvxCellJustifyMethod meHorAlignMethod;
+        SvxCellJustifyMethod meVerAlignMethod;
 
         xf();
     };
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 40140ae93b5e..b7bc5970f58c 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -1263,8 +1263,10 @@ ScOrcusStyles::xf::xf():
     mnNumberFormatId(0),
     mnStyleXf(0),
     mbAlignment(false),
-    meHor_alignment(SvxCellHorJustify::Right),
-    meVer_alignment(SvxCellVerJustify::Bottom)
+    meHorAlignment(SvxCellHorJustify::Standard),
+    meVerAlignment(SvxCellVerJustify::Standard),
+    meHorAlignMethod(SvxCellJustifyMethod::Auto),
+    meVerAlignMethod(SvxCellJustifyMethod::Auto)
 {
 }
 
@@ -1330,8 +1332,10 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
 
     if(rXf.mbAlignment)
     {
-        rSet.Put(SvxHorJustifyItem(rXf.meHor_alignment, ATTR_HOR_JUSTIFY));
-        rSet.Put(SvxVerJustifyItem(rXf.meVer_alignment, ATTR_VER_JUSTIFY));
+        rSet.Put(SvxHorJustifyItem(rXf.meHorAlignment, ATTR_HOR_JUSTIFY));
+        rSet.Put(SvxVerJustifyItem(rXf.meVerAlignment, ATTR_VER_JUSTIFY));
+        rSet.Put(SvxJustifyMethodItem(rXf.meHorAlignMethod, ATTR_HOR_JUSTIFY_METHOD));
+        rSet.Put(SvxJustifyMethodItem(rXf.meVerAlignMethod, ATTR_VER_JUSTIFY_METHOD));
     }
 }
 
@@ -1813,17 +1817,24 @@ void ScOrcusStyles::set_xf_horizontal_alignment(orcus::spreadsheet::hor_alignmen
     switch (align)
     {
         case os::hor_alignment_t::left:
-            maCurrentXF.meHor_alignment = SvxCellHorJustify::Left;
-        break;
+            maCurrentXF.meHorAlignment = SvxCellHorJustify::Left;
+            break;
         case os::hor_alignment_t::right:
-            maCurrentXF.meHor_alignment = SvxCellHorJustify::Right;
-        break;
+            maCurrentXF.meHorAlignment = SvxCellHorJustify::Right;
+            break;
         case os::hor_alignment_t::center:
-            maCurrentXF.meHor_alignment = SvxCellHorJustify::Center;
-        break;
+            maCurrentXF.meHorAlignment = SvxCellHorJustify::Center;
+            break;
         case os::hor_alignment_t::justified:
-            maCurrentXF.meHor_alignment = SvxCellHorJustify::Standard;
-        break;
+            maCurrentXF.meHorAlignment = SvxCellHorJustify::Block;
+            break;
+        case os::hor_alignment_t::distributed:
+            maCurrentXF.meHorAlignment = SvxCellHorJustify::Block;
+            maCurrentXF.meHorAlignMethod = SvxCellJustifyMethod::Distribute;
+            break;
+        case os::hor_alignment_t::unknown:
+            maCurrentXF.meHorAlignment = SvxCellHorJustify::Standard;
+            break;
         default:
             ;
     }
@@ -1835,17 +1846,24 @@ void ScOrcusStyles::set_xf_vertical_alignment(orcus::spreadsheet::ver_alignment_
     switch (align)
     {
         case os::ver_alignment_t::top:
-            maCurrentXF.meVer_alignment = SvxCellVerJustify::Top;
-        break;
+            maCurrentXF.meVerAlignment = SvxCellVerJustify::Top;
+            break;
         case os::ver_alignment_t::bottom:
-            maCurrentXF.meVer_alignment = SvxCellVerJustify::Bottom;
-        break;
+            maCurrentXF.meVerAlignment = SvxCellVerJustify::Bottom;
+            break;
         case os::ver_alignment_t::middle:
-            maCurrentXF.meVer_alignment = SvxCellVerJustify::Center;
-        break;
+            maCurrentXF.meVerAlignment = SvxCellVerJustify::Center;
+            break;
         case os::ver_alignment_t::justified:
-            maCurrentXF.meVer_alignment = SvxCellVerJustify::Standard;
-        break;
+            maCurrentXF.meVerAlignment = SvxCellVerJustify::Block;
+            break;
+        case os::ver_alignment_t::distributed:
+            maCurrentXF.meVerAlignment = SvxCellVerJustify::Block;
+            maCurrentXF.meVerAlignMethod = SvxCellJustifyMethod::Distribute;
+            break;
+        case os::ver_alignment_t::unknown:
+            maCurrentXF.meVerAlignment = SvxCellVerJustify::Standard;
+            break;
         default:
             ;
     }


More information about the Libreoffice-commits mailing list