summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-11 21:59:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-12 07:37:13 +0100
commit48b667a7e7d25f835f95df89162a7849d6972531 (patch)
tree50d900c95e6b2ae6bac6919a350ca3a2fd71c943 /starmath
parent693553210828538680408832157faad9654758c8 (diff)
remove Fraction::operator tools::Long()
which was added in commit 331e2e5ed3bf4e0b2c1fab3b7bca836170317827 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Sep 14 08:49:52 2017 +0200 long->sal_Int32 in Fraction presumably to make the change impact less code. Instead, update the call sites to reflect the actual bitwidth of the data we will be receiving. Change-Id: If2a678b1cf534f39cb8cb249757462be53658309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105607 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/mathmlimport.cxx4
-rw-r--r--starmath/source/node.cxx6
-rw-r--r--starmath/source/utility.cxx4
-rw-r--r--starmath/source/view.cxx10
4 files changed, 12 insertions, 12 deletions
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 7a3ca34b9a5a..510b24852cee 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -1504,12 +1504,12 @@ bool lcl_CountBlanks(const MathMLAttributeLengthValue &rLV,
return false;
const Fraction aTwo(2, 1);
auto aWide = rLV.aNumber / aTwo;
- auto nWide = static_cast<sal_Int32>(static_cast<tools::Long>(aWide));
+ auto nWide = static_cast<sal_Int32>(aWide);
if (nWide < 0)
return false;
const Fraction aPointFive(1, 2);
auto aNarrow = (rLV.aNumber - Fraction(nWide, 1) * aTwo) / aPointFive;
- auto nNarrow = static_cast<sal_Int32>(static_cast<tools::Long>(aNarrow));
+ auto nNarrow = static_cast<sal_Int32>(aNarrow);
if (nNarrow < 0)
return false;
*pWide = nWide;
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 3c78de3ba5b0..6e88cff4dce0 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -154,7 +154,7 @@ void SmNode::SetFontSize(const Fraction &rSize, FontSizeType nType)
{
Fraction aVal (SmPtsTo100th_mm(rSize.GetNumerator()),
rSize.GetDenominator());
- tools::Long nHeight = static_cast<tools::Long>(aVal);
+ tools::Long nHeight = static_cast<sal_Int32>(aVal);
aFntSize = GetFont().GetFontSize();
aFntSize.setWidth( 0 );
@@ -173,12 +173,12 @@ void SmNode::SetFontSize(const Fraction &rSize, FontSizeType nType)
break;
case FontSizeType::MULTIPLY:
- aFntSize.setHeight( static_cast<tools::Long>(Fraction(aFntSize.Height()) * rSize) );
+ aFntSize.setHeight( static_cast<sal_Int32>(Fraction(aFntSize.Height()) * rSize) );
break;
case FontSizeType::DIVIDE:
if (rSize != Fraction(0))
- aFntSize.setHeight( static_cast<tools::Long>(Fraction(aFntSize.Height()) / rSize) );
+ aFntSize.setHeight( static_cast<sal_Int32>(Fraction(aFntSize.Height()) / rSize) );
break;
default:
break;
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index 7012004bea94..8e04a3c0073d 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -230,8 +230,8 @@ SmFace & operator *= (SmFace &rFace, const Fraction &rFrac)
// It's main use is to make scaling fonts look easier.
{ const Size &rFaceSize = rFace.GetFontSize();
- rFace.SetSize(Size(tools::Long(rFaceSize.Width() * rFrac),
- tools::Long(rFaceSize.Height() * rFrac)));
+ rFace.SetSize(Size(sal_Int32(rFaceSize.Width() * rFrac),
+ sal_Int32(rFaceSize.Height() * rFrac)));
return rFace;
}
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 638a41b2daa2..b893dfb88529 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -906,7 +906,7 @@ void SmViewShell::QueryObjAreaPixel( tools::Rectangle& rRect ) const
void SmViewShell::SetZoomFactor( const Fraction &rX, const Fraction &rY )
{
const Fraction &rFrac = std::min(rX, rY);
- GetGraphicWindow().SetZoom(sal::static_int_cast<sal_uInt16>(tools::Long(rFrac * Fraction( 100, 1 ))));
+ GetGraphicWindow().SetZoom(sal::static_int_cast<sal_uInt16>(sal_Int32(rFrac * Fraction( 100, 1 ))));
//To avoid rounding errors base class regulates crooked values too
//if necessary
@@ -1190,8 +1190,8 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri
Size OutputSize (rOutDev.LogicToPixel(Size(aOutRect.GetWidth(),
aOutRect.GetHeight()), MapMode(MapUnit::Map100thMM)));
Size GraphicSize (rOutDev.LogicToPixel(aSize, MapMode(MapUnit::Map100thMM)));
- sal_uInt16 nZ = sal::static_int_cast<sal_uInt16>(std::min(tools::Long(Fraction(OutputSize.Width() * 100, GraphicSize.Width())),
- tools::Long(Fraction(OutputSize.Height() * 100, GraphicSize.Height()))));
+ sal_uInt16 nZ = sal::static_int_cast<sal_uInt16>(std::min(sal_Int32(Fraction(OutputSize.Width() * 100, GraphicSize.Width())),
+ sal_Int32(Fraction(OutputSize.Height() * 100, GraphicSize.Height()))));
nZ -= 10;
Fraction aFraction (std::max(MINZOOM, std::min(MAXZOOM, nZ)), 100);
@@ -2012,8 +2012,8 @@ void SmViewShell::ZoomByItemSet(const SfxItemSet *pSet)
Size OutputSize(pPrinter->LogicToPixel(Size(OutputRect.GetWidth(),
OutputRect.GetHeight()), aMap));
Size GraphicSize(pPrinter->LogicToPixel(GetDoc()->GetSize(), aMap));
- sal_uInt16 nZ = sal::static_int_cast<sal_uInt16>(std::min(tools::Long(Fraction(OutputSize.Width() * 100, GraphicSize.Width())),
- tools::Long(Fraction(OutputSize.Height() * 100, GraphicSize.Height()))));
+ sal_uInt16 nZ = sal::static_int_cast<sal_uInt16>(std::min(sal_Int32(Fraction(OutputSize.Width() * 100, GraphicSize.Width())),
+ sal_Int32(Fraction(OutputSize.Height() * 100, GraphicSize.Height()))));
mpGraphic->SetZoom (nZ);
break;
}