summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-11-12 09:32:02 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-12 16:53:22 +0100
commitc45753847dfc2b4645dc2f7500a18ec2c5d438df (patch)
tree8d04962d7a4367a92d220beb0c35effb9490395b /svx
parent768cfcee178b284be6d96d384364e59e40ecb375 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/fmvwimp.cxx12
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx16
-rw-r--r--svx/source/svdraw/svdoole2.cxx20
3 files changed, 24 insertions, 24 deletions
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index eb54d39e4a09..148eba130028 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( sal_Int32(controlSize.Width() * eTargetMode.GetScaleX()) );
- controlSize.setHeight( sal_Int32(controlSize.Height() * eTargetMode.GetScaleY()) );
+ controlSize.setWidth( tools::Long(controlSize.Width() * eTargetMode.GetScaleX()) );
+ controlSize.setHeight( tools::Long(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( sal_Int32(Fraction(aRealSize.Width(), 1) * eTargetMode.GetScaleX()) );
- aRealSize.setHeight( sal_Int32(Fraction(aRealSize.Height(), 1) * eTargetMode.GetScaleY()) );
+ aRealSize.setWidth( tools::Long(Fraction(aRealSize.Width(), 1) * eTargetMode.GetScaleX()) );
+ aRealSize.setHeight( tools::Long(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( sal_Int32(Fraction(aControlSize.Width(), 1) * eTargetMode.GetScaleX()) );
- aControlSize.setHeight( sal_Int32(Fraction(aControlSize.Height(), 1) * eTargetMode.GetScaleY()) );
+ aControlSize.setWidth( tools::Long(Fraction(aControlSize.Width(), 1) * eTargetMode.GetScaleX()) );
+ aControlSize.setHeight( tools::Long(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 6e03d307033e..47a7d405c6e5 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 = sal_Int32( lX * aUIScale );
+ lX = tools::Long( 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 = sal_Int32( lY * aUIScale );
+ lY = tools::Long( 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 = sal_Int32( pWidthItem->GetValue() / maUIScale );
+ tools::Long lOldWidth1 = tools::Long( 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 = sal_Int32( pHeightItem->GetValue() / maUIScale);
+ tools::Long nTmp = tools::Long( 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 = sal_Int32(pItem->GetValue() / maUIScale);
+ tools::Long nTmp = tools::Long(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 = sal_Int32(pItem->GetValue() / maUIScale);
+ tools::Long nTmp = tools::Long(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 = sal_Int32( mlRotX / maUIScale );
+ mlRotX = tools::Long( mlRotX / maUIScale );
}
}
break;
@@ -611,7 +611,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
if(pItem)
{
mlRotY = pItem->GetValue();
- mlRotY = sal_Int32( mlRotY / maUIScale );
+ mlRotY = tools::Long( mlRotY / maUIScale );
}
}
break;
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 7de164bcafd5..23eb06465e87 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( sal_Int32( aLogicRect.GetWidth() * m_aScaleWidth),
- sal_Int32( aLogicRect.GetHeight() * m_aScaleHeight) ) );
+ aLogicRect.SetSize( Size( tools::Long( aLogicRect.GetWidth() * m_aScaleWidth),
+ tools::Long( 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< sal_Int32 >( m_aScaleWidth * Fraction( aVisArea.GetWidth() ) ),
- static_cast< sal_Int32 >( m_aScaleHeight * Fraction( aVisArea.GetHeight() ) ) );
+ Size aScaledSize( static_cast< tools::Long >( m_aScaleWidth * Fraction( aVisArea.GetWidth() ) ),
+ static_cast< tools::Long >( 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( sal_Int32( aNewLogicRect.GetWidth() / m_aScaleWidth ),
- sal_Int32( aNewLogicRect.GetHeight() / m_aScaleHeight ) );
+ Size aNewObjSize( tools::Long( aNewLogicRect.GetWidth() / m_aScaleWidth ),
+ tools::Long( 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<sal_Int32>( Fraction( maRect.GetWidth() ) / aScaleWidth ),
- static_cast<sal_Int32>( Fraction( maRect.GetHeight() ) / aScaleHeight ) );
+ Size aVisSize( static_cast<tools::Long>( Fraction( maRect.GetWidth() ) / aScaleWidth ),
+ static_cast<tools::Long>( Fraction( maRect.GetHeight() ) / aScaleHeight ) );
aVisSize = OutputDevice::LogicToLogic(
aVisSize,
@@ -1508,8 +1508,8 @@ void SdrOle2Obj::ImpSetVisAreaSize()
{}
tools::Rectangle aAcceptedVisArea;
- aAcceptedVisArea.SetSize( Size( static_cast<sal_Int32>( Fraction( tools::Long( aSz.Width ) ) * aScaleWidth ),
- static_cast<sal_Int32>( Fraction( tools::Long( aSz.Height ) ) * aScaleHeight ) ) );
+ aAcceptedVisArea.SetSize( Size( static_cast<tools::Long>( Fraction( tools::Long( aSz.Width ) ) * aScaleWidth ),
+ static_cast<tools::Long>( 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