From fa339b3adb53300ae68913bed87e18caf9f2e262 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Tue, 10 Aug 2021 08:10:19 +0900 Subject: convert some LogicToLogic calls to use o3tl::convert instead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a LogicToLogic uses fixed units, we can use o3tl::convert instead. We can also do the same for all other cases where LogicToLogic is used, but that needs additional investigation to determine if it is safe to do so. Note: MapUnit::Pixel is converted to o3tl::Length::pt because it assumed 72 PPI for a logical pixel, which corresponds with the conversion rate of a point (72 PPI). Today, 96 PPI is standard, which is also used for o3tl::Length:px. Change-Id: I29126df38bfcfda74b5d83d4cb880a378aecd18b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120230 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- sw/source/uibase/shells/textsh.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sw/source/uibase/shells/textsh.cxx') diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 114ce385e4d3..76be2461935a 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -351,8 +351,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) if(pItem && xObj.is()) { Size aSize(static_cast(pItem)->GetSize()); - aSize = OutputDevice::LogicToLogic - ( aSize, MapMode( MapUnit::MapTwip ), MapMode( MapUnit::Map100thMM ) ); + aSize = o3tl::convert(aSize, o3tl::Length::twip, o3tl::Length::mm100); if(aSize.Width() > MINLAY&& aSize.Height()> MINLAY) { -- cgit