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

New commits:
commit 48acd5c5793edfec5d6b168fa39dcebc4500effe
Author: Tor Lillqvist <t...@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/34299
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 73bf449..1f3b593 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1947,6 +1947,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");
 
@@ -1979,6 +1985,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 );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to