summaryrefslogtreecommitdiff
path: root/sw
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 /sw
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 'sw')
-rw-r--r--sw/source/core/doc/tblrwcl.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx2
-rw-r--r--sw/source/core/txtnode/fntcache.cxx2
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx2
-rw-r--r--sw/source/core/view/viewpg.cxx2
-rw-r--r--sw/source/filter/writer/wrtswtbl.cxx4
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx2
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx2
-rw-r--r--sw/source/ui/misc/pgfnote.cxx2
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx20
-rw-r--r--sw/source/uibase/uiview/swcli.cxx8
-rw-r--r--sw/source/uibase/uiview/viewport.cxx4
-rw-r--r--sw/source/uibase/utlui/uiitems.cxx2
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx4
14 files changed, 29 insertions, 29 deletions
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 9e938631cf0f..76474bba91b6 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -2940,7 +2940,7 @@ static void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewH
Fraction aTmp( nMyOldH );
aTmp *= Fraction( nNewHeight, nOldHeight );
aTmp += Fraction( 1, 2 ); // round up if needed
- nMyNewH = sal_Int32(aTmp);
+ nMyNewH = tools::Long(aTmp);
}
SwFrameSize eSize = SwFrameSize::Minimum;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index cc4c79270256..12536c52a054 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5263,7 +5263,7 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect,
SwTwips nPrtWidth = aRectFnSet.GetWidth(getFramePrintArea());
Fraction aFract( nPrtWidth, 1 );
aFract *= rInf.GetWidth();
- const SwTwips nWidth = static_cast<sal_Int32>(aFract);
+ const SwTwips nWidth = static_cast<tools::Long>(aFract);
SwTwips nX = aRectFnSet.GetPrtLeft(*this);
switch ( rInf.GetAdj() )
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 319029e6282d..7f2e65230e65 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -543,7 +543,7 @@ void SwFntObj::CreateScrFont( const SwViewShell& rSh, const OutputDevice& rOut )
pOut->GetMapMode().GetScaleY().IsValid() &&
pOut->GetMapMode().GetScaleX() == pOut->GetMapMode().GetScaleY() )
{
- nTmp = sal_Int32(100 * pOut->GetMapMode().GetScaleX());
+ nTmp = tools::Long(100 * pOut->GetMapMode().GetScaleX());
}
else
nTmp = 0;
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index ab1346a5e3e0..57fda67e4e2c 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -209,7 +209,7 @@ void SwPagePreviewLayout::Init( const sal_uInt16 _nCols,
{
// adjust scaling for Drawing layer.
aYScale *= Fraction( 1000, 1 );
- tools::Long nNewNuminator = sal_Int32(aYScale);
+ tools::Long nNewNuminator = aYScale.operator long();
if( nNewNuminator < 1 )
nNewNuminator = 1;
aYScale = Fraction( nNewNuminator, 1000 );
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index 6a681ad09a6a..98df16715059 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -160,7 +160,7 @@ void SwViewShell::PrintProspect(
{
// Round percentages for Drawings so that these can paint their objects properly
aScY *= Fraction( 1000, 1 );
- tools::Long nTmp = static_cast<sal_Int32>(aScY);
+ tools::Long nTmp = static_cast<tools::Long>(aScY);
if( 1 < nTmp )
--nTmp;
else
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index b98a76cc3a5b..6a699d6c0674 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -343,7 +343,7 @@ sal_uInt16 SwWriteTable::GetRelWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) con
{
tools::Long nWidth = GetRawWidth( nCol, nColSpan );
- return static_cast<sal_uInt16>(static_cast<sal_Int32>(Fraction( nWidth*256 + GetBaseWidth()/2,
+ return static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction( nWidth*256 + GetBaseWidth()/2,
GetBaseWidth() )));
}
@@ -353,7 +353,7 @@ sal_uInt16 SwWriteTable::GetPercentWidth( sal_uInt16 nCol, sal_uInt16 nColSpan )
// Looks funny, but is nothing more than
// [(100 * nWidth) + .5] without rounding errors
- return static_cast<sal_uInt16>(static_cast<sal_Int32>(Fraction( nWidth*100 + GetBaseWidth()/2,
+ return static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction( nWidth*100 + GetBaseWidth()/2,
GetBaseWidth() )));
}
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index c6a29d5cab17..97f09efba839 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -682,7 +682,7 @@ namespace sw
const Size &rSize = pNd->GetTwipSize();
Fraction aMoveHack(ww::nWrap100Percent, rSize.Width());
aMoveHack *= Fraction(15, 1);
- sal_Int32 nMove(aMoveHack);
+ tools::Long nMove(aMoveHack);
Fraction aHackX(ww::nWrap100Percent + nMove,
ww::nWrap100Percent);
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index bb9eb4fb2cdc..c141c857f37c 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2050,7 +2050,7 @@ void SwWW8ImplReader::MapWrapIntoFlyFormat(SvxMSDffImportRec const * pRecord,
*/
Fraction aMoveHack(ww::nWrap100Percent, rSize.Width());
aMoveHack *= Fraction(15, 1);
- sal_Int32 nMove(aMoveHack);
+ tools::Long nMove(aMoveHack);
aPoly.Move(nMove, 0);
Fraction aHackX(ww::nWrap100Percent, ww::nWrap100Percent + nMove);
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index a4436edee476..4415ae8ab7a2 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -201,7 +201,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet)
// width
Fraction aTmp( 100, 1 );
aTmp *= pFootnoteInfo->GetWidth();
- m_xLineLengthEdit->set_value(static_cast<sal_Int32>(aTmp), FieldUnit::PERCENT);
+ m_xLineLengthEdit->set_value(static_cast<tools::Long>(aTmp), FieldUnit::PERCENT);
// gap footnote area
m_xDistEdit->set_value(m_xDistEdit->normalize(pFootnoteInfo->GetTopDist()), FieldUnit::TWIP);
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 0c58c9bc33c5..4b1e7c70836c 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -634,21 +634,21 @@ void SwAnnotationWin::Rescale()
if ( mpMetadataAuthor )
{
vcl::Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetLabelFont() );
- sal_Int32 nHeight = sal_Int32(aFont.GetFontHeight() * rFraction);
+ sal_Int32 nHeight = tools::Long(aFont.GetFontHeight() * rFraction);
aFont.SetFontHeight( nHeight );
mpMetadataAuthor->SetControlFont( aFont );
}
if ( mpMetadataDate )
{
vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetLabelFont() );
- sal_Int32 nHeight = sal_Int32(aFont.GetFontHeight() * rFraction);
+ sal_Int32 nHeight = tools::Long(aFont.GetFontHeight() * rFraction);
aFont.SetFontHeight( nHeight );
mpMetadataDate->SetControlFont( aFont );
}
if ( mpMetadataResolved )
{
vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetLabelFont() );
- sal_Int32 nHeight = sal_Int32(aFont.GetFontHeight() * rFraction);
+ sal_Int32 nHeight = tools::Long(aFont.GetFontHeight() * rFraction);
aFont.SetFontHeight( nHeight );
mpMetadataResolved->SetControlFont( aFont );
}
@@ -959,10 +959,10 @@ void SwAnnotationWin::DoResize()
const Fraction& fy( GetMapMode().GetScaleY() );
const Point aPos( mpMetadataAuthor->GetPosPixel());
- mpMenuButton->setPosSizePixel( sal_Int32(aPos.X()+GetSizePixel().Width()-(METABUTTON_WIDTH+10)*fx),
- sal_Int32(aPos.Y()+5*fy),
- sal_Int32(METABUTTON_WIDTH*fx),
- sal_Int32(METABUTTON_HEIGHT*fy) );
+ mpMenuButton->setPosSizePixel( tools::Long(aPos.X()+GetSizePixel().Width()-(METABUTTON_WIDTH+10)*fx),
+ tools::Long(aPos.Y()+5*fy),
+ tools::Long(METABUTTON_WIDTH*fx),
+ tools::Long(METABUTTON_HEIGHT*fy) );
}
void SwAnnotationWin::SetSizePixel( const Size& rNewSize )
@@ -1426,14 +1426,14 @@ sal_Int32 SwAnnotationWin::GetScrollbarWidth() const
sal_Int32 SwAnnotationWin::GetMetaButtonAreaWidth() const
{
const Fraction& f( GetMapMode().GetScaleX() );
- return sal_Int32(METABUTTON_AREA_WIDTH * f);
+ return tools::Long(METABUTTON_AREA_WIDTH * f);
}
sal_Int32 SwAnnotationWin::GetMetaHeight() const
{
const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
const int fields = GetNumFields();
- return sal_Int32(fields*POSTIT_META_FIELD_HEIGHT*f);
+ return tools::Long(fields*POSTIT_META_FIELD_HEIGHT*f);
}
sal_Int32 SwAnnotationWin::GetNumFields() const
@@ -1449,7 +1449,7 @@ sal_Int32 SwAnnotationWin::GetMinimumSizeWithMeta() const
sal_Int32 SwAnnotationWin::GetMinimumSizeWithoutMeta() const
{
const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
- return sal_Int32(POSTIT_MINIMUMSIZE_WITHOUT_META * f);
+ return tools::Long(POSTIT_MINIMUMSIZE_WITHOUT_META * f);
}
void SwAnnotationWin::SetSpellChecking()
diff --git a/sw/source/uibase/uiview/swcli.cxx b/sw/source/uibase/uiview/swcli.cxx
index 962a21a9001c..02dc88cade38 100644
--- a/sw/source/uibase/uiview/swcli.cxx
+++ b/sw/source/uibase/uiview/swcli.cxx
@@ -67,8 +67,8 @@ void SwOleClient::RequestNewObjectArea( tools::Rectangle& aLogRect )
MapMode aObjectMap( VCLUnoHelper::UnoEmbed2VCLMapUnit( GetObject()->getMapUnit( GetAspect() ) ) );
MapMode aClientMap( GetEditWin()->GetMapMode().GetMapUnit() );
- Size aNewObjSize( sal_Int32( aLogRect.GetWidth() / GetScaleWidth() ),
- sal_Int32( aLogRect.GetHeight() / GetScaleHeight() ) );
+ Size aNewObjSize( tools::Long( aLogRect.GetWidth() / GetScaleWidth() ),
+ tools::Long( aLogRect.GetHeight() / GetScaleHeight() ) );
// convert to logical coordinates of the embedded object
Size aNewSize = GetEditWin()->LogicToLogic( aNewObjSize, &aClientMap, &aObjectMap );
@@ -141,8 +141,8 @@ void SwOleClient::ViewChanged()
const MapMode aObjMap( VCLUnoHelper::UnoEmbed2VCLMapUnit( GetObject()->getMapUnit( GetAspect() ) ) );
aVisSize = OutputDevice::LogicToLogic( aVisSize, aObjMap, aMyMap );
- aVisSize.setWidth( sal_Int32(aVisSize.Width() * GetScaleWidth()) );
- aVisSize.setHeight( sal_Int32(aVisSize.Height() * GetScaleHeight()) );
+ aVisSize.setWidth( tools::Long(aVisSize.Width() * GetScaleWidth()) );
+ aVisSize.setHeight( tools::Long(aVisSize.Height() * GetScaleHeight()) );
SwRect aRect( Point( LONG_MIN, LONG_MIN ), aVisSize );
rSh.LockView( true ); // Prevent scrolling in the EndAction
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index e4758bcea934..fdfff47b13f3 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -990,7 +990,7 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize, bool )
const Fraction& rFrac = GetEditWin().GetMapMode().GetScaleX();
tools::Long nZoom = 100;
if (rFrac.IsValid())
- nZoom = sal_Int32(rFrac * 100);
+ nZoom = tools::Long(rFrac * 100);
const Fraction aFrac( nZoom, 100 );
m_pVRuler->SetZoom( aFrac );
@@ -1140,7 +1140,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
void SwView::SetZoomFactor( const Fraction &rX, const Fraction &rY )
{
const Fraction &rFrac = rX < rY ? rX : rY;
- SetZoom( SvxZoomType::PERCENT, static_cast<short>(sal_Int32(rFrac * Fraction( 100, 1 ))) );
+ SetZoom( SvxZoomType::PERCENT, static_cast<short>(tools::Long(rFrac * Fraction( 100, 1 ))) );
// To minimize rounding errors we also adjust the odd values
// of the base class if necessary.
diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx
index 040909f67a41..de816541cb07 100644
--- a/sw/source/uibase/utlui/uiitems.cxx
+++ b/sw/source/uibase/utlui/uiitems.cxx
@@ -86,7 +86,7 @@ bool SwPageFootnoteInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
{
Fraction aTmp( 100, 1 );
aTmp *= aFootnoteInfo.GetWidth();
- rVal <<= static_cast<sal_Int8>(static_cast<sal_Int32>(aTmp));
+ rVal <<= static_cast<sal_Int8>(static_cast<tools::Long>(aTmp));
}
break;
case MID_LINE_ADJUST : rVal <<= static_cast<sal_Int16>(aFootnoteInfo.GetAdj());break;//text::HorizontalAdjust
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 1e2ec7522411..1bab729db9a5 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -856,8 +856,8 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
}
else
{
- aArea.Width ( sal_Int32( aArea.Width() / pCli->GetScaleWidth() ) );
- aArea.Height( sal_Int32( aArea.Height() / pCli->GetScaleHeight() ) );
+ aArea.Width ( tools::Long( aArea.Width() / pCli->GetScaleWidth() ) );
+ aArea.Height( tools::Long( aArea.Height() / pCli->GetScaleHeight() ) );
}
pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );