From 02fddd1105f6314864aec6e4d517a108244d034c Mon Sep 17 00:00:00 2001 From: Ujjawal Kumar Date: Wed, 11 Mar 2026 22:51:03 +0530 Subject: [PATCH] Change data type from tools::Long to appropriate data types in md import Change-Id: I36185a0d423ffb1ce18d8a0b7139b2c55197b54e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201590 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mike Kaganski (cherry picked from commit 2a9e17b75acc53e2ddd9b54bf1de0f991be968ca) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204595 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sw/source/filter/md/mdnum.hxx | 4 ++-- sw/source/filter/md/swmd.cxx | 8 ++++---- sw/source/filter/md/swmd.hxx | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sw/source/filter/md/mdnum.hxx b/sw/source/filter/md/mdnum.hxx index 27f08172f30a..9e32a2dbdbde 100644 --- a/sw/source/filter/md/mdnum.hxx +++ b/sw/source/filter/md/mdnum.hxx @@ -22,8 +22,8 @@ #include #include -constexpr tools::Long MD_NUMBER_BULLET_MARGINLEFT = o3tl::toTwips(125, o3tl::Length::mm10); -constexpr tools::Long MD_NUMBER_BULLET_INDENT = -o3tl::toTwips(5, o3tl::Length::mm); +constexpr sal_Int32 MD_NUMBER_BULLET_MARGINLEFT = o3tl::toTwips(125, o3tl::Length::mm10); +constexpr sal_Int32 MD_NUMBER_BULLET_INDENT = -o3tl::toTwips(5, o3tl::Length::mm); class SwTextNode; class SwNumRule; diff --git a/sw/source/filter/md/swmd.cxx b/sw/source/filter/md/swmd.cxx index 26b6e3d247e0..fe9b731f0821 100644 --- a/sw/source/filter/md/swmd.cxx +++ b/sw/source/filter/md/swmd.cxx @@ -701,8 +701,8 @@ void SwMarkdownParser::InsertImage(const MDImage& rImg) aGrfSz = o3tl::convert(aGraphic.GetSizePixel(), o3tl::Length::px, o3tl::Length::twip); } - tools::Long nWidth = 0; - tools::Long nHeight = 0; + sal_Int64 nWidth = 0; + sal_Int64 nHeight = 0; if (!aGrfSz.IsEmpty()) { nWidth = aGrfSz.getWidth(); @@ -712,8 +712,8 @@ void SwMarkdownParser::InsertImage(const MDImage& rImg) double fScaleX = static_cast(MD_MAX_IMAGE_WIDTH_IN_TWIPS) / nWidth; double fScaleY = static_cast(MD_MAX_IMAGE_HEIGHT_IN_TWIPS) / nHeight; double fScale = std::min(fScaleX, fScaleY); - nWidth = static_cast(nWidth * fScale); - nHeight = static_cast(nHeight * fScale); + nWidth = static_cast(nWidth * fScale); + nHeight = static_cast(nHeight * fScale); } if (nWidth < MD_MIN_IMAGE_WIDTH_IN_TWIPS && nWidth < MD_MIN_IMAGE_HEIGHT_IN_TWIPS) { diff --git a/sw/source/filter/md/swmd.hxx b/sw/source/filter/md/swmd.hxx index 37175955f5c6..cab016c78b11 100644 --- a/sw/source/filter/md/swmd.hxx +++ b/sw/source/filter/md/swmd.hxx @@ -50,11 +50,11 @@ struct MDImage } }; -constexpr tools::Long MD_PARSPACE = o3tl::toTwips(5, o3tl::Length::mm); -constexpr tools::Long MD_MAX_IMAGE_WIDTH_IN_TWIPS = 5000; -constexpr tools::Long MD_MAX_IMAGE_HEIGHT_IN_TWIPS = 5000; -constexpr tools::Long MD_MIN_IMAGE_WIDTH_IN_TWIPS = 500; -constexpr tools::Long MD_MIN_IMAGE_HEIGHT_IN_TWIPS = 500; +constexpr sal_uInt16 MD_PARSPACE = o3tl::toTwips(5, o3tl::Length::mm); +constexpr sal_Int64 MD_MAX_IMAGE_WIDTH_IN_TWIPS = 5000; +constexpr sal_Int64 MD_MAX_IMAGE_HEIGHT_IN_TWIPS = 5000; +constexpr sal_Int64 MD_MIN_IMAGE_WIDTH_IN_TWIPS = 500; +constexpr sal_Int64 MD_MIN_IMAGE_HEIGHT_IN_TWIPS = 500; constexpr frozen::unordered_map adjustMap = { { MD_ALIGN_DEFAULT, SvxAdjust::Left }, @@ -90,7 +90,7 @@ class SwMarkdownParser OUString m_sBaseURL; sal_Int32 m_nBlockQuoteDepth = -1; - tools::Long m_nProgress = 0; + sal_uInt64 m_nProgress = 0; bool m_bNewDoc; bool m_bNoParSpace = true;