summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-16 10:23:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-17 07:07:58 +0100
commite2e4798b35ecd33a09dda85c575d7a7709ab9414 (patch)
tree857c8bc0ee9061f630700921de79556b55e5725c /sc/source/filter
parentd4be0bfedf8497ad3b4244aeeb0b761b5c6b128b (diff)
Revert "loplugin:changetoolsgen in sc" 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 95fab7cbf2f0576d0f728bed8898b7ff769d90e6. Change-Id: Icbdcc0f4227d88812be12e18ba6961088db80c3e Reviewed-on: https://gerrit.libreoffice.org/49840 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter')
-rw-r--r--sc/source/filter/excel/xiescher.cxx16
-rw-r--r--sc/source/filter/html/htmlexp2.cxx4
-rw-r--r--sc/source/filter/html/htmlimp.cxx4
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx12
4 files changed, 18 insertions, 18 deletions
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 5d03a6ecaf62..01a29ca3c7ab 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -1257,26 +1257,26 @@ SdrObjectPtr XclImpArcObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const t
case EXC_OBJ_ARC_TR:
nStartAngle = 0;
nEndAngle = 9000;
- aNewRect.SetLeft( aNewRect.Left() - rAnchorRect.GetWidth() );
- aNewRect.SetBottom( aNewRect.Bottom() + rAnchorRect.GetHeight() );
+ aNewRect.AdjustLeft( -(rAnchorRect.GetWidth()) );
+ aNewRect.AdjustBottom(rAnchorRect.GetHeight() );
break;
case EXC_OBJ_ARC_TL:
nStartAngle = 9000;
nEndAngle = 18000;
- aNewRect.SetRight( aNewRect.Right() + rAnchorRect.GetWidth() );
- aNewRect.SetBottom( aNewRect.Bottom() + rAnchorRect.GetHeight() );
+ aNewRect.AdjustRight(rAnchorRect.GetWidth() );
+ aNewRect.AdjustBottom(rAnchorRect.GetHeight() );
break;
case EXC_OBJ_ARC_BL:
nStartAngle = 18000;
nEndAngle = 27000;
- aNewRect.SetRight( aNewRect.Right() + rAnchorRect.GetWidth() );
- aNewRect.SetTop( aNewRect.Top() - rAnchorRect.GetHeight() );
+ aNewRect.AdjustRight(rAnchorRect.GetWidth() );
+ aNewRect.AdjustTop( -(rAnchorRect.GetHeight()) );
break;
case EXC_OBJ_ARC_BR:
nStartAngle = 27000;
nEndAngle = 0;
- aNewRect.SetLeft( aNewRect.Left() - rAnchorRect.GetWidth() );
- aNewRect.SetTop( aNewRect.Top() - rAnchorRect.GetHeight() );
+ aNewRect.AdjustLeft( -(rAnchorRect.GetWidth()) );
+ aNewRect.AdjustTop( -(rAnchorRect.GetHeight()) );
break;
}
SdrObjKind eObjKind = maFillData.IsFilled() ? OBJ_SECT : OBJ_CARC;
diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx
index d8c1a8b36ccf..dc827ce2fdd3 100644
--- a/sc/source/filter/html/htmlexp2.cxx
+++ b/sc/source/filter/html/htmlexp2.cxx
@@ -101,8 +101,8 @@ void ScHTMLExport::FillGraphList( const SdrPage* pPage, SCTAB nTab,
aSpace = MMToPixel( Size(
aCellRect.GetWidth() - aObjRect.GetWidth(),
aCellRect.GetHeight() - aObjRect.GetHeight() ));
- aSpace.setWidth( aSpace.Width() + (nCol2-nCol1) * (nCellSpacing+1) );
- aSpace.setHeight( aSpace.Height() + (nRow2-nRow1) * (nCellSpacing+1) );
+ aSpace.AdjustWidth((nCol2-nCol1) * (nCellSpacing+1) );
+ aSpace.AdjustHeight((nRow2-nRow1) * (nCellSpacing+1) );
aSpace.setWidth( aSpace.Width() / 2 );
aSpace.setHeight( aSpace.Height() / 2 );
}
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx
index 927398fcf907..40655830d47e 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -82,8 +82,8 @@ ScHTMLImport::ScHTMLImport( ScDocument* pDocP, const OUString& rBaseURL, const S
OSL_FAIL("PageSize Null ?!?!?");
aPageSize = SvxPaperInfo::GetPaperSize( PAPER_A4 );
}
- aPageSize.setWidth( aPageSize.Width() - nLeftMargin + nRightMargin );
- aPageSize.setHeight( aPageSize.Height() - nTopMargin + nBottomMargin );
+ aPageSize.AdjustWidth( -(nLeftMargin + nRightMargin) );
+ aPageSize.AdjustHeight( -(nTopMargin + nBottomMargin) );
aPageSize = pDefaultDev->LogicToPixel( aPageSize, MapMode( MapUnit::MapTwip ) );
}
else
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index d8b770a79243..d6915302aba4 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -504,8 +504,8 @@ bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, ScEEParseEntry* pE )
if ( pI->pGraphic )
bHasGraphics = true;
Size aSizePix = pI->aSize;
- aSizePix.setWidth( aSizePix.Width() + 2 * pI->aSpace.X() );
- aSizePix.setHeight( aSizePix.Height() + 2 * pI->aSpace.Y() );
+ aSizePix.AdjustWidth(2 * pI->aSpace.X() );
+ aSizePix.AdjustHeight(2 * pI->aSpace.Y() );
Size aLogicSize = pDefaultDev->PixelToLogic( aSizePix, MapMode( MapUnit::MapTwip ) );
if ( nDir & nHorizontal )
nWidth += aLogicSize.Width();
@@ -579,15 +579,15 @@ void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab,
ScHTMLImage* pI = pImage.get();
if ( nDir & nHorizontal )
{ // Horizontal
- aInsertPos.setX( aInsertPos.X() + aLogicSize.Width() );
- aInsertPos.setX( aInsertPos.X() + aSpace.X() );
+ aInsertPos.AdjustX(aLogicSize.Width() );
+ aInsertPos.AdjustX(aSpace.X() );
aInsertPos.setY( aCellInsertPos.Y() );
}
else
{ // Vertical
aInsertPos.setX( aCellInsertPos.X() );
- aInsertPos.setY( aInsertPos.Y() + aLogicSize.Height() );
- aInsertPos.setY( aInsertPos.Y() + aSpace.Y() );
+ aInsertPos.AdjustY(aLogicSize.Height() );
+ aInsertPos.AdjustY(aSpace.Y() );
}
// Add offset of Spacing
aSpace = pDefaultDev->PixelToLogic( pI->aSpace, MapMode( MapUnit::Map100thMM ) );