summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-02-16 09:03:09 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2021-02-16 12:11:46 +0100
commit537c60b9e5f2c72013d213159f16777f5e8a8803 (patch)
treee38199f6f7461104345de92c5ebb5f0307d6cc9e /sw
parent837a40ec436ab9425a663a96597ac4ecf6390712 (diff)
Use some more o3tl::convert
Change-Id: I811a00592c3ac5d8cc551090b847f80fc6673032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110918 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/attr/swatrset.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index aae6df77112b..24138b51f6bb 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -34,6 +34,7 @@
#include <numrule.hxx>
#include <pagedesc.hxx>
#include <paratr.hxx>
+#include <o3tl/unit_conversion.hxx>
#include <osl/diagnose.h>
#include <svl/whiter.hxx>
@@ -74,8 +75,8 @@ void SwAttrPool::createAndAddSecondaryPools()
// #75371# change DefaultItems for the SdrEdgeObj distance items
// to TWIPS.
- // 1/100th mm in twips
- const tools::Long nDefEdgeDist = (500 * 72) / 127;
+ constexpr tools::Long nDefEdgeDist
+ = o3tl::convert(500, o3tl::Length::mm100, o3tl::Length::twip);
pSdrPool->SetPoolDefaultItem(SdrEdgeNode1HorzDistItem(nDefEdgeDist));
pSdrPool->SetPoolDefaultItem(SdrEdgeNode1VertDistItem(nDefEdgeDist));
@@ -83,8 +84,10 @@ void SwAttrPool::createAndAddSecondaryPools()
pSdrPool->SetPoolDefaultItem(SdrEdgeNode2VertDistItem(nDefEdgeDist));
// #i33700# // Set shadow distance defaults as PoolDefaultItems
- pSdrPool->SetPoolDefaultItem(makeSdrShadowXDistItem((300 * 72) / 127));
- pSdrPool->SetPoolDefaultItem(makeSdrShadowYDistItem((300 * 72) / 127));
+ constexpr tools::Long nDefShadowDist
+ = o3tl::convert(300, o3tl::Length::mm100, o3tl::Length::twip);
+ pSdrPool->SetPoolDefaultItem(makeSdrShadowXDistItem(nDefShadowDist));
+ pSdrPool->SetPoolDefaultItem(makeSdrShadowYDistItem(nDefShadowDist));
SfxItemPool *pEEgPool = EditEngine::CreatePool();