diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-12 09:32:02 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-12 16:53:22 +0100 |
commit | c45753847dfc2b4645dc2f7500a18ec2c5d438df (patch) | |
tree | 8d04962d7a4367a92d220beb0c35effb9490395b /sc/source | |
parent | 768cfcee178b284be6d96d384364e59e40ecb375 (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 'sc/source')
-rw-r--r-- | sc/source/core/data/column2.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/app/client.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/unoobj/viewuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh3.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsha.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 20 |
9 files changed, 24 insertions, 24 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 81600ed714c0..886dab8f5ab8 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) : sal_Int32(rZoomX * nFilterButtonWidthPix); + (nFilterButtonWidthPix * TWIPS_PER_PIXEL) : tools::Long(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) : sal_Int32(rZoomX * nFilterButtonWidthPix); + (nFilterButtonWidthPix * TWIPS_PER_PIXEL) : tools::Long(rZoomX * nFilterButtonWidthPix); } return nValue; diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx index d9c326f29090..ac6b0e12086b 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<sal_Int32>(aFractX), static_cast<sal_Int32>(aFractY) ); // Scaled for Draw model + aVisSize = Size( static_cast<tools::Long>(aFractX), static_cast<tools::Long>(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 09c45ecd8252..1fbbf37ac812 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<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 ); + 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 ); 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 0fb82627d39e..feea0f85f567 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>(sal_Int32( rZoomY * 100 )); + return static_cast<sal_Int16>(tools::Long( rZoomY * 100 )); } return 0; } diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 8b25775ff793..cc3fa9c7ff0b 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 = sal_Int32(aComboButton.GetSizePixel().Width() * rZoomY); + tools::Long nBWidth = tools::Long(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 a7acef3868d9..d9eaab465ca4 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 = sal_Int32(rOldY * 100); + tools::Long nOldPercent = tools::Long(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<sal_Int32>( rOldY * 100 ); + tools::Long nOld = static_cast<tools::Long>( 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 61b9f51a056d..5d86c0c41e4d 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>(sal_Int32( rOldY * 100 )); + sal_uInt16 nOldZoom = static_cast<sal_uInt16>(tools::Long( 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 e8c373ac7d00..041560a67ff6 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>(sal_Int32( rOldY * 100 )); + sal_uInt16 nZoom = static_cast<sal_uInt16>(tools::Long( 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>(sal_Int32( rOldY * 100 )); + sal_uInt16 nCurrentZoom = static_cast<sal_uInt16>(tools::Long( rOldY * 100 )); if( nCurrentZoom ) { diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 5e5f17f9eb42..2d30a3504f75 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 = sal_Int32(aZoomY * 100); - sal_Int32 nPageZoomValue = sal_Int32(aPageZoomY * 100); + sal_Int32 nZoomValue = tools::Long(aZoomY * 100); + sal_Int32 nPageZoomValue = tools::Long(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<sal_Int32>(aWidth) ); - aScrSize.setHeight( static_cast<sal_Int32>(aHeight) ); + aScrSize.setWidth( static_cast<tools::Long>(aWidth) ); + aScrSize.setHeight( static_cast<tools::Long>(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>(sal_Int32(pThisTab->aZoomY * 100)); + sal_uInt16 nZoom = static_cast<sal_uInt16>(tools::Long(pThisTab->aZoomY * 100)); rData = OUString::number( nZoom ) + "/"; - nZoom = static_cast<sal_uInt16>(sal_Int32(pThisTab->aPageZoomY * 100)); + nZoom = static_cast<sal_uInt16>(tools::Long(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< sal_Int32 >( pViewTab->aZoomY * Fraction( 100.0 ) ); - rTabSett.mnPageZoom = static_cast< sal_Int32 >( pViewTab->aPageZoomY * Fraction( 100.0 ) ); + rTabSett.mnNormalZoom = static_cast< tools::Long >( pViewTab->aZoomY * Fraction( 100.0 ) ); + rTabSett.mnPageZoom = static_cast< tools::Long >( 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 = sal_Int32(pThisTab->aZoomY * 100); - sal_Int32 nPageZoomValue = sal_Int32(pThisTab->aPageZoomY * 100); + sal_Int32 nZoomValue = tools::Long(pThisTab->aZoomY * 100); + sal_Int32 nPageZoomValue = tools::Long(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; |