diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2019-12-10 02:26:09 +1100 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2019-12-14 21:09:05 +0100 |
commit | 64e8c521d105c34d41a70e7a9437deb71af6becc (patch) | |
tree | 7eea9be56186dfa74ad25b2e8e8e7f69dec953e6 /drawinglayer | |
parent | 148dba2e6fc68d593f2fb8c1a13a1e811d4504a1 (diff) |
drawinglayer: fix getUnitToPixelMultiplier() function
Change-Id: If3e7d87e804a69b8c9511e2b5ac3e0af2f1a57a0
Reviewed-on: https://gerrit.libreoffice.org/84832
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/tools/emfphelperdata.cxx | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx index 1c6950d01404..f0c84dc34ec2 100644 --- a/drawinglayer/source/tools/emfphelperdata.cxx +++ b/drawinglayer/source/tools/emfphelperdata.cxx @@ -44,6 +44,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolypolygoncutter.hxx> #include <sal/log.hxx> +#include <vcl/outdev.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <i18nlangtag/languagetag.hxx> @@ -175,31 +176,35 @@ namespace emfplushelper case UnitTypePoint: { SAL_INFO("drawinglayer", "EMF+\t Converting Points to Pixels."); - return 1.333333f; + return Application::GetDefaultDevice()->GetDPIX() / 72; } case UnitTypeInch: { - SAL_INFO("drawinglayer", "EMF+\t TODO Test Converting Inches to Pixels, if it is working correctly."); - return 96.0f; + SAL_INFO("drawinglayer", "EMF+\t Converting Inches to Pixels."); + return Application::GetDefaultDevice()->GetDPIX(); } case UnitTypeMillimeter: { - SAL_INFO("drawinglayer", "EMF+\t TODO Test Converting Millimeters to Pixels, if it is working correctly."); - return 3.779528f; + SAL_INFO("drawinglayer", "EMF+\t Converting Millimeters to Pixels"); + return Application::GetDefaultDevice()->GetDPIX() / 25.4; } case UnitTypeDocument: { - SAL_INFO("drawinglayer", "EMF+\t TODO Test Converting Documents to Pixels, if it is working correctly."); - return 0.32f; + SAL_INFO("drawinglayer", "EMF+\t Converting Documents to Pixels."); + return Application::GetDefaultDevice()->GetDPIX() / 300; } case UnitTypeWorld: case UnitTypeDisplay: + { + SAL_WARN("drawinglayer", "EMF+\t Converting to World/Display."); + return 1.0f; + } default: { SAL_WARN("drawinglayer", "EMF+\tTODO Unimplemented support of Unit Type: 0x" << std::hex << aUnitType); + return 1.0f; } } - return 1.0f; } void EmfPlusHelperData::processObjectRecord(SvMemoryStream& rObjectStream, sal_uInt16 flags, sal_uInt32 dataSize, bool bUseWholeStream) |