summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-16 11:56:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-16 15:13:53 +0100
commit1d180f48bc61444c610c35083e35745d38c6cce2 (patch)
treee580741aa902908a9fcf0c4b224e93ff42da1405 /filter
parent26783527823883ccd5bbf3b9e014a0a3c1e3a022 (diff)
Revert "loplugin:changetoolsgen in filter..framework" and reapply plugin
because I (a) forgot to insert parentheses which changes the meaning of some expressions and (b) I now use the AdjustFoo calls when changing unary operations, which reads much better This reverts commit bf8a6cacd06d7c1961b5db8cc79ee4bbdb342e43. Change-Id: I4b5a9bf0c38ee1b57af91e6b7f184f1e8807f6f7 Reviewed-on: https://gerrit.libreoffice.org/49843 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/flash/swfwriter1.cxx4
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx6
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx4
-rw-r--r--filter/source/msfilter/escherex.cxx4
-rw-r--r--filter/source/msfilter/eschesdo.cxx12
-rw-r--r--filter/source/msfilter/msdffimp.cxx16
-rw-r--r--filter/source/msfilter/svdfppt.cxx14
-rw-r--r--filter/source/svg/svgwriter.cxx11
8 files changed, 35 insertions, 36 deletions
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index 4b627d50e4bc..90464d195b25 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -550,11 +550,11 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const lon
switch( aOldFont.GetAlignment() )
{
case ALIGN_TOP:
- aBaseLinePos.setY( aBaseLinePos.Y() + aMetric.GetAscent() );
+ aBaseLinePos.AdjustY(aMetric.GetAscent() );
break;
case ALIGN_BOTTOM:
- aBaseLinePos.setY( aBaseLinePos.Y() - aMetric.GetDescent() );
+ aBaseLinePos.AdjustY( -(aMetric.GetDescent()) );
break;
default:
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 20497d5c71a6..4a47345a14b5 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -1140,7 +1140,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
MapMode aMapMode( aSubstitute.GetPrefMapMode() );
Size aOutSize( OutputDevice::LogicToLogic( aSize, rVDev.GetMapMode(), aMapMode ) );
Point aOrigin( OutputDevice::LogicToLogic( aPoint, rVDev.GetMapMode(), aMapMode ) );
- aOrigin.setY( aOrigin.Y() + aOutSize.Height() );
+ aOrigin.AdjustY(aOutSize.Height() );
aMapMode.SetOrigin( aOrigin );
aMapMode.SetScaleX( Fraction(aOutSize.Width() / ( nBoundingBox[ 2 ] - nBoundingBox[ 0 ] )) );
aMapMode.SetScaleY( Fraction(aOutSize.Height() / ( nBoundingBox[ 3 ] - nBoundingBox[ 1 ] )) );
@@ -2083,9 +2083,9 @@ void PSWriter::ImplSetAttrForText( const Point& rPoint )
if ( eTextAlign != ALIGN_BASELINE )
{ // PostScript does not know about FontAlignment
if ( eTextAlign == ALIGN_TOP ) // -> so I assume that
- aPoint.setY( aPoint.Y() + ( aSize.Height() * 4 / 5 ) ); // the area under the baseline
+ aPoint.AdjustY( aSize.Height() * 4 / 5 ); // the area under the baseline
else if ( eTextAlign == ALIGN_BOTTOM ) // is about 20% of the font size
- aPoint.setY( aPoint.Y() - ( aSize.Height() / 5 ) );
+ aPoint.AdjustY( -( aSize.Height() / 5 ) );
}
ImplMoveTo( aPoint );
if ( nRotation )
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 3cd9cdbeddbc..7a1255ba2d98 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -894,8 +894,8 @@ void OS2METReader::ReadRelLine(bool bGivenPos, sal_uInt16 nOrderLen)
tools::Polygon aPolygon(nPolySize);
for (i=0; i<nPolySize; i++) {
sal_Int8 nsignedbyte;
- pOS2MET->ReadSChar( nsignedbyte ); aP0.setX( aP0.X() + static_cast<sal_Int32>(nsignedbyte) );
- pOS2MET->ReadSChar( nsignedbyte ); aP0.setY( aP0.Y() - static_cast<sal_Int32>(nsignedbyte) );
+ pOS2MET->ReadSChar( nsignedbyte ); aP0.X()+=static_cast<sal_Int32>(nsignedbyte);
+ pOS2MET->ReadSChar( nsignedbyte ); aP0.Y()-=static_cast<sal_Int32>(nsignedbyte);
aCalcBndRect.Union(tools::Rectangle(aP0,Size(1,1)));
aPolygon.SetPoint(aP0,i);
}
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index b710b53af3e2..8d4b055f6a24 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -2020,8 +2020,8 @@ bool EscherPropertyContainer::CreatePolygonProperties(
for (sal_uInt16 i = 0; i < nPoints; ++i) // write points from polygon to buffer
{
Point aPoint = aPolygon[ i ];
- aPoint.setX( aPoint.X() - rGeoRect.X );
- aPoint.setY( aPoint.Y() - rGeoRect.Y );
+ aPoint.AdjustX( -(rGeoRect.X) );
+ aPoint.AdjustY( -(rGeoRect.Y) );
*pPtr++ = static_cast<sal_uInt8>( aPoint.X() );
*pPtr++ = static_cast<sal_uInt8>( aPoint.X() >> 8 );
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 30288d914e4c..1fb1f5a91472 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -88,9 +88,9 @@ Size ImplEESdrWriter::ImplMapSize( const Size& rSize )
Size aRetSize( OutputDevice::LogicToLogic( rSize, maMapModeSrc, maMapModeDest ) );
if ( !aRetSize.Width() )
- aRetSize.setWidth( ++aRetSize.Width() );
+ aRetSize.AdjustWidth( 1 );
if ( !aRetSize.Height() )
- aRetSize.setHeight( ++aRetSize.Height() );
+ aRetSize.AdjustHeight( 1 );
return aRetSize;
}
@@ -378,10 +378,10 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
const tools::Rectangle& rRect = aRect100thmm;
aCenter.setX( rRect.Left() + ( rRect.GetWidth() / 2 ) );
aCenter.setY( rRect.Top() + ( rRect.GetHeight() / 2 ) );
- aStart.setX( aStart.X() + aCenter.X() );
- aStart.setY( aStart.Y() + aCenter.Y() );
- aEnd.setX( aEnd.X() + aCenter.X() );
- aEnd.setY( aEnd.Y() + aCenter.Y() );
+ aStart.AdjustX(aCenter.X() );
+ aStart.AdjustY(aCenter.Y() );
+ aEnd.AdjustX(aCenter.X() );
+ aEnd.AdjustY(aCenter.Y() );
tools::Polygon aPolygon( rRect, aStart, aEnd, ePolyKind );
if( rObj.GetAngle() )
{
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index dbe93bf2a624..1f112475f331 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3108,8 +3108,8 @@ void SvxMSDffManager::Scale( sal_Int32& rVal ) const
void SvxMSDffManager::Scale( Point& rPos ) const
{
- rPos.setX( rPos.X() + nMapXOfs );
- rPos.setY( rPos.Y() + nMapYOfs );
+ rPos.AdjustX(nMapXOfs );
+ rPos.AdjustY(nMapYOfs );
if ( bNeedMap )
{
rPos.setX( BigMulDiv( rPos.X(), nMapMul, nMapDiv ) );
@@ -4624,8 +4624,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
Point aP( aObjData.aBoundRect.Center() );
Size aS( aObjData.aBoundRect.GetSize() );
- aP.setX( aP.X() - aS.Width() / 2 );
- aP.setY( aP.Y() - aS.Height() / 2 );
+ aP.AdjustX( -(aS.Width() / 2) );
+ aP.AdjustY( -(aS.Height() / 2) );
tools::Rectangle aLogicRect( aP, aS );
fYOfs = fXOfs = 0.0;
@@ -5246,8 +5246,8 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
// the vertical paragraph indents are part of the BoundRect,
// here we 'remove' them by calculating
tools::Rectangle aNewRect(rTextRect);
- aNewRect.SetBottom( aNewRect.Bottom() - nTextTop + nTextBottom );
- aNewRect.SetRight( aNewRect.Right() - nTextLeft + nTextRight );
+ aNewRect.AdjustBottom( -(nTextTop + nTextBottom) );
+ aNewRect.AdjustRight( -(nTextLeft + nTextRight) );
// Only if it's a simple textbox may Writer replace
// the object with a frame, otherwise
@@ -5379,8 +5379,8 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
rTextRect.GetWidth() : rTextRect.GetHeight();
nMinWH /= 2;
Point aPivot(rTextRect.TopLeft());
- aPivot.setX( aPivot.X() + nMinWH );
- aPivot.setY( aPivot.Y() + nMinWH );
+ aPivot.AdjustX(nMinWH );
+ aPivot.AdjustY(nMinWH );
double a = nTextRotationAngle * nPi180;
pTextObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
}
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index b8e4da7c50ea..28401d7cc4e6 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1143,8 +1143,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
if ( eTVA == SDRTEXTVERTADJUST_BLOCK )
{
Size aTextSize( pText->GetTextSize() );
- aTextSize.setWidth( aTextSize.Width() + nTextLeft + nTextRight );
- aTextSize.setHeight( aTextSize.Height() + nTextTop + nTextBottom );
+ aTextSize.AdjustWidth(nTextLeft + nTextRight );
+ aTextSize.AdjustHeight(nTextTop + nTextBottom );
if ( rTextRect.GetHeight() < aTextSize.Height() )
pTObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
}
@@ -1154,8 +1154,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
if ( eTHA == SDRTEXTHORZADJUST_BLOCK )
{
Size aTextSize( pText->GetTextSize() );
- aTextSize.setWidth( aTextSize.Width() + nTextLeft + nTextRight );
- aTextSize.setHeight( aTextSize.Height() + nTextTop + nTextBottom );
+ aTextSize.AdjustWidth(nTextLeft + nTextRight );
+ aTextSize.AdjustHeight(nTextTop + nTextBottom );
if ( rTextRect.GetWidth() < aTextSize.Width() )
pTObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_CENTER ) );
}
@@ -2503,8 +2503,8 @@ Size SdrPowerPointImport::GetPageSize() const
aRet.setWidth( BigMulDiv( aRet.Width(), nInchMul, nInchDiv ) );
aRet.setHeight( BigMulDiv( aRet.Height(), nInchMul, nInchDiv ) );
}
- aRet.setWidth( aRet.Width() + 5 ); aRet.setWidth( aRet.Width() / 10 ); aRet.setWidth( aRet.Width() * 10 );
- aRet.setHeight( aRet.Height() + 5 ); aRet.setHeight( aRet.Height() / 10 ); aRet.setHeight( aRet.Height() * 10 );
+ aRet.AdjustWidth(5 ); aRet.setWidth( aRet.Width() / 10 ); aRet.setWidth( aRet.Width() * 10 );
+ aRet.AdjustHeight(5 ); aRet.setHeight( aRet.Height() / 10 ); aRet.setHeight( aRet.Height() * 10 );
if ( bInch )
{
aRet.setWidth( BigMulDiv( aRet.Width(), nInchDiv, nInchMul ) );
@@ -5671,7 +5671,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, T
if ( aSize.Width() && aSize.Height() )
{
if ( aSize.Width () > 64 )
- aSize.Width () = 64;
+ aSize.setWidth( 64 );
if ( aSize.Height() > 64 )
aSize.setHeight( 64 );
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index bd3a50df0cc0..a080e1c6a1f6 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1612,9 +1612,9 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos,
const vcl::Font& rFont = mpVDev->GetFont();
if( rFont.GetAlignment() == ALIGN_TOP )
- aBaseLinePos.setY( aBaseLinePos.Y() + aMetric.GetAscent() );
+ aBaseLinePos.AdjustY(aMetric.GetAscent() );
else if( rFont.GetAlignment() == ALIGN_BOTTOM )
- aBaseLinePos.setY( aBaseLinePos.Y() - aMetric.GetDescent() );
+ aBaseLinePos.AdjustY( -(aMetric.GetDescent()) );
implMap( rPos, aPos );
@@ -2250,8 +2250,7 @@ void SVGActionWriter::ImplWriteGradientLinear( const tools::PolyPolygon& rPolyPo
// Setting x value of a gradient vector to rotation center to
// place a gradient vector in a target polygon.
// This would help editing it in SVG editors like inkscape.
- aPoly[ 0 ].setX( aCenter.X() );
- aPoly[ 1 ].setX( aCenter.X() );
+ aPoly[ 0 ].X() = aPoly[ 1 ].X() = aCenter.X();
aPoly[ 0 ].setY( aRect.Top() );
aPoly[ 1 ].setY( aRect.Bottom() );
aPoly.Rotate( aCenter, nAngle );
@@ -2543,9 +2542,9 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText,
const vcl::Font& rFont = mpVDev->GetFont();
if( rFont.GetAlignment() == ALIGN_TOP )
- aBaseLinePos.setY( aBaseLinePos.Y() + aMetric.GetAscent() );
+ aBaseLinePos.AdjustY(aMetric.GetAscent() );
else if( rFont.GetAlignment() == ALIGN_BOTTOM )
- aBaseLinePos.setY( aBaseLinePos.Y() - aMetric.GetDescent() );
+ aBaseLinePos.AdjustY( -(aMetric.GetDescent()) );
ImplMap( rPos, aPos );