diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-11 21:59:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-12 07:37:13 +0100 |
commit | 48b667a7e7d25f835f95df89162a7849d6972531 (patch) | |
tree | 50d900c95e6b2ae6bac6919a350ca3a2fd71c943 /svx | |
parent | 693553210828538680408832157faad9654758c8 (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 'svx')
-rw-r--r-- | svx/source/form/fmvwimp.cxx | 12 | ||||
-rw-r--r-- | svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 16 | ||||
-rw-r--r-- | svx/source/svdraw/svdoole2.cxx | 20 |
3 files changed, 24 insertions, 24 deletions
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 148eba130028..eb54d39e4a09 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1441,8 +1441,8 @@ SdrObjectUniquePtr FmXFormView::implCreateXFormsControl( const svx::OXFormsDescr getView()->getSdrModelFromSdrView(), SdrInventor::FmForm, nObjID)); - controlSize.setWidth( tools::Long(controlSize.Width() * eTargetMode.GetScaleX()) ); - controlSize.setHeight( tools::Long(controlSize.Height() * eTargetMode.GetScaleY()) ); + controlSize.setWidth( sal_Int32(controlSize.Width() * eTargetMode.GetScaleX()) ); + controlSize.setHeight( sal_Int32(controlSize.Height() * eTargetMode.GetScaleY()) ); ::Point controlPos( OutputDevice::LogicToLogic( ::Point( controlSize.Width(), 0 ), eSourceMode, eTargetMode ) ); ::tools::Rectangle controlRect( controlPos, OutputDevice::LogicToLogic( controlSize, eSourceMode, eTargetMode ) ); pControl->SetLogicRect(controlRect); @@ -1548,8 +1548,8 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int aRealSize.setHeight( aDefSize.Height() ); // adjust to scaling of the target device (#53523#) - aRealSize.setWidth( tools::Long(Fraction(aRealSize.Width(), 1) * eTargetMode.GetScaleX()) ); - aRealSize.setHeight( tools::Long(Fraction(aRealSize.Height(), 1) * eTargetMode.GetScaleY()) ); + aRealSize.setWidth( sal_Int32(Fraction(aRealSize.Width(), 1) * eTargetMode.GetScaleX()) ); + aRealSize.setHeight( sal_Int32(Fraction(aRealSize.Height(), 1) * eTargetMode.GetScaleY()) ); // for boolean fields, we do not create a label, but just a checkbox bool bNeedLabel = ( _nControlObjectID != OBJ_FM_CHECKBOX ); @@ -1626,8 +1626,8 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int if ( OBJ_FM_IMAGECONTROL == _nControlObjectID ) aControlSize = aDefImageSize; - aControlSize.setWidth( tools::Long(Fraction(aControlSize.Width(), 1) * eTargetMode.GetScaleX()) ); - aControlSize.setHeight( tools::Long(Fraction(aControlSize.Height(), 1) * eTargetMode.GetScaleY()) ); + aControlSize.setWidth( sal_Int32(Fraction(aControlSize.Width(), 1) * eTargetMode.GetScaleX()) ); + aControlSize.setHeight( sal_Int32(Fraction(aControlSize.Height(), 1) * eTargetMode.GetScaleY()) ); pControl->SetLogicRect( ::tools::Rectangle( OutputDevice::LogicToLogic( ::Point( aRealSize.Width() + _nXOffsetMM, _nYOffsetMM ), eSourceMode, eTargetMode ), diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 47a7d405c6e5..6e03d307033e 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -408,7 +408,7 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosXHdl, weld::MetricSpinButton&, v tools::Long lX = GetCoreValue( *mxMtrPosX, mePoolUnit ); Fraction aUIScale = mpView->GetModel()->GetUIScale(); - lX = tools::Long( lX * aUIScale ); + lX = sal_Int32( lX * aUIScale ); SfxInt32Item aPosXItem( SID_ATTR_TRANSFORM_POS_X,static_cast<sal_uInt32>(lX)); @@ -424,7 +424,7 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYHdl, weld::MetricSpinButton&, v tools::Long lY = GetCoreValue( *mxMtrPosY, mePoolUnit ); Fraction aUIScale = mpView->GetModel()->GetUIScale(); - lY = tools::Long( lY * aUIScale ); + lY = sal_Int32( lY * aUIScale ); SfxInt32Item aPosYItem( SID_ATTR_TRANSFORM_POS_Y,static_cast<sal_uInt32>(lY)); @@ -519,7 +519,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( if(pWidthItem) { - tools::Long lOldWidth1 = tools::Long( pWidthItem->GetValue() / maUIScale ); + tools::Long lOldWidth1 = sal_Int32( pWidthItem->GetValue() / maUIScale ); SetFieldUnit( *mxMtrWidth, meDlgUnit, true ); SetMetricValue( *mxMtrWidth, lOldWidth1, mePoolUnit ); limitWidth(*mxMtrWidth); @@ -539,7 +539,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( if(pHeightItem) { - tools::Long nTmp = tools::Long( pHeightItem->GetValue() / maUIScale); + tools::Long nTmp = sal_Int32( pHeightItem->GetValue() / maUIScale); SetFieldUnit( *mxMtrHeight, meDlgUnit, true ); SetMetricValue( *mxMtrHeight, nTmp, mePoolUnit ); limitWidth(*mxMtrHeight); @@ -559,7 +559,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( if(pItem) { - tools::Long nTmp = tools::Long(pItem->GetValue() / maUIScale); + tools::Long nTmp = sal_Int32(pItem->GetValue() / maUIScale); SetFieldUnit( *mxMtrPosX, meDlgUnit, true ); SetMetricValue( *mxMtrPosX, nTmp, mePoolUnit ); limitWidth(*mxMtrPosX); @@ -578,7 +578,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( if(pItem) { - tools::Long nTmp = tools::Long(pItem->GetValue() / maUIScale); + tools::Long nTmp = sal_Int32(pItem->GetValue() / maUIScale); SetFieldUnit( *mxMtrPosY, meDlgUnit, true ); SetMetricValue( *mxMtrPosY, nTmp, mePoolUnit ); limitWidth(*mxMtrPosY); @@ -598,7 +598,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( if(pItem) { mlRotX = pItem->GetValue(); - mlRotX = tools::Long( mlRotX / maUIScale ); + mlRotX = sal_Int32( mlRotX / maUIScale ); } } break; @@ -611,7 +611,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( if(pItem) { mlRotY = pItem->GetValue(); - mlRotY = tools::Long( mlRotY / maUIScale ); + mlRotY = sal_Int32( mlRotY / maUIScale ); } } break; diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 23eb06465e87..7de164bcafd5 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -180,8 +180,8 @@ tools::Rectangle SdrLightEmbeddedClient_Impl::impl_getScaledRect_nothrow() const { tools::Rectangle aLogicRect( mpObj->GetLogicRect() ); // apply scaling to object area and convert to pixels - aLogicRect.SetSize( Size( tools::Long( aLogicRect.GetWidth() * m_aScaleWidth), - tools::Long( aLogicRect.GetHeight() * m_aScaleHeight) ) ); + aLogicRect.SetSize( Size( sal_Int32( aLogicRect.GetWidth() * m_aScaleWidth), + sal_Int32( aLogicRect.GetHeight() * m_aScaleHeight) ) ); return aLogicRect; } @@ -259,8 +259,8 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj aVisArea.SetSize( Size( aSz.Width, aSz.Height ) ); aVisArea = OutputDevice::LogicToLogic(aVisArea, MapMode(aObjMapUnit), MapMode(aContainerMapUnit)); - Size aScaledSize( static_cast< tools::Long >( m_aScaleWidth * Fraction( aVisArea.GetWidth() ) ), - static_cast< tools::Long >( m_aScaleHeight * Fraction( aVisArea.GetHeight() ) ) ); + Size aScaledSize( static_cast< sal_Int32 >( m_aScaleWidth * Fraction( aVisArea.GetWidth() ) ), + static_cast< sal_Int32 >( m_aScaleHeight * Fraction( aVisArea.GetHeight() ) ) ); tools::Rectangle aLogicRect( mpObj->GetLogicRect() ); // react to the change if the difference is bigger than one pixel @@ -500,8 +500,8 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl //SfxBooleanFlagGuard aGuard( m_bResizeNoScale, true ); // new size of the object area without scaling - Size aNewObjSize( tools::Long( aNewLogicRect.GetWidth() / m_aScaleWidth ), - tools::Long( aNewLogicRect.GetHeight() / m_aScaleHeight ) ); + Size aNewObjSize( sal_Int32( aNewLogicRect.GetWidth() / m_aScaleWidth ), + sal_Int32( aNewLogicRect.GetHeight() / m_aScaleHeight ) ); // now remove scaling from new placement and keep this at the new object area aNewLogicRect.SetSize( aNewObjSize ); @@ -1488,8 +1488,8 @@ void SdrOle2Obj::ImpSetVisAreaSize() // objects' visual area. The scaling will not change, but it might exist already and must // be used in calculations MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) ); - Size aVisSize( static_cast<tools::Long>( Fraction( maRect.GetWidth() ) / aScaleWidth ), - static_cast<tools::Long>( Fraction( maRect.GetHeight() ) / aScaleHeight ) ); + Size aVisSize( static_cast<sal_Int32>( Fraction( maRect.GetWidth() ) / aScaleWidth ), + static_cast<sal_Int32>( Fraction( maRect.GetHeight() ) / aScaleHeight ) ); aVisSize = OutputDevice::LogicToLogic( aVisSize, @@ -1508,8 +1508,8 @@ void SdrOle2Obj::ImpSetVisAreaSize() {} tools::Rectangle aAcceptedVisArea; - aAcceptedVisArea.SetSize( Size( static_cast<tools::Long>( Fraction( tools::Long( aSz.Width ) ) * aScaleWidth ), - static_cast<tools::Long>( Fraction( tools::Long( aSz.Height ) ) * aScaleHeight ) ) ); + aAcceptedVisArea.SetSize( Size( static_cast<sal_Int32>( Fraction( tools::Long( aSz.Width ) ) * aScaleWidth ), + static_cast<sal_Int32>( Fraction( tools::Long( aSz.Height ) ) * aScaleHeight ) ) ); if (aVisSize != aAcceptedVisArea.GetSize()) { // server changed VisArea to its liking and the VisArea is different than the suggested one |