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

Juan Picca jumapico at gmail.com
Mon Feb 2 03:51:06 PST 2015


 include/oox/export/utils.hxx        |    5 -----
 oox/source/export/drawingml.cxx     |   14 +++++++-------
 oox/source/export/shapes.cxx        |    4 ++--
 sc/source/filter/excel/xeescher.cxx |    4 ++--
 sc/source/filter/xcl97/xcl97rec.cxx |    8 ++++----
 5 files changed, 15 insertions(+), 20 deletions(-)

New commits:
commit c32aa53a7df7af4ef23b8d235483eabb51463183
Author: Juan Picca <jumapico at gmail.com>
Date:   Sat Jan 31 21:24:42 2015 -0200

    fdo#88826: replace MM100toEMU() by convertHmmToEmu()
    
    Change-Id: I9ca79dfa0c214e3f58b7f45a78ad0877d4c7d10a
    Reviewed-on: https://gerrit.libreoffice.org/14266
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx
index 2c4fcec..417e552 100644
--- a/include/oox/export/utils.hxx
+++ b/include/oox/export/utils.hxx
@@ -39,11 +39,6 @@ static inline sal_Int64 PPTtoEMU( sal_Int32 nPPT )
     return (sal_Int64)( (double)nPPT * 1587.5 );
 }
 
-static inline sal_Int64 MM100toEMU( sal_Int32 nMM100 )
-{
-    return (sal_Int64)nMM100 * 360;
-}
-
 static inline sal_Int64 TwipsToEMU( sal_Int32 nTwips )
 {
     return sal_Int64( nTwips ) * 635;
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 3c5c3f3..fcacb7a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -636,7 +636,7 @@ void DrawingML::WriteOutline( Reference<XPropertySet> rXPropSet )
     mpFS->startElementNS( XML_a, XML_ln,
                           XML_cap, cap,
                           XML_w, nLineWidth > 1 && nStyleLineWidth != nLineWidth ?
-                                  I64S( MM100toEMU( nLineWidth ) ) :NULL,
+                                  I64S( oox::drawingml::convertHmmToEmu( nLineWidth ) ) :NULL,
                           FSEND );
 
     if( bColorSet )
@@ -1120,8 +1120,8 @@ void DrawingML::WriteTransformation( const Rectangle& rRect,
         nTop = 0;
     }
 
-    mpFS->singleElementNS( XML_a, XML_off, XML_x, IS( MM100toEMU( nLeft ) ), XML_y, IS( MM100toEMU( nTop ) ), FSEND );
-    mpFS->singleElementNS( XML_a, XML_ext, XML_cx, IS( MM100toEMU( rRect.GetWidth() ) ), XML_cy, IS( MM100toEMU( rRect.GetHeight() ) ), FSEND );
+    mpFS->singleElementNS( XML_a, XML_off, XML_x, IS( oox::drawingml::convertHmmToEmu( nLeft ) ), XML_y, IS( oox::drawingml::convertHmmToEmu( nTop ) ), FSEND );
+    mpFS->singleElementNS( XML_a, XML_ext, XML_cx, IS( oox::drawingml::convertHmmToEmu( rRect.GetWidth() ) ), XML_cy, IS( oox::drawingml::convertHmmToEmu( rRect.GetHeight() ) ), FSEND );
 
     mpFS->endElementNS( nXmlNamespace, XML_xfrm );
 }
@@ -1924,10 +1924,10 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, const OUString& pres
         }
         mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr,
                                XML_wrap, pWrap,
-                               XML_lIns, (nLeft != DEFLRINS) ? IS( MM100toEMU( nLeft ) ) : NULL,
-                               XML_rIns, (nRight != DEFLRINS) ? IS( MM100toEMU( nRight ) ) : NULL,
-                               XML_tIns, (nTop != DEFTBINS) ? IS( MM100toEMU( nTop ) ) : NULL,
-                               XML_bIns, (nBottom != DEFTBINS) ? IS( MM100toEMU( nBottom ) ) : NULL,
+                               XML_lIns, (nLeft != DEFLRINS) ? IS( oox::drawingml::convertHmmToEmu( nLeft ) ) : NULL,
+                               XML_rIns, (nRight != DEFLRINS) ? IS( oox::drawingml::convertHmmToEmu( nRight ) ) : NULL,
+                               XML_tIns, (nTop != DEFTBINS) ? IS( oox::drawingml::convertHmmToEmu( nTop ) ) : NULL,
+                               XML_bIns, (nBottom != DEFTBINS) ? IS( oox::drawingml::convertHmmToEmu( nBottom ) ) : NULL,
                                XML_anchor, sVerticalAlignment,
                                XML_anchorCtr, bHorizontalCenter ? "1" : NULL,
                                XML_vert, sWritingMode,
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 71968b9..a41ea2b 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -867,7 +867,7 @@ void ShapeExport::WriteTable( Reference< XShape > rXShape  )
             sal_Int32 nWidth(0);
             xColPropSet->getPropertyValue( "Width" ) >>= nWidth;
 
-            mpFS->singleElementNS( XML_a, XML_gridCol, XML_w, I64S(MM100toEMU(nWidth)), FSEND );
+            mpFS->singleElementNS( XML_a, XML_gridCol, XML_w, I64S(oox::drawingml::convertHmmToEmu(nWidth)), FSEND );
         }
 
         mpFS->endElementNS( XML_a, XML_tblGrid );
@@ -879,7 +879,7 @@ void ShapeExport::WriteTable( Reference< XShape > rXShape  )
 
             xRowPropSet->getPropertyValue( "Height" ) >>= nRowHeight;
 
-            mpFS->startElementNS( XML_a, XML_tr, XML_h, I64S( MM100toEMU( nRowHeight ) ), FSEND );
+            mpFS->startElementNS( XML_a, XML_tr, XML_h, I64S( oox::drawingml::convertHmmToEmu( nRowHeight ) ), FSEND );
 
             for( sal_Int32 nColumn = 0; nColumn < nColumnCount; nColumn++ )
             {
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index acf29b8..946b677 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1120,8 +1120,8 @@ void XclExpChartObj::WriteShapeTransformation( sax_fastparser::FSHelperPtr pFS,
                           XML_rot, nRotation ? I32S( nRotation ) : NULL,
                           FSEND );
 
-    pFS->singleElementNS( XML_a, XML_off, XML_x, IS( MM100toEMU( aPos.X ) ), XML_y, IS( MM100toEMU( aPos.Y ) ), FSEND );
-    pFS->singleElementNS( XML_a, XML_ext, XML_cx, IS( MM100toEMU( aSize.Width ) ), XML_cy, IS( MM100toEMU( aSize.Height ) ), FSEND );
+    pFS->singleElementNS( XML_a, XML_off, XML_x, IS( oox::drawingml::convertHmmToEmu( aPos.X ) ), XML_y, IS( oox::drawingml::convertHmmToEmu( aPos.Y ) ), FSEND );
+    pFS->singleElementNS( XML_a, XML_ext, XML_cx, IS( oox::drawingml::convertHmmToEmu( aSize.Width ) ), XML_cy, IS( oox::drawingml::convertHmmToEmu( aSize.Height ) ), FSEND );
 
     pFS->endElementNS( XML_xdr, XML_xfrm );
 }
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 9ed9f94..be7b485 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1010,20 +1010,20 @@ void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const Reference< XShape >&
             FSEND );
     XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_col ), (sal_Int32) aRange.aStart.Col() );
     XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_colOff ),
-            MM100toEMU( aLocation.Left() - aRangeRect.Left() ) );
+            oox::drawingml::convertHmmToEmu( aLocation.Left() - aRangeRect.Left() ) );
     XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_row ), (sal_Int32) aRange.aStart.Row() );
     XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_rowOff ),
-            MM100toEMU( aLocation.Top() - aRangeRect.Top() ) );
+            oox::drawingml::convertHmmToEmu( aLocation.Top() - aRangeRect.Top() ) );
     pDrawing->endElement( FSNS( XML_xdr, XML_from ) );
 
     pDrawing->startElement( FSNS( XML_xdr, XML_to ),
             FSEND );
     XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_col ), (sal_Int32) aRange.aEnd.Col() );
     XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_colOff ),
-            MM100toEMU( aLocation.Right() - aRangeRect.Right() ) );
+            oox::drawingml::convertHmmToEmu( aLocation.Right() - aRangeRect.Right() ) );
     XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_row ), (sal_Int32) aRange.aEnd.Row() );
     XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_rowOff ),
-            MM100toEMU( aLocation.Bottom() - aRangeRect.Bottom() ) );
+            oox::drawingml::convertHmmToEmu( aLocation.Bottom() - aRangeRect.Bottom() ) );
     pDrawing->endElement( FSNS( XML_xdr, XML_to ) );
 }
 


More information about the Libreoffice-commits mailing list