From 7b8f630db30ee0066a9f4b6e540368d2fcad7fa8 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 14 Nov 2021 00:09:43 +0300 Subject: Use o3tl::convert Change-Id: I78db3001d602ec1a0847785b3c127b9d345f5af7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125173 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- filter/source/msfilter/eschesdo.cxx | 11 ++++------- filter/source/msfilter/eschesdo.hxx | 6 +++--- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'filter') diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index f73ffd2b29da..114e2c9304f9 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -47,13 +46,11 @@ using namespace ::com::sun::star::text; using namespace ::com::sun::star::task; using namespace ::com::sun::star::style; -#define EES_MAP_FRACTION 1440 // 1440 dpi - ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx ) : mpEscherEx(&rEx) - , maMapModeSrc(MapUnit::Map100thMM) + , meUnitsSrc(o3tl::Length::mm100) // PowerPoint: 576 dpi, WinWord: 1440 dpi, Excel: 1440 dpi - , maMapModeDest( MapUnit::MapInch, Point(), Fraction( 1, EES_MAP_FRACTION ), Fraction( 1, EES_MAP_FRACTION ) ) + , meUnitsDest(o3tl::Length::twip) , mpPicStrm(nullptr) , mpHostAppData(nullptr) , mbIsTitlePossible(false) @@ -65,12 +62,12 @@ ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx ) Point ImplEESdrWriter::ImplMapPoint( const Point& rPoint ) { - return OutputDevice::LogicToLogic( rPoint, maMapModeSrc, maMapModeDest ); + return o3tl::convert( rPoint, meUnitsSrc, meUnitsDest ); } Size ImplEESdrWriter::ImplMapSize( const Size& rSize ) { - Size aRetSize( OutputDevice::LogicToLogic( rSize, maMapModeSrc, maMapModeDest ) ); + Size aRetSize( o3tl::convert( rSize, meUnitsSrc, meUnitsDest ) ); if ( !aRetSize.Width() ) aRetSize.AdjustWidth( 1 ); diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx index 114efca4092f..6d5f84f6a760 100644 --- a/filter/source/msfilter/eschesdo.hxx +++ b/filter/source/msfilter/eschesdo.hxx @@ -19,7 +19,7 @@ #pragma once #include #include -#include +#include // fractions of Draw PPTWriter etc. @@ -100,8 +100,8 @@ class EscherExHostAppData; class ImplEESdrWriter { EscherEx* mpEscherEx; - MapMode maMapModeSrc; - MapMode maMapModeDest; + o3tl::Length meUnitsSrc; + o3tl::Length meUnitsDest; css::uno::Reference< css::drawing::XDrawPage > mXDrawPage; css::uno::Reference< css::drawing::XShapes > mXShapes; SvStream* mpPicStrm; -- cgit