summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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 'sd')
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx2
-rw-r--r--sd/source/ui/dlg/copydlg.cxx36
-rw-r--r--sd/source/ui/docshell/sdclient.cxx4
-rw-r--r--sd/source/ui/view/drviewsa.cxx20
-rw-r--r--sd/source/ui/view/sdwindow.cxx2
5 files changed, 32 insertions, 32 deletions
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index b9297961f82a..13a66c9263db 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -348,7 +348,7 @@ void AnnotationWindow::Rescale()
if ( mpMeta )
{
vcl::Font aFont( mpMeta->GetSettings().GetStyleSettings().GetLabelFont() );
- sal_Int32 nHeight = ::tools::Long(aFont.GetFontHeight() * aMode.GetScaleY());
+ sal_Int32 nHeight = sal_Int32(aFont.GetFontHeight() * aMode.GetScaleY());
aFont.SetFontHeight( nHeight );
mpMeta->SetControlFont( aFont );
}
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx
index 398f9e4ee567..534ebd8eeb2f 100644
--- a/sd/source/ui/dlg/copydlg.cxx
+++ b/sd/source/ui/dlg/copydlg.cxx
@@ -94,10 +94,10 @@ void CopyDlg::Reset()
// tdf#125011 draw/impress sizes are in mm_100th already, "normalize" to
// decimal shift by number of decimal places the widgets are using (2) then
// scale by the ui scaling factor
- auto nPageWidth = tools::Long(m_xMtrFldMoveX->normalize(aPageSize.Width()) / maUIScale);
- auto nPageHeight = tools::Long(m_xMtrFldMoveX->normalize(aPageSize.Height()) / maUIScale);
- auto nRectWidth = tools::Long(m_xMtrFldMoveX->normalize(aRect.GetWidth()) / maUIScale);
- auto nRectHeight = tools::Long(m_xMtrFldMoveX->normalize(aRect.GetHeight()) / maUIScale);
+ auto nPageWidth = sal_Int32(m_xMtrFldMoveX->normalize(aPageSize.Width()) / maUIScale);
+ auto nPageHeight = sal_Int32(m_xMtrFldMoveX->normalize(aPageSize.Height()) / maUIScale);
+ auto nRectWidth = sal_Int32(m_xMtrFldMoveX->normalize(aRect.GetWidth()) / maUIScale);
+ auto nRectHeight = sal_Int32(m_xMtrFldMoveX->normalize(aRect.GetHeight()) / maUIScale);
m_xMtrFldMoveX->set_range(-nPageWidth, nPageWidth, FieldUnit::MM_100TH);
m_xMtrFldMoveY->set_range(-nPageHeight, nPageHeight, FieldUnit::MM_100TH);
@@ -123,12 +123,12 @@ void CopyDlg::Reset()
tools::Long nMoveX = 500;
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) )
nMoveX = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
- SetMetricValue( *m_xMtrFldMoveX, tools::Long(nMoveX / maUIScale), MapUnit::Map100thMM);
+ SetMetricValue( *m_xMtrFldMoveX, sal_Int32(nMoveX / maUIScale), MapUnit::Map100thMM);
tools::Long nMoveY = 500;
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) )
nMoveY = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
- SetMetricValue( *m_xMtrFldMoveY, tools::Long(nMoveY / maUIScale), MapUnit::Map100thMM);
+ SetMetricValue( *m_xMtrFldMoveY, sal_Int32(nMoveY / maUIScale), MapUnit::Map100thMM);
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) )
m_xMtrFldAngle->set_value(static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(), FieldUnit::NONE);
@@ -138,12 +138,12 @@ void CopyDlg::Reset()
tools::Long nWidth = 0;
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) )
nWidth = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
- SetMetricValue( *m_xMtrFldWidth, tools::Long(nWidth / maUIScale), MapUnit::Map100thMM);
+ SetMetricValue( *m_xMtrFldWidth, sal_Int32(nWidth / maUIScale), MapUnit::Map100thMM);
tools::Long nHeight = 0;
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) )
nHeight = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
- SetMetricValue( *m_xMtrFldHeight, tools::Long(nHeight / maUIScale), MapUnit::Map100thMM);
+ SetMetricValue( *m_xMtrFldHeight, sal_Int32(nHeight / maUIScale), MapUnit::Map100thMM);
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) )
{
@@ -179,10 +179,10 @@ void CopyDlg::Reset()
*/
void CopyDlg::GetAttr( SfxItemSet& rOutAttrs )
{
- tools::Long nMoveX = tools::Long( GetCoreValue( *m_xMtrFldMoveX, MapUnit::Map100thMM) * maUIScale);
- tools::Long nMoveY = tools::Long( GetCoreValue( *m_xMtrFldMoveY, MapUnit::Map100thMM) * maUIScale);
- tools::Long nHeight = tools::Long( GetCoreValue( *m_xMtrFldHeight, MapUnit::Map100thMM) * maUIScale);
- tools::Long nWidth = tools::Long( GetCoreValue( *m_xMtrFldWidth, MapUnit::Map100thMM) * maUIScale);
+ tools::Long nMoveX = sal_Int32( GetCoreValue( *m_xMtrFldMoveX, MapUnit::Map100thMM) * maUIScale);
+ tools::Long nMoveY = sal_Int32( GetCoreValue( *m_xMtrFldMoveY, MapUnit::Map100thMM) * maUIScale);
+ tools::Long nHeight = sal_Int32( GetCoreValue( *m_xMtrFldHeight, MapUnit::Map100thMM) * maUIScale);
+ tools::Long nWidth = sal_Int32( GetCoreValue( *m_xMtrFldWidth, MapUnit::Map100thMM) * maUIScale);
rOutAttrs.Put( SfxUInt16Item( ATTR_COPY_NUMBER, static_cast<sal_uInt16>(m_xNumFldCopies->get_value()) ) );
rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_X, nMoveX ) );
@@ -219,9 +219,9 @@ IMPL_LINK_NOARG(CopyDlg, SetViewData, weld::Button&, void)
{
::tools::Rectangle aRect = mpView->GetAllMarkedRect();
- SetMetricValue( *m_xMtrFldMoveX, tools::Long( aRect.GetWidth() /
+ SetMetricValue( *m_xMtrFldMoveX, sal_Int32( aRect.GetWidth() /
maUIScale ), MapUnit::Map100thMM);
- SetMetricValue( *m_xMtrFldMoveY, tools::Long( aRect.GetHeight() /
+ SetMetricValue( *m_xMtrFldMoveY, sal_Int32( aRect.GetHeight() /
maUIScale ), MapUnit::Map100thMM);
// sets color attribute
@@ -241,13 +241,13 @@ IMPL_LINK_NOARG(CopyDlg, SetDefault, weld::Button&, void)
m_xNumFldCopies->set_value(1);
tools::Long nValue = 500;
- SetMetricValue( *m_xMtrFldMoveX, tools::Long(nValue / maUIScale), MapUnit::Map100thMM);
- SetMetricValue( *m_xMtrFldMoveY, tools::Long(nValue / maUIScale), MapUnit::Map100thMM);
+ SetMetricValue( *m_xMtrFldMoveX, sal_Int32(nValue / maUIScale), MapUnit::Map100thMM);
+ SetMetricValue( *m_xMtrFldMoveY, sal_Int32(nValue / maUIScale), MapUnit::Map100thMM);
nValue = 0;
m_xMtrFldAngle->set_value(nValue, FieldUnit::DEGREE);
- SetMetricValue( *m_xMtrFldWidth, tools::Long(nValue / maUIScale), MapUnit::Map100thMM);
- SetMetricValue( *m_xMtrFldHeight, tools::Long(nValue / maUIScale), MapUnit::Map100thMM);
+ SetMetricValue( *m_xMtrFldWidth, sal_Int32(nValue / maUIScale), MapUnit::Map100thMM);
+ SetMetricValue( *m_xMtrFldHeight, sal_Int32(nValue / maUIScale), MapUnit::Map100thMM);
// set color attribute
const SfxPoolItem* pPoolItem = nullptr;
diff --git a/sd/source/ui/docshell/sdclient.cxx b/sd/source/ui/docshell/sdclient.cxx
index de684f8c061a..75f4e82da7fa 100644
--- a/sd/source/ui/docshell/sdclient.cxx
+++ b/sd/source/ui/docshell/sdclient.cxx
@@ -161,8 +161,8 @@ void Client::ViewChanged()
Size aSize = pSdrOle2Obj->GetOrigObjSize( &aMap100 );
aVisArea.SetSize( aSize );
- Size aScaledSize( static_cast< ::tools::Long >( GetScaleWidth() * Fraction( aVisArea.GetWidth() ) ),
- static_cast< ::tools::Long >( GetScaleHeight() * Fraction( aVisArea.GetHeight() ) ) );
+ Size aScaledSize( static_cast< sal_Int32 >( GetScaleWidth() * Fraction( aVisArea.GetWidth() ) ),
+ static_cast< sal_Int32 >( GetScaleHeight() * Fraction( aVisArea.GetHeight() ) ) );
// react to the change if the difference is bigger than one pixel
Size aPixelDiff =
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index c489745af601..7c10e8f3a570 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -600,8 +600,8 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
Point aPos = GetActiveWindow()->PixelToLogic(maMousePos);
pPageView->LogicToPagePos(aPos);
Fraction aUIScale(GetDoc()->GetUIScale());
- aPos.setX( ::tools::Long(aPos.X() / aUIScale) );
- aPos.setY( ::tools::Long(aPos.Y() / aUIScale) );
+ aPos.setX( sal_Int32(aPos.X() / aUIScale) );
+ aPos.setY( sal_Int32(aPos.Y() / aUIScale) );
// position- and size items
if ( mpDrawView->IsAction() )
@@ -615,12 +615,12 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
{
pPageView->LogicToPagePos(aRect);
aPos = aRect.TopLeft();
- aPos.setX( ::tools::Long(aPos.X() / aUIScale) );
- aPos.setY( ::tools::Long(aPos.Y() / aUIScale) );
+ aPos.setX( sal_Int32(aPos.X() / aUIScale) );
+ aPos.setY( sal_Int32(aPos.Y() / aUIScale) );
rSet.Put( SfxPointItem( SID_ATTR_POSITION, aPos) );
Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() );
- aSize.setHeight( ::tools::Long(aSize.Height() / aUIScale) );
- aSize.setWidth( ::tools::Long(aSize.Width() / aUIScale) );
+ aSize.setHeight( sal_Int32(aSize.Height() / aUIScale) );
+ aSize.setWidth( sal_Int32(aSize.Width() / aUIScale) );
rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) );
}
}
@@ -633,13 +633,13 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
// Show the position of the selected shape(s)
Point aShapePosition (aRect.TopLeft());
- aShapePosition.setX( ::tools::Long(aShapePosition.X() / aUIScale) );
- aShapePosition.setY( ::tools::Long(aShapePosition.Y() / aUIScale) );
+ aShapePosition.setX( sal_Int32(aShapePosition.X() / aUIScale) );
+ aShapePosition.setY( sal_Int32(aShapePosition.Y() / aUIScale) );
rSet.Put (SfxPointItem(SID_ATTR_POSITION, aShapePosition));
Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() );
- aSize.setHeight( ::tools::Long(aSize.Height() / aUIScale) );
- aSize.setWidth( ::tools::Long(aSize.Width() / aUIScale) );
+ aSize.setHeight( sal_Int32(aSize.Height() / aUIScale) );
+ aSize.setWidth( sal_Int32(aSize.Width() / aUIScale) );
rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) );
}
else
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 7ab817969516..4ffc666bf42b 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -183,7 +183,7 @@ void Window::SetMaxZoom (::tools::Long nMax)
{
if( GetMapMode().GetScaleX().GetDenominator() )
{
- return ::tools::Long(GetMapMode().GetScaleX() * 100);
+ return sal_Int32(GetMapMode().GetScaleX() * 100);
}
else
{