summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-11-03 09:58:25 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-03 09:14:25 +0100
commit17dface79321c87b2d30a53a67aeda2e9f9dfff6 (patch)
treec2f7bc952071bfa7f3cee43a80eb544d4ffadb80 /sd
parent996ca8ecfde2c9aa2f8b188f1f8eec3a912b2cd2 (diff)
Drop TWIPS_PER_PIXEL and use o3tl::convert
Change-Id: I8ee3fddaccf6809c95319db1da9a1d2897d00c25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124626 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index c629f2ca87d0..d4304815519f 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -52,6 +52,7 @@
#include <editeng/UnoForbiddenCharsTable.hxx>
#include <svx/svdoutl.hxx>
#include <o3tl/safeint.hxx>
+#include <o3tl/unit_conversion.hxx>
#include <svx/UnoNamespaceMap.hxx>
#include <svx/svdlayer.hxx>
#include <svx/svdsob.hxx>
@@ -125,8 +126,6 @@
#include <tools/json_writer.hxx>
#include <tools/UnitConversion.hxx>
-#define TWIPS_PER_PIXEL 15
-
using namespace ::cppu;
using namespace ::com::sun::star;
using namespace ::sd;
@@ -2506,7 +2505,7 @@ void SdXImpressDocument::postMouseEvent(int nType, int nX, int nY, int nCount, i
if (!pViewShell)
return;
- double fScale = 1.0/TWIPS_PER_PIXEL;
+ constexpr double fScale = o3tl::convert(1.0, o3tl::Length::twip, o3tl::Length::px);
// check if user hit a chart which is being edited by him
LokChartHelper aChartHelper(pViewShell->GetViewShell());
@@ -2578,7 +2577,7 @@ void SdXImpressDocument::setGraphicSelection(int nType, int nX, int nY)
if (!pViewShell)
return;
- double fScale = 1.0/TWIPS_PER_PIXEL;
+ constexpr double fScale = o3tl::convert(1.0, o3tl::Length::twip, o3tl::Length::px);
LokChartHelper aChartHelper(pViewShell->GetViewShell());
if (aChartHelper.setGraphicSelection(nType, nX, nY, fScale, fScale))