From c45753847dfc2b4645dc2f7500a18ec2c5d438df Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 12 Nov 2020 09:32:02 +0100 Subject: Revert "remove Fraction::operator tools::Long()" This reverts commit 48b667a7e7d25f835f95df89162a7849d6972531. Reason for revert: some discussion required Change-Id: Ia0990d280837fb68b7ddc9f472ec78b1467b4311 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105540 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/filter/writer/wrtswtbl.cxx | 4 ++-- sw/source/filter/ww8/writerhelper.cxx | 2 +- sw/source/filter/ww8/ww8graf.cxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sw/source/filter') diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx index b98a76cc3a5b..6a699d6c0674 100644 --- a/sw/source/filter/writer/wrtswtbl.cxx +++ b/sw/source/filter/writer/wrtswtbl.cxx @@ -343,7 +343,7 @@ sal_uInt16 SwWriteTable::GetRelWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) con { tools::Long nWidth = GetRawWidth( nCol, nColSpan ); - return static_cast(static_cast(Fraction( nWidth*256 + GetBaseWidth()/2, + return static_cast(static_cast(Fraction( nWidth*256 + GetBaseWidth()/2, GetBaseWidth() ))); } @@ -353,7 +353,7 @@ sal_uInt16 SwWriteTable::GetPercentWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) // Looks funny, but is nothing more than // [(100 * nWidth) + .5] without rounding errors - return static_cast(static_cast(Fraction( nWidth*100 + GetBaseWidth()/2, + return static_cast(static_cast(Fraction( nWidth*100 + GetBaseWidth()/2, GetBaseWidth() ))); } diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index c6a29d5cab17..97f09efba839 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -682,7 +682,7 @@ namespace sw const Size &rSize = pNd->GetTwipSize(); Fraction aMoveHack(ww::nWrap100Percent, rSize.Width()); aMoveHack *= Fraction(15, 1); - sal_Int32 nMove(aMoveHack); + tools::Long nMove(aMoveHack); Fraction aHackX(ww::nWrap100Percent + nMove, ww::nWrap100Percent); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index bb9eb4fb2cdc..c141c857f37c 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2050,7 +2050,7 @@ void SwWW8ImplReader::MapWrapIntoFlyFormat(SvxMSDffImportRec const * pRecord, */ Fraction aMoveHack(ww::nWrap100Percent, rSize.Width()); aMoveHack *= Fraction(15, 1); - sal_Int32 nMove(aMoveHack); + tools::Long nMove(aMoveHack); aPoly.Move(nMove, 0); Fraction aHackX(ww::nWrap100Percent, ww::nWrap100Percent + nMove); -- cgit