summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Picca <jumapico@gmail.com>2015-01-31 21:24:42 -0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-02-02 11:50:39 +0000
commitc32aa53a7df7af4ef23b8d235483eabb51463183 (patch)
tree80b1cd27e68d83b559703fc9190c08e1728c4f75
parente76bc369b8ee58094f45a2f5451cf9374163e979 (diff)
fdo#88826: replace MM100toEMU() by convertHmmToEmu()
Change-Id: I9ca79dfa0c214e3f58b7f45a78ad0877d4c7d10a Reviewed-on: https://gerrit.libreoffice.org/14266 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--include/oox/export/utils.hxx5
-rw-r--r--oox/source/export/drawingml.cxx14
-rw-r--r--oox/source/export/shapes.cxx4
-rw-r--r--sc/source/filter/excel/xeescher.cxx4
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx8
5 files changed, 15 insertions, 20 deletions
diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx
index 2c4fcec3b480..417e552fff30 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 3c5c3f369fb5..fcacb7a88c02 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 71968b91ade9..a41ea2b25bf8 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 acf29b8f2c72..946b6774d86a 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 9ed9f94c344e..be7b4855adf3 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 ) );
}