summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-02-03 19:59:25 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-02-04 11:21:00 +0100
commitea771e85b2302829394df545bb82c02bff2750c2 (patch)
tree8ff097ea232a02968ee5e1312fb24b3d11507065 /cui/source
parentf2d62b11cd7d47925fd098b3947726313d6b296e (diff)
Resolves: tdf#146997 use sal_Int64 instead of sal_Int32 for spinbutton values
for these cases where draw wants to massively scale the units the underlying "metric conversion" are already using sal_Int64 anyway Change-Id: I94e120d72644319548f75b2f68cfe60d4829a2e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129356 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/tabpages/numpages.cxx2
-rw-r--r--cui/source/tabpages/transfrm.cxx10
2 files changed, 6 insertions, 6 deletions
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 5614c765ff7b..c28743eab125 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1617,7 +1617,7 @@ IMPL_LINK(SvxNumOptionsTabPage, AllLevelHdl_Impl, weld::SpinButton&, rBox, void)
if(nActNumLvl & nMask)
{
SvxNumberFormat aNumFmt(pActNum->GetLevel(e));
- aNumFmt.SetIncludeUpperLevels(static_cast<sal_uInt8>(std::min(rBox.get_value(), int(e + 1))) );
+ aNumFmt.SetIncludeUpperLevels(static_cast<sal_uInt8>(std::min(rBox.get_value(), sal_Int64(e + 1))) );
// Set the same prefix/suffix to generate list format with changed IncludedUpperLevels
aNumFmt.SetListFormat(aNumFmt.GetPrefix(), aNumFmt.GetSuffix(), e);
pActNum->SetLevel(e, aNumFmt);
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 04335500ea58..8ebe0af11597 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -1044,7 +1044,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
if (m_xMtrWidth->get_digits())
fTmpWidth *= pow(10.0, m_xMtrWidth->get_digits());
- m_xMtrWidth->set_value(static_cast<int>(fTmpWidth), FieldUnit::MM_100TH);
+ m_xMtrWidth->set_value(fTmpWidth, FieldUnit::MM_100TH);
}
{ // #i75273# set height
@@ -1053,7 +1053,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
if (m_xMtrHeight->get_digits())
fTmpHeight *= pow(10.0, m_xMtrHeight->get_digits());
- m_xMtrHeight->set_value(static_cast<int>(fTmpHeight), FieldUnit::MM_100TH);
+ m_xMtrHeight->set_value(fTmpHeight, FieldUnit::MM_100TH);
}
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_SIZE );
@@ -1271,7 +1271,7 @@ void SvxPositionSizeTabPage::SetMinMaxPosition()
}
}
- const double fMaxLong(static_cast<double>(vcl::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1));
+ const double fMaxLong(vcl::ConvertValue(std::numeric_limits<sal_Int64>::max(), 0, MapUnit::Map100thMM, meDlgUnit) - 1);
fLeft = std::clamp(fLeft, -fMaxLong, fMaxLong);
fRight = std::clamp(fRight, -fMaxLong, fMaxLong);
fTop = std::clamp(fTop, - fMaxLong, fMaxLong);
@@ -1503,7 +1503,7 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeWidthHdl, weld::MetricSpinButton&,
return;
sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast<double>(m_xMtrWidth->get_value(FieldUnit::NONE))) / mfOldWidth));
- int nMin, nMax;
+ sal_Int64 nMin, nMax;
m_xMtrHeight->get_range(nMin, nMax, FieldUnit::NONE);
if (nHeight <= nMax)
@@ -1526,7 +1526,7 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeHeightHdl, weld::MetricSpinButton&
return;
sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast<double>(m_xMtrHeight->get_value(FieldUnit::NONE))) / mfOldHeight));
- int nMin, nMax;
+ sal_Int64 nMin, nMax;
m_xMtrWidth->get_range(nMin, nMax, FieldUnit::NONE);
if (nWidth <= nMax)