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

Patrick Jaap (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 3 18:50:38 UTC 2019


 sw/source/filter/ww8/docxattributeoutput.cxx |   25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

New commits:
commit 2111f607973166ebc39414ba6d2019832bcfe4da
Author:     Patrick Jaap <patrick.jaap at tu-dresden.de>
AuthorDate: Wed Apr 3 14:58:05 2019 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Wed Apr 3 20:49:12 2019 +0200

    Fix in convertToOOXMLHoriOrient: values of VertOrient were taken
    
    Change-Id: I47093292aeed5c0579dd4b365561ee86935632e4
    Reviewed-on: https://gerrit.libreoffice.org/70197
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 969c2f2e830f..663670e38c9c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -517,24 +517,21 @@ static OString convertToOOXMLVertOrient(sal_Int16 nOrient)
     }
 }
 
-static OString convertToOOXMLHoriOrient(sal_Int16 nOrient)
+static OString convertToOOXMLHoriOrient(sal_Int16 nOrient, bool bIsPosToggle)
 {
     switch( nOrient )
     {
-        case text::VertOrientation::NONE:
+        case text::HoriOrientation::NONE:
             return OString();
-        case text::VertOrientation::CENTER:
-        case text::VertOrientation::LINE_CENTER:
-            return OString( "center" );
-        case text::VertOrientation::BOTTOM:
-            return OString( "bottom" );
-        case text::VertOrientation::LINE_BOTTOM:
-            return OString( "outside" );
-        case text::VertOrientation::TOP:
-            return OString( "top" );
-        case text::VertOrientation::LINE_TOP:
+        case text::HoriOrientation::LEFT:
+            return OString( bIsPosToggle ? "inside" : "left" );
+        case text::HoriOrientation::RIGHT:
+            return OString( bIsPosToggle ? "outside" : "right" );
+        case text::HoriOrientation::CENTER:
+        // fall-through indended
+        case text::HoriOrientation::FULL:
         default:
-            return OString( "inside" );
+            return OString( "center" );
     }
 }
 
@@ -8392,7 +8389,7 @@ void DocxAttributeOutput::FormatVertOrientation( const SwFormatVertOrient& rFlyV
 
 void DocxAttributeOutput::FormatHorizOrientation( const SwFormatHoriOrient& rFlyHori )
 {
-    OString sAlign   = convertToOOXMLHoriOrient( rFlyHori.GetHoriOrient() );
+    OString sAlign   = convertToOOXMLHoriOrient( rFlyHori.GetHoriOrient(), rFlyHori.IsPosToggle() );
     OString sHAnchor = convertToOOXMLHoriOrientRel( rFlyHori.GetRelationOrient() );
 
     if (m_rExport.SdrExporter().getTextFrameSyntax())


More information about the Libreoffice-commits mailing list