summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-02-04 13:01:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-04 17:36:48 +0100
commit10943505162d515f16acfb4d195d171421ff834f (patch)
treef5a67a7ae6e94227fa83b7b37611bf3d0d0ebca6 /svx
parent4887f113d3bb3ffaf7bd93e2e0dba13fdb11afee (diff)
have one set of twips<->mm conversions
Change-Id: I510f4a0524a7c72eb124cba103cbf398024976d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110407 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/table/tablertfexporter.cxx8
-rw-r--r--svx/source/table/tablertfimporter.cxx8
-rw-r--r--svx/source/unodraw/unoshape.cxx8
3 files changed, 6 insertions, 18 deletions
diff --git a/svx/source/table/tablertfexporter.cxx b/svx/source/table/tablertfexporter.cxx
index 10707cbc1c21..f3cde67471b5 100644
--- a/svx/source/table/tablertfexporter.cxx
+++ b/svx/source/table/tablertfexporter.cxx
@@ -77,12 +77,6 @@ SdrTableRtfExporter::SdrTableRtfExporter( SvStream& rStrm, SdrTableObj& rObj )
{
}
-static tools::Long HundMMToTwips( tools::Long nIn )
-{
- tools::Long nRet = OutputDevice::LogicToLogic( nIn, MapUnit::Map100thMM, MapUnit::MapTwip );
- return nRet;
-}
-
void SdrTableRtfExporter::Write()
{
mrStrm.WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_RTF );
@@ -101,7 +95,7 @@ void SdrTableRtfExporter::Write()
Reference< XPropertySet > xSet( xColumns->getByIndex(nCol), UNO_QUERY_THROW );
sal_Int32 nWidth = 0;
xSet->getPropertyValue( gsSize ) >>= nWidth;
- nPos += HundMMToTwips( nWidth );
+ nPos += HMMToTwips( nWidth );
aColumnStart.push_back( nPos );
}
catch( Exception& )
diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx
index c2f510444f8a..cdf25aa67306 100644
--- a/svx/source/table/tablertfimporter.cxx
+++ b/svx/source/table/tablertfimporter.cxx
@@ -381,12 +381,6 @@ void SdrTableRTFParser::NextColumn()
mpActDefault = nullptr;
}
-static tools::Long TwipsToHundMM( tools::Long nIn )
-{
- tools::Long nRet = OutputDevice::LogicToLogic( nIn, MapUnit::MapTwip, MapUnit::Map100thMM );
- return nRet;
-}
-
void SdrTableRTFParser::ProcToken( RtfImportInfo* pInfo )
{
switch ( pInfo->nToken )
@@ -435,7 +429,7 @@ void SdrTableRTFParser::ProcToken( RtfImportInfo* pInfo )
maDefaultList.push_back( pDefault );
- const sal_Int32 nSize = TwipsToHundMM( pInfo->nTokenValue );
+ const sal_Int32 nSize = TwipsToHMM( pInfo->nTokenValue );
if ( nSize > mnLastEdge )
InsertColumnEdge( nSize );
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index a545aaa6c44e..74f71049db2d 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -464,8 +464,8 @@ void SvxShape::ForceMetricToItemPoolMetric(Pair& rPoint) const throw()
{
case MapUnit::MapTwip :
{
- rPoint.A() = MM_TO_TWIPS(rPoint.A());
- rPoint.B() = MM_TO_TWIPS(rPoint.B());
+ rPoint.A() = HMMToTwips(rPoint.A());
+ rPoint.B() = HMMToTwips(rPoint.B());
break;
}
default:
@@ -548,8 +548,8 @@ void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
{
case MapUnit::MapTwip :
{
- rPoint.A() = TWIPS_TO_MM(rPoint.A());
- rPoint.B() = TWIPS_TO_MM(rPoint.B());
+ rPoint.A() = TwipsToHMM(rPoint.A());
+ rPoint.B() = TwipsToHMM(rPoint.B());
break;
}
default: