[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - oox/source

Tor Lillqvist tml at collabora.com
Thu Feb 16 10:44:31 UTC 2017


 oox/source/export/drawingml.cxx |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

New commits:
commit bc64dd416ecd022daacc049b5a2b898f30719471
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Feb 15 16:20:13 2017 +0200

    tdf#106026: Export paragraph top and bottom margin to DrawingML
    
    Change-Id: I8c60f86a1debe135c9172ff639aa5af93f03b99b
    (cherry picked from commit d2b014edc0f466370023a35eb46548390ceb7fb2)
    Reviewed-on: https://gerrit.libreoffice.org/34300
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 2e12ad5..83e0e1a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1954,6 +1954,12 @@ void DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rPara
     GET( nParaLeftMargin, ParaLeftMargin );
     GET( nParaFirstLineIndent,ParaFirstLineIndent);
 
+    sal_Int32 nParaTopMargin = 0;
+    sal_Int32 nParaBottomMargin = 0;
+
+    GET( nParaTopMargin, ParaTopMargin );
+    GET( nParaBottomMargin, ParaBottomMargin );
+
     sal_Int32 nLeftMargin =  getBulletMarginIndentation ( rXPropSet, nLevel,"LeftMargin");
     sal_Int32 nLineIndentation = getBulletMarginIndentation ( rXPropSet, nLevel,"FirstLineOffset");
 
@@ -1986,6 +1992,28 @@ void DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rPara
             mpFS->endElementNS( XML_a, XML_lnSpc );
         }
 
+        if( nParaTopMargin != 0 )
+        {
+            mpFS->startElementNS( XML_a, XML_spcBef, FSEND );
+            {
+                mpFS->singleElementNS( XML_a, XML_spcPts,
+                                       XML_val, I32S( std::lround( nParaTopMargin / 25.4 * 72 ) ),
+                                       FSEND );
+            }
+            mpFS->endElementNS( XML_a, XML_spcBef );
+        }
+
+        if( nParaBottomMargin != 0 )
+        {
+            mpFS->startElementNS( XML_a, XML_spcAft, FSEND );
+            {
+                mpFS->singleElementNS( XML_a, XML_spcPts,
+                                       XML_val, I32S( std::lround( nParaBottomMargin / 25.4 * 72 ) ),
+                                       FSEND );
+            }
+            mpFS->endElementNS( XML_a, XML_spcAft );
+        }
+
         WriteParagraphNumbering( rXPropSet, nLevel );
 
         mpFS->endElementNS( XML_a, XML_pPr );


More information about the Libreoffice-commits mailing list