summaryrefslogtreecommitdiff
path: root/sc
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 /sc
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 'sc')
-rw-r--r--sc/source/core/data/column2.cxx4
-rw-r--r--sc/source/ui/app/client.cxx2
-rw-r--r--sc/source/ui/unoobj/docuno.cxx8
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx2
-rw-r--r--sc/source/ui/view/gridwin4.cxx2
-rw-r--r--sc/source/ui/view/tabview.cxx4
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx2
-rw-r--r--sc/source/ui/view/tabvwsha.cxx4
-rw-r--r--sc/source/ui/view/viewdata.cxx20
9 files changed, 24 insertions, 24 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 886dab8f5ab8..81600ed714c0 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -440,7 +440,7 @@ tools::Long ScColumn::GetNeededSize(
constexpr tools::Long nFilterButtonWidthPix = 20; // Autofilter pixel width at 100% zoom.
if ( pFlag->HasAutoFilter() && !bTextWysiwyg )
nDocWidth -= bInPrintTwips ?
- (nFilterButtonWidthPix * TWIPS_PER_PIXEL) : tools::Long(rZoomX * nFilterButtonWidthPix);
+ (nFilterButtonWidthPix * TWIPS_PER_PIXEL) : sal_Int32(rZoomX * nFilterButtonWidthPix);
aPaper.setWidth( nDocWidth );
@@ -596,7 +596,7 @@ tools::Long ScColumn::GetNeededSize(
ScMF nFlags = pPattern->GetItem(ATTR_MERGE_FLAG).GetValue();
if (nFlags & ScMF::Auto)
nValue += bInPrintTwips ?
- (nFilterButtonWidthPix * TWIPS_PER_PIXEL) : tools::Long(rZoomX * nFilterButtonWidthPix);
+ (nFilterButtonWidthPix * TWIPS_PER_PIXEL) : sal_Int32(rZoomX * nFilterButtonWidthPix);
}
return nValue;
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index ac6b0e12086b..d9c326f29090 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -206,7 +206,7 @@ void ScClient::ViewChanged()
tools::Rectangle aLogicRect = pDrawObj->GetLogicRect();
Fraction aFractX = GetScaleWidth() * aVisSize.Width();
Fraction aFractY = GetScaleHeight() * aVisSize.Height();
- aVisSize = Size( static_cast<tools::Long>(aFractX), static_cast<tools::Long>(aFractY) ); // Scaled for Draw model
+ aVisSize = Size( static_cast<sal_Int32>(aFractX), static_cast<sal_Int32>(aFractY) ); // Scaled for Draw model
// pClientData->SetObjArea before pDrawObj->SetLogicRect, so that we don't
// calculate wrong scalings:
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 1fbbf37ac812..09c45ecd8252 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2261,10 +2261,10 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
Fraction aScaleX( aLocationPixel.GetWidth(), aLocationMM.GetWidth() );
Fraction aScaleY( aLocationPixel.GetHeight(), aLocationMM.GetHeight() );
- tools::Long nX1 = aLocationPixel.Left() + static_cast<tools::Long>( Fraction( aTargetRect.Left() - aLocationMM.Left(), 1 ) * aScaleX );
- tools::Long nX2 = aLocationPixel.Left() + static_cast<tools::Long>( Fraction( aTargetRect.Right() - aLocationMM.Left(), 1 ) * aScaleX );
- tools::Long nY1 = aLocationPixel.Top() + static_cast<tools::Long>( Fraction( aTargetRect.Top() - aLocationMM.Top(), 1 ) * aScaleY );
- tools::Long nY2 = aLocationPixel.Top() + static_cast<tools::Long>( Fraction( aTargetRect.Bottom() - aLocationMM.Top(), 1 ) * aScaleY );
+ tools::Long nX1 = aLocationPixel.Left() + static_cast<sal_Int32>( Fraction( aTargetRect.Left() - aLocationMM.Left(), 1 ) * aScaleX );
+ tools::Long nX2 = aLocationPixel.Left() + static_cast<sal_Int32>( Fraction( aTargetRect.Right() - aLocationMM.Left(), 1 ) * aScaleX );
+ tools::Long nY1 = aLocationPixel.Top() + static_cast<sal_Int32>( Fraction( aTargetRect.Top() - aLocationMM.Top(), 1 ) * aScaleY );
+ tools::Long nY2 = aLocationPixel.Top() + static_cast<sal_Int32>( Fraction( aTargetRect.Bottom() - aLocationMM.Top(), 1 ) * aScaleY );
if ( nX1 > aLocationPixel.Right() ) nX1 = aLocationPixel.Right();
if ( nX2 > aLocationPixel.Right() ) nX2 = aLocationPixel.Right();
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index feea0f85f567..0fb82627d39e 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -1368,7 +1368,7 @@ sal_Int16 ScTabViewObj::GetZoom() const
if (pViewSh)
{
const Fraction& rZoomY = pViewSh->GetViewData().GetZoomY(); // Y will be shown
- return static_cast<sal_Int16>(tools::Long( rZoomY * 100 ));
+ return static_cast<sal_Int16>(sal_Int32( rZoomY * 100 ));
}
return 0;
}
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index cc3fa9c7ff0b..8b25775ff793 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -141,7 +141,7 @@ static void lcl_DrawOneFrame( vcl::RenderContext* pDev, const tools::Rectangle&
ScDDComboBoxButton aComboButton(pDev);
aComboButton.SetOptSizePixel();
- tools::Long nBWidth = tools::Long(aComboButton.GetSizePixel().Width() * rZoomY);
+ tools::Long nBWidth = sal_Int32(aComboButton.GetSizePixel().Width() * rZoomY);
tools::Long nBHeight = nVer + aTextSize.Height() + 1;
Size aButSize( nBWidth, nBHeight );
tools::Long nButtonPos = bLayoutRTL ? aOuter.Left() : aOuter.Right()-nBWidth+1;
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index d9eaab465ca4..a7acef3868d9 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -737,7 +737,7 @@ void ScTabView::UpdateVarZoom()
bInZoomUpdate = true;
const Fraction& rOldX = GetViewData().GetZoomX();
const Fraction& rOldY = GetViewData().GetZoomY();
- tools::Long nOldPercent = tools::Long(rOldY * 100);
+ tools::Long nOldPercent = sal_Int32(rOldY * 100);
sal_uInt16 nNewZoom = CalcZoom( eZoomType, static_cast<sal_uInt16>(nOldPercent) );
Fraction aNew( nNewZoom, 100 );
@@ -956,7 +956,7 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
// and can't be changed directly
const Fraction& rOldY = aViewData.GetZoomY();
- tools::Long nOld = static_cast<tools::Long>( rOldY * 100 );
+ tools::Long nOld = static_cast<sal_Int32>( rOldY * 100 );
tools::Long nNew;
if ( pData->GetDelta() < 0 )
nNew = std::max( tools::Long(MINZOOM), basegfx::zoomtools::zoomOut( nOld ));
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 5d86c0c41e4d..61b9f51a056d 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -698,7 +698,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
SvxZoomType eOldZoomType = GetZoomType();
SvxZoomType eNewZoomType = eOldZoomType;
const Fraction& rOldY = GetViewData().GetZoomY(); // Y is shown
- sal_uInt16 nOldZoom = static_cast<sal_uInt16>(tools::Long( rOldY * 100 ));
+ sal_uInt16 nOldZoom = static_cast<sal_uInt16>(sal_Int32( rOldY * 100 ));
sal_uInt16 nZoom = nOldZoom;
bool bCancel = false;
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 041560a67ff6..e8c373ac7d00 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -298,7 +298,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
else
{
const Fraction& rOldY = GetViewData().GetZoomY();
- sal_uInt16 nZoom = static_cast<sal_uInt16>(tools::Long( rOldY * 100 ));
+ sal_uInt16 nZoom = static_cast<sal_uInt16>(sal_Int32( rOldY * 100 ));
rSet.Put( SvxZoomItem( SvxZoomType::PERCENT, nZoom, nWhich ) );
}
break;
@@ -310,7 +310,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
else
{
const Fraction& rOldY = GetViewData().GetZoomY();
- sal_uInt16 nCurrentZoom = static_cast<sal_uInt16>(tools::Long( rOldY * 100 ));
+ sal_uInt16 nCurrentZoom = static_cast<sal_uInt16>(sal_Int32( rOldY * 100 ));
if( nCurrentZoom )
{
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 2d30a3504f75..5e5f17f9eb42 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -575,8 +575,8 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
pSettings[SC_POSITION_BOTTOM].Name = SC_POSITIONBOTTOM;
pSettings[SC_POSITION_BOTTOM].Value <<= sal_Int32(nPosY[SC_SPLIT_BOTTOM]);
- sal_Int32 nZoomValue = tools::Long(aZoomY * 100);
- sal_Int32 nPageZoomValue = tools::Long(aPageZoomY * 100);
+ sal_Int32 nZoomValue = sal_Int32(aZoomY * 100);
+ sal_Int32 nPageZoomValue = sal_Int32(aPageZoomY * 100);
pSettings[SC_TABLE_ZOOM_TYPE].Name = SC_ZOOMTYPE;
pSettings[SC_TABLE_ZOOM_TYPE].Value <<= sal_Int16(eZoomType);
pSettings[SC_TABLE_ZOOM_VALUE].Name = SC_ZOOMVALUE;
@@ -3098,8 +3098,8 @@ void ScViewData::UpdateScreenZoom( const Fraction& rNewX, const Fraction& rNewY
aHeight *= Fraction( aScrSize.Height(),1 );
aHeight /= aOldY;
- aScrSize.setWidth( static_cast<tools::Long>(aWidth) );
- aScrSize.setHeight( static_cast<tools::Long>(aHeight) );
+ aScrSize.setWidth( static_cast<sal_Int32>(aWidth) );
+ aScrSize.setHeight( static_cast<sal_Int32>(aHeight) );
}
void ScViewData::CalcPPT()
@@ -3162,9 +3162,9 @@ void ScViewData::WriteUserData(OUString& rData)
// PosX[left]/PosX[right]/PosY[top]/PosY[bottom]
// when rows bigger than 8192, "+" instead of "/"
- sal_uInt16 nZoom = static_cast<sal_uInt16>(tools::Long(pThisTab->aZoomY * 100));
+ sal_uInt16 nZoom = static_cast<sal_uInt16>(sal_Int32(pThisTab->aZoomY * 100));
rData = OUString::number( nZoom ) + "/";
- nZoom = static_cast<sal_uInt16>(tools::Long(pThisTab->aPageZoomY * 100));
+ nZoom = static_cast<sal_uInt16>(sal_Int32(pThisTab->aPageZoomY * 100));
rData += OUString::number( nZoom ) + "/";
if (bPagebreak)
rData += "1";
@@ -3422,8 +3422,8 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const
// view mode and zoom
rTabSett.mbPageMode = bPagebreak;
- rTabSett.mnNormalZoom = static_cast< tools::Long >( pViewTab->aZoomY * Fraction( 100.0 ) );
- rTabSett.mnPageZoom = static_cast< tools::Long >( pViewTab->aPageZoomY * Fraction( 100.0 ) );
+ rTabSett.mnNormalZoom = static_cast< sal_Int32 >( pViewTab->aZoomY * Fraction( 100.0 ) );
+ rTabSett.mnPageZoom = static_cast< sal_Int32 >( pViewTab->aPageZoomY * Fraction( 100.0 ) );
}
}
}
@@ -3640,8 +3640,8 @@ void ScViewData::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>& rSe
pSettings[SC_ACTIVE_TABLE].Value <<= sName;
pSettings[SC_HORIZONTAL_SCROLL_BAR_WIDTH].Name = SC_HORIZONTALSCROLLBARWIDTH;
pSettings[SC_HORIZONTAL_SCROLL_BAR_WIDTH].Value <<= sal_Int32(pView->GetTabBarWidth());
- sal_Int32 nZoomValue = tools::Long(pThisTab->aZoomY * 100);
- sal_Int32 nPageZoomValue = tools::Long(pThisTab->aPageZoomY * 100);
+ sal_Int32 nZoomValue = sal_Int32(pThisTab->aZoomY * 100);
+ sal_Int32 nPageZoomValue = sal_Int32(pThisTab->aPageZoomY * 100);
pSettings[SC_ZOOM_TYPE].Name = SC_ZOOMTYPE;
pSettings[SC_ZOOM_TYPE].Value <<= sal_Int16(pThisTab->eZoomType);
pSettings[SC_ZOOM_VALUE].Name = SC_ZOOMVALUE;