[Libreoffice-commits] core.git: sc/source
Noel Grandin
noel.grandin at collabora.co.uk
Sat Feb 17 06:08:20 UTC 2018
sc/source/core/data/documen3.cxx | 16 +--
sc/source/core/data/dpoutput.cxx | 24 ++---
sc/source/core/data/drwlayer.cxx | 50 +++++-----
sc/source/core/data/postit.cxx | 4
sc/source/core/tool/detfunc.cxx | 22 ++--
sc/source/core/tool/editutil.cxx | 6 -
sc/source/filter/excel/xiescher.cxx | 16 +--
sc/source/filter/html/htmlexp2.cxx | 4
sc/source/filter/html/htmlimp.cxx | 4
sc/source/filter/rtf/eeimpars.cxx | 12 +-
sc/source/ui/app/client.cxx | 16 +--
sc/source/ui/app/inputhdl.cxx | 2
sc/source/ui/app/inputwin.cxx | 8 -
sc/source/ui/cctrl/cbuttonw.cxx | 14 +-
sc/source/ui/cctrl/checklistmenu.cxx | 36 +++----
sc/source/ui/cctrl/dpcontrol.cxx | 2
sc/source/ui/cctrl/tbzoomsliderctrl.cxx | 22 ++--
sc/source/ui/condformat/condformatdlg.cxx | 4
sc/source/ui/drawfunc/fuins1.cxx | 4
sc/source/ui/drawfunc/fuins2.cxx | 2
sc/source/ui/miscdlgs/anyrefdg.cxx | 6 -
sc/source/ui/miscdlgs/autofmt.cxx | 16 +--
sc/source/ui/miscdlgs/solveroptions.cxx | 2
sc/source/ui/namedlg/namemgrtable.cxx | 2
sc/source/ui/navipi/scenwnd.cxx | 2
sc/source/ui/sidebar/CellLineStyleValueSet.cxx | 4
sc/source/ui/unoobj/viewuno.cxx | 2
sc/source/ui/view/gridwin.cxx | 76 ++++++++--------
sc/source/ui/view/gridwin4.cxx | 40 ++++----
sc/source/ui/view/gridwin5.cxx | 4
sc/source/ui/view/hdrcont.cxx | 22 ++--
sc/source/ui/view/hintwin.cxx | 2
sc/source/ui/view/notemark.cxx | 8 -
sc/source/ui/view/output.cxx | 22 ++--
sc/source/ui/view/output2.cxx | 118 ++++++++++++-------------
sc/source/ui/view/output3.cxx | 16 +--
sc/source/ui/view/preview.cxx | 20 ++--
sc/source/ui/view/prevwsh.cxx | 24 ++---
sc/source/ui/view/printfun.cxx | 58 ++++++------
sc/source/ui/view/tabview.cxx | 18 +--
sc/source/ui/view/tabview2.cxx | 12 +-
sc/source/ui/view/tabview3.cxx | 28 ++---
sc/source/ui/view/tabview4.cxx | 6 -
sc/source/ui/view/tabview5.cxx | 10 +-
sc/source/ui/view/tabvwsh2.cxx | 4
sc/source/ui/view/tabvwsh4.cxx | 12 +-
sc/source/ui/view/tabvwshb.cxx | 4
sc/source/ui/view/tabvwshg.cxx | 2
sc/source/ui/view/viewdata.cxx | 18 +--
sc/source/ui/view/viewfun5.cxx | 8 -
sc/source/ui/view/viewfun7.cxx | 12 +-
51 files changed, 421 insertions(+), 425 deletions(-)
New commits:
commit e2e4798b35ecd33a09dda85c575d7a7709ab9414
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Feb 16 10:23:51 2018 +0200
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 at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 12a8a525e785..8f37ada3dcbb 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1698,13 +1698,13 @@ tools::Rectangle ScDocument::GetEmbeddedRect() const // 1/100 mm
SCCOL i;
for (i=0; i<aEmbedRange.aStart.Col(); i++)
- aRect.SetLeft( aRect.Left() + pTable->GetColWidth(i) );
- aRect.SetTop( aRect.Top() + pTable->GetRowHeight( 0, aEmbedRange.aStart.Row() - 1) );
+ aRect.AdjustLeft(pTable->GetColWidth(i) );
+ aRect.AdjustTop(pTable->GetRowHeight( 0, aEmbedRange.aStart.Row() - 1) );
aRect.SetRight( aRect.Left() );
for (i=aEmbedRange.aStart.Col(); i<=aEmbedRange.aEnd.Col(); i++)
- aRect.SetRight( aRect.Right() + pTable->GetColWidth(i) );
+ aRect.AdjustRight(pTable->GetColWidth(i) );
aRect.SetBottom( aRect.Top() );
- aRect.SetBottom( aRect.Bottom() + pTable->GetRowHeight( aEmbedRange.aStart.Row(), aEmbedRange.aEnd.Row()) );
+ aRect.AdjustBottom(pTable->GetRowHeight( aEmbedRange.aStart.Row(), aEmbedRange.aEnd.Row()) );
aRect.SetLeft( static_cast<long>( aRect.Left() * HMM_PER_TWIPS ) );
aRect.SetRight( static_cast<long>( aRect.Right() * HMM_PER_TWIPS ) );
@@ -1970,15 +1970,15 @@ tools::Rectangle ScDocument::GetMMRect( SCCOL nStartCol, SCROW nStartRow, SCCOL
tools::Rectangle aRect;
for (i=0; i<nStartCol; i++)
- aRect.SetLeft( aRect.Left() + GetColWidth(i,nTab, bHiddenAsZero ) );
- aRect.SetTop( aRect.Top() + GetRowHeight( 0, nStartRow-1, nTab, bHiddenAsZero ) );
+ aRect.AdjustLeft(GetColWidth(i,nTab, bHiddenAsZero ) );
+ aRect.AdjustTop(GetRowHeight( 0, nStartRow-1, nTab, bHiddenAsZero ) );
aRect.SetRight( aRect.Left() );
aRect.SetBottom( aRect.Top() );
for (i=nStartCol; i<=nEndCol; i++)
- aRect.SetRight( aRect.Right() + GetColWidth(i,nTab, bHiddenAsZero) );
- aRect.SetBottom( aRect.Bottom() + GetRowHeight( nStartRow, nEndRow, nTab, bHiddenAsZero ) );
+ aRect.AdjustRight(GetColWidth(i,nTab, bHiddenAsZero) );
+ aRect.AdjustBottom(GetRowHeight( nStartRow, nEndRow, nTab, bHiddenAsZero ) );
aRect.SetLeft( static_cast<long>(aRect.Left() * HMM_PER_TWIPS) );
aRect.SetRight( static_cast<long>(aRect.Right() * HMM_PER_TWIPS) );
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index 48352bac308e..c28f82c76f51 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -1665,17 +1665,17 @@ bool ScDPOutput::GetHeaderDrag( const ScAddress& rPos, bool bMouseLeft, bool bMo
{
if (!bBeforeDrag)
{
- ++rPosRect.Bottom();
+ rPosRect.AdjustBottom( 1 );
if (bAfterDrag)
- ++rPosRect.Top();
+ rPosRect.AdjustTop( 1 );
}
}
else
{
if ( !bMouseTop )
{
- ++rPosRect.Top();
- ++rPosRect.Bottom();
+ rPosRect.AdjustTop( 1 );
+ rPosRect.AdjustBottom( 1 );
++nField;
}
}
@@ -1719,17 +1719,17 @@ bool ScDPOutput::GetHeaderDrag( const ScAddress& rPos, bool bMouseLeft, bool bMo
{
if (!bBeforeDrag)
{
- ++rPosRect.Right();
+ rPosRect.AdjustRight( 1 );
if (bAfterDrag)
- ++rPosRect.Left();
+ rPosRect.AdjustLeft( 1 );
}
}
else
{
if ( !bMouseLeft )
{
- ++rPosRect.Left();
- ++rPosRect.Right();
+ rPosRect.AdjustLeft( 1 );
+ rPosRect.AdjustRight( 1 );
++nField;
}
}
@@ -1775,17 +1775,17 @@ bool ScDPOutput::GetHeaderDrag( const ScAddress& rPos, bool bMouseLeft, bool bMo
{
if (!bBeforeDrag)
{
- ++rPosRect.Bottom();
+ rPosRect.AdjustBottom( 1 );
if (bAfterDrag)
- ++rPosRect.Top();
+ rPosRect.AdjustTop( 1 );
}
}
else
{
if ( !bMouseTop )
{
- ++rPosRect.Top();
- ++rPosRect.Bottom();
+ rPosRect.AdjustTop( 1 );
+ rPosRect.AdjustBottom( 1 );
++nField;
}
}
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 66cb65b18e2f..537e99791005 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -715,10 +715,10 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
Size aSize( TwipsToHmm( pDoc->GetColWidth( nCol1, nTab1) ),
TwipsToHmm( pDoc->GetRowHeight( nRow1, nTab1) ) );
tools::Rectangle aRect( aPos, aSize );
- aRect.SetLeft( aRect.Left() - 250 );
- aRect.SetRight( aRect.Right() + 250 );
- aRect.SetTop( aRect.Top() - 70 );
- aRect.SetBottom( aRect.Bottom() + 70 );
+ aRect.AdjustLeft( -250 );
+ aRect.AdjustRight(250 );
+ aRect.AdjustTop( -70 );
+ aRect.AdjustBottom(70 );
if ( bNegativePage )
MirrorRectRTL( aRect );
@@ -746,9 +746,9 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
{
Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
if (!pDoc->ColHidden(nCol1, nTab1, nullptr, &nLastCol))
- aPos.setX( aPos.X() + pDoc->GetColWidth( nCol1, nTab1 ) / 4 );
+ aPos.AdjustX(pDoc->GetColWidth( nCol1, nTab1 ) / 4 );
if (!pDoc->RowHidden(nRow1, nTab1, nullptr, &nLastRow))
- aPos.setY( aPos.Y() + pDoc->GetRowHeight( nRow1, nTab1 ) / 2 );
+ aPos.AdjustY(pDoc->GetRowHeight( nRow1, nTab1 ) / 2 );
TwipsToMM( aPos.X() );
TwipsToMM( aPos.Y() );
Point aStartPos = aPos;
@@ -767,7 +767,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
{
Point aEndPos( aPos.X() + DET_ARROW_OFFSET, aPos.Y() - DET_ARROW_OFFSET );
if (aEndPos.Y() < 0)
- aEndPos.setY( aEndPos.Y() + (2 * DET_ARROW_OFFSET) );
+ aEndPos.AdjustY(2 * DET_ARROW_OFFSET);
if ( bNegativePage )
aEndPos.setX( -aEndPos.X() );
if ( pObj->GetPoint( 1 ) != aEndPos )
@@ -784,9 +784,9 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
{
Point aPos( pDoc->GetColOffset( nCol2, nTab2 ), pDoc->GetRowOffset( nRow2, nTab2 ) );
if (!pDoc->ColHidden(nCol2, nTab2, nullptr, &nLastCol))
- aPos.setX( aPos.X() + pDoc->GetColWidth( nCol2, nTab2 ) / 4 );
+ aPos.AdjustX(pDoc->GetColWidth( nCol2, nTab2 ) / 4 );
if (!pDoc->RowHidden(nRow2, nTab2, nullptr, &nLastRow))
- aPos.setY( aPos.Y() + pDoc->GetRowHeight( nRow2, nTab2 ) / 2 );
+ aPos.AdjustY(pDoc->GetRowHeight( nRow2, nTab2 ) / 2 );
TwipsToMM( aPos.X() );
TwipsToMM( aPos.Y() );
Point aEndPos = aPos;
@@ -805,9 +805,9 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
{
Point aStartPos( aPos.X() - DET_ARROW_OFFSET, aPos.Y() - DET_ARROW_OFFSET );
if (aStartPos.X() < 0)
- aStartPos.setX( aStartPos.X() + (2 * DET_ARROW_OFFSET) );
+ aStartPos.AdjustX(2 * DET_ARROW_OFFSET);
if (aStartPos.Y() < 0)
- aStartPos.setY( aStartPos.Y() + (2 * DET_ARROW_OFFSET) );
+ aStartPos.AdjustY(2 * DET_ARROW_OFFSET);
if ( bNegativePage )
aStartPos.setX( -aStartPos.X() );
if ( pObj->GetPoint( 0 ) != aStartPos )
@@ -1174,14 +1174,14 @@ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCR
if (nDx > 0)
for (SCCOL s=0; s<nDx; s++)
- aMove.setX( aMove.X() + pDoc->GetColWidth(s+nCol1,nTab) );
+ aMove.AdjustX(pDoc->GetColWidth(s+nCol1,nTab) );
else
for (SCCOL s=-1; s>=nDx; s--)
- aMove.setX( aMove.X() - pDoc->GetColWidth(s+nCol1,nTab) );
+ aMove.AdjustX( -(pDoc->GetColWidth(s+nCol1,nTab)) );
if (nDy > 0)
- aMove.setY( aMove.Y() + pDoc->GetRowHeight( nRow1, nRow1+nDy-1, nTab) );
+ aMove.AdjustY(pDoc->GetRowHeight( nRow1, nRow1+nDy-1, nTab) );
else
- aMove.setY( aMove.Y() - pDoc->GetRowHeight( nRow1+nDy, nRow1-1, nTab) );
+ aMove.AdjustY( -sal_Int16(pDoc->GetRowHeight( nRow1+nDy, nRow1-1, nTab)) );
if ( bNegativePage )
aMove.setX( -aMove.X() );
@@ -1190,9 +1190,9 @@ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCR
if (bInsDel)
{
if ( aMove.X() != 0 && nDx < 0 ) // nDx counts cells, sign is independent of RTL
- aTopLeft.setX( aTopLeft.X() + aMove.X() );
+ aTopLeft.AdjustX(aMove.X() );
if ( aMove.Y() < 0 )
- aTopLeft.setY( aTopLeft.Y() + aMove.Y() );
+ aTopLeft.AdjustY(aMove.Y() );
}
// Detectiv arrows: Adjust cell position
@@ -1217,21 +1217,21 @@ bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow )
tools::Rectangle aTestRect;
- aTestRect.SetTop( aTestRect.Top() + pDoc->GetRowHeight( 0, nStartRow-1, nTab) );
+ aTestRect.AdjustTop(pDoc->GetRowHeight( 0, nStartRow-1, nTab) );
if (nEndRow==MAXROW)
- aTestRect.Bottom() = MAXMM;
+ aTestRect.SetBottom( MAXMM );
else
{
aTestRect.SetBottom( aTestRect.Top() );
- aTestRect.SetBottom( aTestRect.Bottom() + pDoc->GetRowHeight( nStartRow, nEndRow, nTab) );
+ aTestRect.AdjustBottom(pDoc->GetRowHeight( nStartRow, nEndRow, nTab) );
TwipsToMM( aTestRect.Bottom() );
}
TwipsToMM( aTestRect.Top() );
aTestRect.SetLeft( 0 );
- aTestRect.Right() = MAXMM;
+ aTestRect.SetRight( MAXMM );
bool bNegativePage = pDoc->IsNegativePage( nTab );
if ( bNegativePage )
@@ -1727,9 +1727,9 @@ tools::Rectangle ScDrawLayer::GetCellRect( const ScDocument& rDoc, const ScAddre
// find top left position of passed cell address
Point aTopLeft;
for( SCCOL nCol = 0; nCol < rPos.Col(); ++nCol )
- aTopLeft.setX( aTopLeft.X() + rDoc.GetColWidth( nCol, rPos.Tab() ) );
+ aTopLeft.AdjustX(rDoc.GetColWidth( nCol, rPos.Tab() ) );
if( rPos.Row() > 0 )
- aTopLeft.setY( aTopLeft.Y() + rDoc.GetRowHeight( 0, rPos.Row() - 1, rPos.Tab() ) );
+ aTopLeft.AdjustY(rDoc.GetRowHeight( 0, rPos.Row() - 1, rPos.Tab() ) );
// find bottom-right position of passed cell address
ScAddress aEndPos = rPos;
@@ -1743,8 +1743,8 @@ tools::Rectangle ScDrawLayer::GetCellRect( const ScDocument& rDoc, const ScAddre
}
Point aBotRight = aTopLeft;
for( SCCOL nCol = rPos.Col(); nCol <= aEndPos.Col(); ++nCol )
- aBotRight.setX( aBotRight.X() + rDoc.GetColWidth( nCol, rPos.Tab() ) );
- aBotRight.setY( aBotRight.Y() + rDoc.GetRowHeight( rPos.Row(), aEndPos.Row(), rPos.Tab() ) );
+ aBotRight.AdjustX(rDoc.GetColWidth( nCol, rPos.Tab() ) );
+ aBotRight.AdjustY(rDoc.GetRowHeight( rPos.Row(), aEndPos.Row(), rPos.Tab() ) );
// twips -> 1/100 mm
aTopLeft.setX( static_cast< long >( aTopLeft.X() * HMM_PER_TWIPS ) );
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index e0dbbe124750..f46e619c201e 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -365,8 +365,8 @@ Point ScCaptionCreator::CalcTailPos( bool bTailFront )
bool bTailLeft = bTailFront != mbNegPage;
Point aTailPos = bTailLeft ? maCellRect.TopLeft() : maCellRect.TopRight();
// move caption point 1/10 mm inside cell
- if( bTailLeft ) aTailPos.setX( aTailPos.X() + 10 ); else aTailPos.setX( aTailPos.X() - 10 );
- aTailPos.setY( aTailPos.Y() + 10 );
+ if( bTailLeft ) aTailPos.AdjustX(10 ); else aTailPos.AdjustX( -10 );
+ aTailPos.Y() += 10;
return aTailPos;
}
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index a87714d79bf0..8762ad70240b 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -316,14 +316,14 @@ Point ScDetectiveFunc::GetDrawPos( SCCOL nCol, SCROW nRow, DrawPosMode eMode ) c
++nRow;
break;
case DrawPosMode::DetectiveArrow:
- aPos.setX( aPos.X() + pDoc->GetColWidth( nCol, nTab ) / 4 );
- aPos.setY( aPos.Y() + pDoc->GetRowHeight( nRow, nTab ) / 2 );
+ aPos.AdjustX(pDoc->GetColWidth( nCol, nTab ) / 4 );
+ aPos.AdjustY(pDoc->GetRowHeight( nRow, nTab ) / 2 );
break;
}
for ( SCCOL i = 0; i < nCol; ++i )
- aPos.setX( aPos.X() + pDoc->GetColWidth( i, nTab ) );
- aPos.setY( aPos.Y() + pDoc->GetRowHeight( 0, nRow - 1, nTab ) );
+ aPos.AdjustX(pDoc->GetColWidth( i, nTab ) );
+ aPos.AdjustY(pDoc->GetRowHeight( 0, nRow - 1, nTab ) );
aPos.setX( static_cast< long >( aPos.X() * HMM_PER_TWIPS ) );
aPos.setY( static_cast< long >( aPos.Y() * HMM_PER_TWIPS ) );
@@ -476,9 +476,9 @@ bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow,
aStartPos = Point( aEndPos.X() - 1000 * nPageSign, aEndPos.Y() - 1000 );
if (aStartPos.X() * nPageSign < 0)
- aStartPos.setX( aStartPos.X() + 2000 * nPageSign );
+ aStartPos.AdjustX(2000 * nPageSign );
if (aStartPos.Y() < 0)
- aStartPos.setY( aStartPos.Y() + 2000 );
+ aStartPos.AdjustY(2000 );
}
SfxItemSet& rAttrSet = bFromOtherTab ? rData.GetFromTabSet() : rData.GetArrowSet();
@@ -545,7 +545,7 @@ bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow,
Point aStartPos = GetDrawPos( nStartCol, nStartRow, DrawPosMode::DetectiveArrow );
Point aEndPos = Point( aStartPos.X() + 1000 * nPageSign, aStartPos.Y() - 1000 );
if (aEndPos.Y() < 0)
- aEndPos.setY( aEndPos.Y() + 2000 );
+ aEndPos.AdjustY(2000 );
SfxItemSet& rAttrSet = rData.GetToTabSet();
if (bArea)
@@ -620,10 +620,10 @@ void ScDetectiveFunc::DrawCircle( SCCOL nCol, SCROW nRow, ScDetectiveData& rData
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab));
tools::Rectangle aRect = GetDrawRect( nCol, nRow );
- aRect.SetLeft( aRect.Left() - 250 );
- aRect.SetRight( aRect.Right() + 250 );
- aRect.SetTop( aRect.Top() - 70 );
- aRect.SetBottom( aRect.Bottom() + 70 );
+ aRect.AdjustLeft( -250 );
+ aRect.AdjustRight(250 );
+ aRect.AdjustTop( -70 );
+ aRect.AdjustBottom(70 );
SdrCircObj* pCircle = new SdrCircObj( OBJ_CIRC, aRect );
SfxItemSet& rAttrSet = rData.GetCircleSet();
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index baaee13ba8db..3906dd06fbd7 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -310,7 +310,7 @@ tools::Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bF
SvxCellHorJustify::Left )
nIndent = pPattern->GetItem(ATTR_INDENT).GetValue();
long nPixDifX = static_cast<long>( ( pMargin->GetLeftMargin() + nIndent ) * nPPTX );
- aStartPos.setX( aStartPos.X() + nPixDifX * nLayoutSign );
+ aStartPos.AdjustX(nPixDifX * nLayoutSign );
nCellX -= nPixDifX + static_cast<long>( pMargin->GetRightMargin() * nPPTX ); // due to line feed, etc.
// align vertical position to the one in the table
@@ -356,11 +356,11 @@ tools::Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bF
}
}
- aStartPos.setY( aStartPos.Y() + nPixDifY );
+ aStartPos.AdjustY(nPixDifY );
nCellY -= nPixDifY;
if ( bLayoutRTL )
- aStartPos.setX( aStartPos.X() - nCellX - 2 ); // excluding grid on both sides
+ aStartPos.AdjustX( -(nCellX - 2) ); // excluding grid on both sides
// -1 -> don't overwrite grid
return tools::Rectangle( aStartPos, Size(nCellX-1,nCellY-1) );
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 ) );
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index 11b2edcdaf4e..83b0c4d43ed4 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -113,27 +113,27 @@ void ScClient::RequestNewObjectArea( tools::Rectangle& aLogicRect )
if (aLogicRect.Right() > aPageRect.Right())
{
long nDiff = aLogicRect.Right() - aPageRect.Right();
- aLogicRect.SetLeft( aLogicRect.Left() - nDiff );
- aLogicRect.SetRight( aLogicRect.Right() - nDiff );
+ aLogicRect.AdjustLeft( -nDiff );
+ aLogicRect.AdjustRight( -nDiff );
}
if (aLogicRect.Bottom() > aPageRect.Bottom())
{
long nDiff = aLogicRect.Bottom() - aPageRect.Bottom();
- aLogicRect.SetTop( aLogicRect.Top() - nDiff );
- aLogicRect.SetBottom( aLogicRect.Bottom() - nDiff );
+ aLogicRect.AdjustTop( -nDiff );
+ aLogicRect.AdjustBottom( -nDiff );
}
if (aLogicRect.Left() < aPageRect.Left())
{
long nDiff = aLogicRect.Left() - aPageRect.Left();
- aLogicRect.SetRight( aLogicRect.Right() - nDiff );
- aLogicRect.SetLeft( aLogicRect.Left() - nDiff );
+ aLogicRect.AdjustRight( -nDiff );
+ aLogicRect.AdjustLeft( -nDiff );
}
if (aLogicRect.Top() < aPageRect.Top())
{
long nDiff = aLogicRect.Top() - aPageRect.Top();
- aLogicRect.SetBottom( aLogicRect.Bottom() - nDiff );
- aLogicRect.SetTop( aLogicRect.Top() - nDiff );
+ aLogicRect.AdjustBottom( -nDiff );
+ aLogicRect.AdjustTop( -nDiff );
}
}
}
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 5a9bf32ad918..62c0697d5419 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1097,7 +1097,7 @@ void ScInputHandler::ShowTipBelow( const OUString& rText )
if ( pCur )
{
Point aLogicPos = pCur->GetPos();
- aLogicPos.setY( aLogicPos.Y() + pCur->GetHeight() );
+ aLogicPos.AdjustY(pCur->GetHeight() );
aPos = pTipVisibleSecParent->LogicToPixel( aLogicPos );
}
aPos = pTipVisibleSecParent->OutputToScreenPixel( aPos );
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 550f5cff6d62..da42d3bfff18 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -462,7 +462,7 @@ void ScInputWindow::Resize()
// then the largest item ( e.g. the GroupBar window ) will actually be
// positioned such that the toolbar will cut off the bottom of that item
if (pGroupBar->GetNumLines() > 1)
- aSize.setHeight( aSize.Height() + pGroupBar->GetVertOffset() + ADDITIONAL_SPACE );
+ aSize.AdjustHeight(pGroupBar->GetVertOffset() + ADDITIONAL_SPACE );
}
SetSizePixel(aSize);
Invalidate();
@@ -1173,8 +1173,8 @@ static void lcl_ModifyRTLVisArea( EditView* pEditView )
tools::Rectangle aVisArea = pEditView->GetVisArea();
Size aPaper = pEditView->GetEditEngine()->GetPaperSize();
long nDiff = aPaper.Width() - aVisArea.Right();
- aVisArea.SetLeft( aVisArea.Left() + nDiff );
- aVisArea.SetRight( aVisArea.Right() + nDiff );
+ aVisArea.AdjustLeft(nDiff );
+ aVisArea.AdjustRight(nDiff );
pEditView->SetVisArea(aVisArea);
}
@@ -1789,7 +1789,7 @@ ScPosWnd::ScPosWnd( vcl::Window* pParent ) :
set_id("pos_window");
Size aSize( GetTextWidth( "GW99999:GW99999" ),
GetTextHeight() );
- aSize.setWidth( aSize.Width() + 25 ); // FIXME: ??
+ aSize.AdjustWidth(25 ); // FIXME: ??
aSize.setHeight( CalcWindowSizePixel(11) ); // Functions: 10 MRU + "others..."
SetSizePixel( aSize );
diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx
index 74d18d4fec84..0b0965f61e90 100644
--- a/sc/source/ui/cctrl/cbuttonw.cxx
+++ b/sc/source/ui/cctrl/cbuttonw.cxx
@@ -68,10 +68,10 @@ void ScDDComboBoxButton::Draw( const Point& rAt,
tools::Rectangle aInnerRect=aDecoView.DrawButton( aBtnRect, DrawButtonFlags::Default );
- aInnerRect.SetLeft( aInnerRect.Left() + 1 );
- aInnerRect.SetTop( aInnerRect.Top() + 1 );
- aInnerRect.SetRight( aInnerRect.Right() - 1 );
- aInnerRect.SetBottom( aInnerRect.Bottom() - 1 );
+ aInnerRect.AdjustLeft(1 );
+ aInnerRect.AdjustTop(1 );
+ aInnerRect.AdjustRight( -1 );
+ aInnerRect.Bottom() -= 1;
Size aInnerSize = aInnerRect.GetSize();
Point aInnerCenter = aInnerRect.Center();
@@ -128,10 +128,8 @@ void ScDDComboBoxButton::ImpDrawArrow( const tools::Rectangle& rRect )
while( aPos1.X() <= aPos2.X() )
{
pOut->DrawLine( aPos1, aPos2 );
- aPos1.setX( ++aPos1.X() );
- aPos2.setX( --aPos2.X() );
- aPos1.setY( ++aPos1.Y() );
- aPos2.setY( ++aPos2.Y() );
+ aPos1.AdjustX( 1 ); aPos2.X()--;
+ aPos1.AdjustY( 1 ); aPos2.Y()++;
}
pOut->DrawLine( Point( aCenter.X() - aSize3.Width(), aPos1.Y()+1 ),
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 1bc8a827008f..fcffd7809543 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -344,8 +344,8 @@ Size ScMenuFloatingWindow::getMenuSize() const
Point aPos;
Size aSize;
getMenuItemPosSize(nLastPos, aPos, aSize);
- aPos.setX( aPos.X() + nTextWidth + 15 );
- aPos.setY( aPos.Y() + aSize.Height() + 5 );
+ aPos.AdjustX(nTextWidth + 15 );
+ aPos.AdjustY(aSize.Height() + 5 );
return Size(aPos.X(), aPos.Y());
}
@@ -369,8 +369,8 @@ void ScMenuFloatingWindow::drawMenuItem(vcl::RenderContext& rRenderContext, size
{
long nFontHeight = maLabelFont.GetFontHeight();
Point aMarkerPos = aPos;
- aMarkerPos.setY( aMarkerPos.Y() + aSize.Height() / 2 - nFontHeight / 4 + 1 );
- aMarkerPos.setX( aMarkerPos.X() + aSize.Width() - nFontHeight + nFontHeight / 4 );
+ aMarkerPos.AdjustY(aSize.Height() / 2 - nFontHeight / 4 + 1 );
+ aMarkerPos.AdjustX(aSize.Width() - nFontHeight + nFontHeight / 4 );
Size aMarkerSize(nFontHeight / 2, nFontHeight / 2);
aDecoView.DrawSymbol(tools::Rectangle(aMarkerPos, aMarkerSize), SymbolType::SPIN_RIGHT, GetTextColor());
}
@@ -410,10 +410,10 @@ void ScMenuFloatingWindow::drawSeparator(vcl::RenderContext& rRenderContext, siz
{
const StyleSettings& rStyle = rRenderContext.GetSettings().GetStyleSettings();
Point aTmpPos = aPos;
- aTmpPos.setY( aTmpPos.Y() + aSize.Height() / 2 );
+ aTmpPos.AdjustY(aSize.Height() / 2 );
rRenderContext.SetLineColor(rStyle.GetShadowColor());
rRenderContext.DrawLine(aTmpPos, Point(aSize.Width() + aTmpPos.X(), aTmpPos.Y()));
- ++aTmpPos.Y();
+ aTmpPos.AdjustY( 1 );
rRenderContext.SetLineColor(rStyle.GetLightColor());
rRenderContext.DrawLine(aTmpPos, Point(aSize.Width() + aTmpPos.X(), aTmpPos.Y()));
rRenderContext.SetLineColor();
@@ -728,7 +728,7 @@ void ScMenuFloatingWindow::getMenuItemPosSize(size_t nPos, Point& rPos, Size& rS
Point aPos1(nLeftMargin, nTopMargin);
rPos = aPos1;
for (size_t i = 0; i < nPos; ++i)
- rPos.setY( rPos.Y() + (maMenuItems[i].mbSeparator ? nSepHeight : nMenuItemHeight) );
+ rPos.AdjustY(maMenuItems[i].mbSeparator ? nSepHeight : nMenuItemHeight );
Size aWndSize = GetSizePixel();
sal_uInt16 nH = maMenuItems[nPos].mbSeparator ? nSepHeight : nMenuItemHeight;
@@ -979,12 +979,12 @@ void ScCheckListMenuWindow::getSectionPosSize(
case LISTBOX_AREA_INNER:
{
rPos = Point(nListBoxMargin, nTopMargin + nMenuHeight + nMenuListMargin + nSearchBoxHeight + nSearchBoxMargin);
- rPos.setX( rPos.X() + nListBoxInnerPadding );
- rPos.setY( rPos.Y() + nListBoxInnerPadding );
+ rPos.AdjustX(nListBoxInnerPadding );
+ rPos.AdjustY(nListBoxInnerPadding );
rSize = Size(nListBoxWidth, nListBoxHeight);
- rSize.setWidth( rSize.Width() - nListBoxInnerPadding*2 );
- rSize.setHeight( rSize.Height() - nListBoxInnerPadding*2 );
+ rSize.AdjustWidth( -(nListBoxInnerPadding*2) );
+ rSize.AdjustHeight( -(nListBoxInnerPadding*2) );
}
break;
case SINGLE_BTN_AREA:
@@ -997,8 +997,8 @@ void ScCheckListMenuWindow::getSectionPosSize(
{
long h = std::min(maChkToggleAll->CalcMinimumSize().Height(), 26L);
rPos = Point(nListBoxMargin, nSingleBtnAreaY);
- rPos.setX( rPos.X() + 5 );
- rPos.setY( rPos.Y() + (nSingleItemBtnAreaHeight - h)/2 );
+ rPos.AdjustX(5 );
+ rPos.AdjustY((nSingleItemBtnAreaHeight - h)/2 );
rSize = Size(70, h);
}
break;
@@ -1006,8 +1006,8 @@ void ScCheckListMenuWindow::getSectionPosSize(
{
long h = 26 * fScaleFactor;
rPos = Point(nListBoxMargin, nSingleBtnAreaY);
- rPos.setX( rPos.X() + nListBoxWidth - h - 10 - h - 10 );
- rPos.setY( rPos.Y() + (nSingleItemBtnAreaHeight - h)/2 );
+ rPos.AdjustX(nListBoxWidth - h - 10 - h - 10 );
+ rPos.AdjustY((nSingleItemBtnAreaHeight - h)/2 );
rSize = Size(h, h);
}
break;
@@ -1015,8 +1015,8 @@ void ScCheckListMenuWindow::getSectionPosSize(
{
long h = 26 * fScaleFactor;
rPos = Point(nListBoxMargin, nSingleBtnAreaY);
- rPos.setX( rPos.X() + nListBoxWidth - h - 10 );
- rPos.setY( rPos.Y() + (nSingleItemBtnAreaHeight - h)/2 );
+ rPos.AdjustX(nListBoxWidth - h - 10 );
+ rPos.AdjustY((nSingleItemBtnAreaHeight - h)/2 );
rSize = Size(h, h);
}
break;
@@ -1996,7 +1996,7 @@ void ScCheckListMenuWindow::launch(const tools::Rectangle& rRect)
// Simulate right-aligned launch by modifying the target rectangle
// size.
long nDiff = aRect.GetWidth() - maWndSize.Width();
- aRect.SetLeft( aRect.Left() + nDiff );
+ aRect.AdjustLeft(nDiff );
}
StartPopupMode(aRect, (FloatWinPopupFlags::Down | FloatWinPopupFlags::GrabFocus));
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 5667522e2161..a714f116f9c5 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -64,7 +64,7 @@ void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize, bool
if (bLayoutRTL)
{
// rPos is the logical-left position, adjust maPos to visual-left (inside the cell border)
- maPos.setX( maPos.X() - maSize.Width() - 1 );
+ maPos.AdjustX( -(maSize.Width() - 1) );
}
}
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 832eef885a8e..09ae675c052a 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -399,10 +399,10 @@ void ScZoomSliderWnd::DoPaint(vcl::RenderContext& rRenderContext)
tools::Rectangle aSlider = aRect;
- aSlider.SetTop( aSlider.Top() + (aSliderWindowSize.Height() - nSliderHeight) / 2 - 1 );
+ aSlider.AdjustTop((aSliderWindowSize.Height() - nSliderHeight) / 2 - 1 );
aSlider.SetBottom( aSlider.Top() + nSliderHeight );
- aSlider.SetLeft( aSlider.Left() + nSliderXOffset );
- aSlider.SetRight( aSlider.Right() - nSliderXOffset );
+ aSlider.AdjustLeft(nSliderXOffset );
+ aSlider.AdjustRight( -nSliderXOffset );
tools::Rectangle aFirstLine(aSlider);
aFirstLine.SetBottom( aFirstLine.Top() );
@@ -450,26 +450,26 @@ void ScZoomSliderWnd::DoPaint(vcl::RenderContext& rRenderContext)
tools::Rectangle aSnapping(aRect);
aSnapping.SetBottom( aSlider.Top() );
aSnapping.SetTop( aSnapping.Bottom() - nSnappingHeight );
- aSnapping.SetLeft( aSnapping.Left() + *aSnappingPointIter );
+ aSnapping.AdjustLeft(*aSnappingPointIter );
aSnapping.SetRight( aSnapping.Left() );
pVDev->DrawRect(aSnapping);
- aSnapping.SetTop( aSnapping.Top() + nSnappingHeight + nSliderHeight );
- aSnapping.SetBottom( aSnapping.Bottom() + nSnappingHeight + nSliderHeight );
+ aSnapping.AdjustTop(nSnappingHeight + nSliderHeight );
+ aSnapping.AdjustBottom(nSnappingHeight + nSliderHeight );
pVDev->DrawRect(aSnapping);
}
// draw slider button
Point aImagePoint = aRect.TopLeft();
- aImagePoint.setX( aImagePoint.X() + Zoom2Offset(mpImpl->mnCurrentZoom) );
- aImagePoint.setX( aImagePoint.X() - nButtonWidth / 2 );
- aImagePoint.setY( aImagePoint.Y() + (aSliderWindowSize.Height() - nButtonHeight) / 2 );
+ aImagePoint.AdjustX(Zoom2Offset(mpImpl->mnCurrentZoom) );
+ aImagePoint.AdjustX( -(nButtonWidth / 2) );
+ aImagePoint.Y() += (aSliderWindowSize.Height() - nButtonHeight) / 2;
pVDev->DrawImage(aImagePoint, mpImpl->maSliderButton);
// draw decrease button
aImagePoint = aRect.TopLeft();
- aImagePoint.setX( aImagePoint.X() + (nSliderXOffset - nIncDecWidth) / 2 );
- aImagePoint.setY( aImagePoint.Y() + (aSliderWindowSize.Height() - nIncDecHeight) / 2 );
+ aImagePoint.AdjustX((nSliderXOffset - nIncDecWidth) / 2 );
+ aImagePoint.AdjustY((aSliderWindowSize.Height() - nIncDecHeight) / 2 );
pVDev->DrawImage(aImagePoint, mpImpl->maDecreaseButton);
// draw increase button
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 7c4332814ca4..b162591cc129 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -237,7 +237,7 @@ void ScCondFormatList::RecalcAll()
aSize.setWidth( aCtrlSize.Width() );
item->SetSizePixel(aSize);
- aPoint.setY( aPoint.Y() + item->GetSizePixel().Height() );
+ aPoint.AdjustY(item->GetSizePixel().Height() );
}
}
@@ -245,7 +245,7 @@ void ScCondFormatList::DoScroll(long nDelta)
{
Point aNewPoint = mpScrollBar->GetPosPixel();
tools::Rectangle aRect(Point(), GetOutputSize());
- aRect.SetRight( aRect.Right() - mpScrollBar->GetSizePixel().Width() );
+ aRect.AdjustRight( -(mpScrollBar->GetSizePixel().Width()) );
Scroll( 0, -nDelta, aRect );
mpScrollBar->SetPosPixel(aNewPoint);
}
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 9098405242f1..445d6193b239 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -155,7 +155,7 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
ScViewData& rData = pViewSh->GetViewData();
if ( rData.GetDocument()->IsNegativePage( rData.GetTabNo() ) )
- aInsertPos.setX( aInsertPos.X() - aLogicSize.Width() ); // move position to left edge
+ aInsertPos.AdjustX( -(aLogicSize.Width()) ); // move position to left edge
ScLimitSizeOnDrawPage( aLogicSize, aInsertPos, pPage->GetSize() );
@@ -208,7 +208,7 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi,
ScLimitSizeOnDrawPage( aSize, aInsertPos, pPage->GetSize() );
if( rData.GetDocument()->IsNegativePage( rData.GetTabNo() ) )
- aInsertPos.setX( aInsertPos.X() - aSize.Width() );
+ aInsertPos.AdjustX( -(aSize.Width()) );
OUString realURL;
if (bLink)
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 33ae6cc58639..a041c7b8f98e 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -349,7 +349,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView*
Point aPnt = pViewSh->GetInsertPos();
if ( rData.GetDocument()->IsNegativePage( rData.GetTabNo() ) )
- aPnt.setX( aPnt.X() - aSize.Width() ); // move position to left edge
+ aPnt.AdjustX( -(aSize.Width()) ); // move position to left edge
tools::Rectangle aRect (aPnt, aSize);
SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect);
SdrPageView* pPV = pView->GetSdrPageView();
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index d6d6948cf631..1e4e5103547c 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -542,8 +542,8 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
long nOffset = 0;
if (pRefBtn)
{
- aNewEditSize.setWidth( aNewEditSize.Width() - pRefBtn->GetSizePixel().Width() );
- aNewEditSize.setWidth( aNewEditSize.Width() - aOldButtonPos.X() - (aOldEditPos.X()+aOldEditSize.Width()) );
+ aNewEditSize.AdjustWidth( -(pRefBtn->GetSizePixel().Width()) );
+ aNewEditSize.AdjustWidth( -(aOldButtonPos.X() - (aOldEditPos.X()+aOldEditSize.Width())) );
long nHeight = pRefBtn->GetSizePixel().Height();
if ( nHeight > aOldEditSize.Height() )
@@ -551,7 +551,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
aNewDlgSize.setHeight( nHeight );
nOffset = (nHeight-aOldEditSize.Height()) / 2;
}
- aNewEditSize.setWidth( aNewEditSize.Width() - nOffset );
+ aNewEditSize.AdjustWidth( -nOffset );
}
pRefEdit->SetPosSizePixel(Point(nOffset, nOffset), aNewEditSize);
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index 305683182e84..43a4d0edc146 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -272,8 +272,8 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo
MakeFonts( nFmtIndex, aFont, aCJKFont, aCTLFont );
theMaxStrSize = Size(basegfx::fround(cellRange.getWidth()), basegfx::fround(cellRange.getHeight()));
- theMaxStrSize.Width() -= FRAME_OFFSET;
- theMaxStrSize.Height() -= FRAME_OFFSET;
+ theMaxStrSize.AdjustWidth( -(FRAME_OFFSET) );
+ theMaxStrSize.AdjustHeight( -(FRAME_OFFSET) );
aScriptedText.SetFonts( &aFont, &aCJKFont, &aCTLFont );
aScriptedText.SetText(cellString, xBreakIter);
@@ -308,7 +308,7 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo
// vertical (always center):
- aPos.setY( aPos.Y() + (mnRowHeight - static_cast<sal_uInt16>(aStrSize.Height())) / 2 );
+ aPos.AdjustY((mnRowHeight - static_cast<sal_uInt16>(aStrSize.Height())) / 2 );
// horizontal
@@ -320,15 +320,15 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo
switch (eJustification)
{
case SvxCellHorJustify::Left:
- aPos.X() += FRAME_OFFSET;
+ aPos.AdjustX(FRAME_OFFSET );
break;
case SvxCellHorJustify::Right:
- aPos.setX( aPos.X() + nRightX );
+ aPos.AdjustX(nRightX );
break;
case SvxCellHorJustify::Block:
case SvxCellHorJustify::Repeat:
case SvxCellHorJustify::Center:
- aPos.setX( aPos.X() + nHorPos );
+ aPos.AdjustX(nHorPos );
break;
// coverity[dead_error_line] - following conditions exist to avoid compiler warning
case SvxCellHorJustify::Standard:
@@ -345,12 +345,12 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo
if (nCol == 0 || nRow == 0)
{
// Text label to the left or sum left adjusted
- aPos.X() += FRAME_OFFSET;
+ aPos.AdjustX(FRAME_OFFSET );
}
else
{
// Numbers/Dates right adjusted
- aPos.setX( aPos.X() + nRightX );
+ aPos.AdjustX(nRightX );
}
}
aScriptedText.DrawText(aPos);
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index ebc906b12f88..adb02578012a 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -90,7 +90,7 @@ void ScSolverOptionsString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vc
rRenderContext.DrawText(rPos, aNormalStr);
Point aNewPos(rPos);
- aNewPos.setX( aNewPos.X() + rRenderContext.GetTextWidth(aNormalStr) );
+ aNewPos.AdjustX(rRenderContext.GetTextWidth(aNormalStr) );
vcl::Font aOldFont(rRenderContext.GetFont());
vcl::Font aFont(aOldFont);
aFont.SetWeight(WEIGHT_BOLD);
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx
index 5979ea12c4c0..b0dd62dbda25 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -297,7 +297,7 @@ IMPL_LINK_NOARG(ScRangeManagerTable, HeaderEndDragHdl, HeaderBar*, void)
SetTab(0, 0);
SetTab(1, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() );
- aSz.setWidth( aSz.Width() + nItemRangeSize );
+ aSz.AdjustWidth(nItemRangeSize );
SetTab(2, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() );
}
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index ded3e3f46353..ea9dd1af7205 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -278,7 +278,7 @@ void ScScenarioWindow::Resize()
aSize.setHeight( nHeight );
aLbScenario->SetSizePixel(aSize);
- aSize.setHeight( aSize.Height() - 4 );
+ aSize.AdjustHeight( -4 );
aEdComment->SetPosSizePixel(Point(0, nHeight + 4), aSize);
}
diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
index ed7df82d1556..27c876e7e7a6 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
@@ -94,8 +94,8 @@ void CellLineStyleValueSet::UserDraw( const UserDrawEvent& rUDEvt )
{
Color aBackColor(50,107,197);
tools::Rectangle aBackRect = aRect;
- aBackRect.SetTop( aBackRect.Top() + 3 );
- aBackRect.SetBottom( aBackRect.Bottom() - 2 );
+ aBackRect.AdjustTop(3 );
+ aBackRect.AdjustBottom( -2 );
pDev->SetFillColor(aBackColor);
pDev->DrawRect(aBackRect);
}
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 992b0b16d9f0..094d1d4d4557 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -398,7 +398,7 @@ awt::Rectangle ScViewPaneBase::GetVisArea() const
if ( pDoc->IsLayoutRTL( aCell.Tab() ) )
{
aVisPos = aCellRect.TopRight();
- aVisPos.setX( aVisPos.X() - aVisSize.Width() );
+ aVisPos.AdjustX( -(aVisSize.Width()) );
}
tools::Rectangle aVisRect( aVisPos, aVisSize );
aVisArea = AWTRectangle(aVisRect);
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 12ea86d53ca6..33a2d1626596 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -909,10 +909,10 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange )
nSizeY = ScViewData::ToPixel(pDoc->GetRowHeight(nRow, nTab), pViewData->GetPPTY());
Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich );
if ( bLayoutRTL )
- aPos.setX( aPos.X() - nSizeX );
+ aPos.AdjustX( -nSizeX );
tools::Rectangle aCellRect( OutputToScreenPixel(aPos), Size(nSizeX,nSizeY) );
- aCellRect.SetTop( aCellRect.Top() - nSizeY );
- aCellRect.SetBottom( aCellRect.Bottom() - nSizeY - 1 );
+ aCellRect.AdjustTop( -nSizeY );
+ aCellRect.AdjustBottom( -(nSizeY - 1) );
// Place the ListBox directly below the black line of the cell grid
// (It looks odd if the line gets hidden...)
@@ -1033,12 +1033,12 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich );
if ( bLayoutRTL )
- aPos.setX( aPos.X() - nSizeX );
+ aPos.AdjustX( -nSizeX );
tools::Rectangle aCellRect( OutputToScreenPixel(aPos), Size(nSizeX,nSizeY) );
- aPos.setX( aPos.X() - 1 );
- aPos.setY( aPos.Y() + nSizeY - 1 );
+ aPos.AdjustX( -1 );
+ aPos.Y() += nSizeY - 1;
mpFilterFloat.reset(VclPtr<ScFilterFloatingWindow>::Create(this, WinBits(WB_BORDER)));
mpFilterFloat->SetPopupModeEndHdl(LINK( this, ScGridWindow, PopupModeEndHdl));
@@ -1299,8 +1299,8 @@ bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, bool bAction )
Point aMousePos = rMEvt.GetPosPixel();
if ( bLayoutRTL )
{
- aStartPos.setX( aStartPos.X() + 2 );
- aEndPos.setX( aEndPos.X() + 2 );
+ aStartPos.AdjustX(2 );
+ aEndPos.AdjustX(2 );
}
bool bTop = ( aMousePos.X() >= aStartPos.X()-3 && aMousePos.X() <= aStartPos.X()+1 &&
aMousePos.Y() >= aStartPos.Y()-3 && aMousePos.Y() <= aStartPos.Y()+1 );
@@ -2852,8 +2852,8 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
Point aLogicPos = pCur->GetPos();
// use the position right of the cursor (spell popup is opened if
// the cursor is before the word, but not if behind it)
- aLogicPos.setX( aLogicPos.X() + pCur->GetWidth() );
- aLogicPos.setY( aLogicPos.Y() + pCur->GetHeight() / 2 ); // center vertically
+ aLogicPos.AdjustX(pCur->GetWidth() );
+ aLogicPos.AdjustY(pCur->GetHeight() / 2 ); // center vertically
aMenuPos = LogicToPixel( aLogicPos );
}
}
@@ -2893,8 +2893,8 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
long nSizeYPix;
pViewData->GetMergeSizePixel( nCurX, nCurY, nSizeXPix, nSizeYPix );
// fdo#55432 take the correct position for RTL sheet
- aMenuPos.setX( aMenuPos.X() + (bLayoutIsRTL ? -nSizeXPix : nSizeXPix) );
- aMenuPos.setY( aMenuPos.Y() + nSizeYPix );
+ aMenuPos.AdjustX(bLayoutIsRTL ? -nSizeXPix : nSizeXPix );
+ aMenuPos.AdjustY(nSizeYPix );
ScTabViewShell* pViewSh = pViewData->GetViewShell();
if (pViewSh)
@@ -4632,8 +4632,8 @@ bool ScGridWindow::HitRangeFinder( const Point& rMouse, RfCorner& rCorner,
long nSizeYPix;
pViewData->GetMergeSizePixel( nPosX, nPosY, nSizeXPix, nSizeYPix );
- aCellEnd.setX( aCellEnd.X() + nSizeXPix * nLayoutSign );
- aCellEnd.setY( aCellEnd.Y() + nSizeYPix );
+ aCellEnd.AdjustX(nSizeXPix * nLayoutSign );
+ aCellEnd.AdjustY(nSizeYPix );
bool bCornerHorizontalRight;
bool bCornerHorizontalLeft;
@@ -5272,12 +5272,12 @@ bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScenRang
{
aButtonPos = pViewData->GetScrPos( aRange.aEnd.Col()+1, aRange.aStart.Row(),
eWhich, true );
- aButtonPos.setY( aButtonPos.Y() - nBHeight );
+ aButtonPos.AdjustY( -nBHeight );
}
if ( bLayoutRTL )
- aButtonPos.setX( aButtonPos.X() - nHSpace - 1 );
+ aButtonPos.AdjustX( -(nHSpace - 1) );
else
- aButtonPos.setX( aButtonPos.X() - nBWidth - nHSpace ); // same for top or bottom
+ aButtonPos.AdjustX( -(nBWidth - nHSpace) ); // same for top or bottom
tools::Rectangle aButRect( aButtonPos, Size(nBWidth,nBHeight) );
if ( aButRect.IsInside( rPosPixel ) )
@@ -5740,8 +5740,8 @@ static void updateLibreOfficeKitSelection(const ScViewData* pViewData, const std
// We explicitly create a copy, since we need to expand
// the rectangle before coordinate conversion
tools::Rectangle aRectangle(rRectangle);
- aRectangle.SetRight( aRectangle.Right() + 1 );
- aRectangle.SetBottom( aRectangle.Bottom() + 1 );
+ aRectangle.AdjustRight(1 );
+ aRectangle.AdjustBottom(1 );
aBoundingBox.Union(aRectangle);
@@ -5858,7 +5858,7 @@ void ScGridWindow::UpdateCursorOverlay()
pViewData->GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
if (bLayoutRTL)
- aScrPos.setX( aScrPos.X() - nSizeXPix - 2 ); // move instead of mirroring
+ aScrPos.AdjustX( -(nSizeXPix - 2) ); // move instead of mirroring
// show the cursor as 4 (thin) rectangles
tools::Rectangle aRect(aScrPos, Size(nSizeXPix - 1, nSizeYPix - 1));
@@ -5868,24 +5868,24 @@ void ScGridWindow::UpdateCursorOverlay()
long aCursorWidth = 1 * fScaleFactor;
tools::Rectangle aLeft = aRect;
- aLeft.SetTop( aLeft.Top() - aCursorWidth );
- aLeft.SetBottom( aLeft.Bottom() + aCursorWidth );
+ aLeft.AdjustTop( -aCursorWidth );
+ aLeft.AdjustBottom(aCursorWidth );
aLeft.SetRight( aLeft.Left() );
- aLeft.SetLeft( aLeft.Left() - aCursorWidth );
+ aLeft.AdjustLeft( -aCursorWidth );
tools::Rectangle aRight = aRect;
- aRight.SetTop( aRight.Top() - aCursorWidth );
- aRight.SetBottom( aRight.Bottom() + aCursorWidth );
+ aRight.AdjustTop( -aCursorWidth );
+ aRight.AdjustBottom(aCursorWidth );
aRight.SetLeft( aRight.Right() );
- aRight.SetRight( aRight.Right() + aCursorWidth );
+ aRight.AdjustRight(aCursorWidth );
tools::Rectangle aTop = aRect;
aTop.SetBottom( aTop.Top() );
- aTop.SetTop( aTop.Top() - aCursorWidth );
+ aTop.AdjustTop( -aCursorWidth );
tools::Rectangle aBottom = aRect;
aBottom.SetTop( aBottom.Bottom() );
- aBottom.SetBottom( aBottom.Bottom() + aCursorWidth );
+ aBottom.AdjustBottom(aCursorWidth );
aPixelRects.push_back(aLeft);
aPixelRects.push_back(aRight);
@@ -6062,12 +6062,12 @@ void ScGridWindow::UpdateAutoFillOverlay()
pViewData->GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
if (bLayoutRTL)
- aFillPos.setX( aFillPos.X() - nSizeXPix - 2 + (aFillHandleSize.Width() / 2) );
+ aFillPos.AdjustX( -(nSizeXPix - 2 + (aFillHandleSize.Width() / 2)) );
else
- aFillPos.setX( aFillPos.X() + nSizeXPix - (aFillHandleSize.Width() / 2) );
+ aFillPos.AdjustX(nSizeXPix - (aFillHandleSize.Width() / 2) );
- aFillPos.setY( aFillPos.Y() + nSizeYPix );
- aFillPos.setY( aFillPos.Y() - (aFillHandleSize.Height() / 2) );
+ aFillPos.AdjustY(nSizeYPix );
+ aFillPos.AdjustY( -(aFillHandleSize.Height() / 2) );
tools::Rectangle aFillRect(aFillPos, aFillHandleSize);
@@ -6160,7 +6160,7 @@ void ScGridWindow::UpdateDragRectOverlay()
nSizeXPix += ScViewData::ToPixel( pDoc->GetColWidth( static_cast<SCCOL>(i), nTab ), nPPTX );
else
{
- aScrPos.setX( aScrPos.X() - nLayoutSign );
+ aScrPos.AdjustX( -nLayoutSign );
nSizeXPix += 2;
}
@@ -6169,12 +6169,12 @@ void ScGridWindow::UpdateDragRectOverlay()
nSizeYPix += ScViewData::ToPixel( pDoc->GetRowHeight( i, nTab ), nPPTY );
else
{
- aScrPos.setY( aScrPos.Y() - 1 );
+ aScrPos.AdjustY( -1 );
nSizeYPix += 2;
}
- aScrPos.setX( aScrPos.X() - 2 * nLayoutSign );
- aScrPos.setY( aScrPos.Y() - 2 );
+ aScrPos.AdjustX( -(2 * nLayoutSign) );
+ aScrPos.AdjustY( -2 );
tools::Rectangle aRect( aScrPos.X(), aScrPos.Y(),
aScrPos.X() + ( nSizeXPix + 2 ) * nLayoutSign, aScrPos.Y() + nSizeYPix + 2 );
if ( bLayoutRTL )
@@ -6312,8 +6312,8 @@ void ScGridWindow::UpdateShrinkOverlay()
aRange.aStart.Row(), eWhich );
Point aEnd = pViewData->GetScrPos( aRange.aEnd.Col()+1,
aRange.aEnd.Row()+1, eWhich );
- aEnd.setX( aEnd.X() - 1 );
- aEnd.setY( aEnd.Y() - 1 );
+ aEnd.AdjustX( -1 );
+ aEnd.AdjustY( -1 );
aPixRect = tools::Rectangle( aStart,aEnd );
}
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 33383e6be68e..3792fcaeb5fc 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -99,10 +99,10 @@ static void lcl_DrawOneFrame( vcl::RenderContext* pDev, const tools::Rectangle&
tools::Rectangle aOuter = aInner;
long nHor = static_cast<long>( SC_SCENARIO_HSPACE * nPPTX );
long nVer = static_cast<long>( SC_SCENARIO_VSPACE * nPPTY );
- aOuter.SetLeft( aOuter.Left() - nHor );
- aOuter.SetRight( aOuter.Right() + nHor );
- aOuter.SetTop( aOuter.Top() - nVer );
- aOuter.SetBottom( aOuter.Bottom() + nVer );
+ aOuter.AdjustLeft( -nHor );
+ aOuter.AdjustRight(nHor );
+ aOuter.AdjustTop( -nVer );
+ aOuter.AdjustBottom(nVer );
// use ScPatternAttr::GetFont only for font size
vcl::Font aAttrFont;
@@ -119,9 +119,9 @@ static void lcl_DrawOneFrame( vcl::RenderContext* pDev, const tools::Rectangle&
Size aTextSize( pDev->GetTextWidth( rTitle ), pDev->GetTextHeight() );
if ( bTextBelow )
- aOuter.SetBottom( aOuter.Bottom() + aTextSize.Height() );
+ aOuter.AdjustBottom(aTextSize.Height() );
else
- aOuter.SetTop( aOuter.Top() - aTextSize.Height() );
+ aOuter.AdjustTop( -(aTextSize.Height()) );
pDev->SetLineColor();
pDev->SetFillColor( rColor );
@@ -220,10 +220,10 @@ static void lcl_DrawScenarioFrames( OutputDevice* pDev, ScViewData* pViewData, S
Point aEndPos = pViewData->GetScrPos(
aRange.aEnd.Col()+1, aRange.aEnd.Row()+1, eWhich, true );
// on the grid:
- aStartPos.setX( aStartPos.X() - nLayoutSign );
- aStartPos.setY( aStartPos.Y() - 1 );
- aEndPos.setX( aEndPos.X() - nLayoutSign );
- aEndPos.setY( aEndPos.Y() - 1 );
+ aStartPos.AdjustX( -nLayoutSign );
+ aStartPos.AdjustY( -1 );
+ aEndPos.AdjustX( -nLayoutSign );
+ aEndPos.AdjustY( -1 );
bool bTextBelow = ( aRange.aStart.Row() == 0 );
@@ -928,8 +928,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
// don't overwrite grid
long nLayoutSign = bLayoutRTL ? -1 : 1;
- aEnd.setX( aEnd.X() - 2 * nLayoutSign );
- aEnd.setY( aEnd.Y() - 2 );
+ aEnd.AdjustX( -(2 * nLayoutSign) );
+ aEnd.AdjustY( -2 );
tools::Rectangle aBackground(aStart, aEnd);
@@ -982,8 +982,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
// don't overwrite grid
long nLayoutSign = bLayoutRTL ? -1 : 1;
- aEnd.setX( aEnd.X() - 2 * nLayoutSign );
- aEnd.setY( aEnd.Y() - 2 );
+ aEnd.AdjustX( -(2 * nLayoutSign) );
+ aEnd.AdjustY( -2 );
// toggle the cursor off if its on to ensure the cursor invert
// background logic remains valid after the background is cleared on
@@ -1385,8 +1385,8 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
aRange.aStart.Col(), aRange.aStart.Row(), eWhich, true );
Point aEnd = pViewData->GetScrPos(
aRange.aEnd.Col() + 1, aRange.aEnd.Row() + 1, eWhich, true );
- aStart.setX( aStart.X() - 2 );
- aStart.setY( aStart.Y() - 2 );
+ aStart.AdjustX( -2 );
+ aStart.AdjustY( -2 );
// Prevent overflows:
if ( aStart.X() < -10 ) aStart.setX( -10 );
@@ -1714,14 +1714,14 @@ tools::Rectangle ScGridWindow::GetListValButtonRect( const ScAddress& rButtonPos
aBtnSize.setHeight( nCellSizeY );
Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich, true );
- aPos.setX( aPos.X() + nCellSizeX * nLayoutSign ); // start of next cell
+ aPos.AdjustX(nCellSizeX * nLayoutSign ); // start of next cell
if (!bNextCell)
- aPos.setX( aPos.X() - aBtnSize.Width() * nLayoutSign ); // right edge of cell if next cell not available
- aPos.setY( aPos.Y() + nCellSizeY - aBtnSize.Height() );
+ aPos.AdjustX( -(aBtnSize.Width() * nLayoutSign) ); // right edge of cell if next cell not available
+ aPos.AdjustY(nCellSizeY - aBtnSize.Height() );
// X remains at the left edge
if ( bLayoutRTL )
- aPos.setX( aPos.X() - aBtnSize.Width()-1 ); // align right edge of button with cell border
+ aPos.AdjustX( -(aBtnSize.Width()-1) ); // align right edge of button with cell border
return tools::Rectangle( aPos, aBtnSize );
}
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 9ad2595aba08..0abc3f82e1fe 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -200,9 +200,9 @@ bool ScGridWindow::ShowNoteMarker( SCCOL nPosX, SCROW nPosY, bool bKeyboard )
Size aLeftSize = pLeft->PixelToLogic( pLeft->GetOutputSizePixel(), aMapMode );
Point aOrigin = aMapMode.GetOrigin();
if( (this == pRight) || (this == pDiagonal) )
- aOrigin.setX( aOrigin.X() + aLeftSize.Width() );
+ aOrigin.AdjustX(aLeftSize.Width() );
if( (this == pBottom) || (this == pDiagonal) )
- aOrigin.setY( aOrigin.Y() + aLeftSize.Height() );
+ aOrigin.AdjustY(aLeftSize.Height() );
aMapMode.SetOrigin( aOrigin );
mpNoteMarker.reset(new ScNoteMarker(pLeft, pRight, pBottom, pDiagonal,
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index bdb7594ee712..a73b7d84d174 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -82,8 +82,8 @@ ScHeaderControl::ScHeaderControl( vcl::Window* pParent, SelectionEngine* pSelect
Size aSize = LogicToPixel( Size(
GetTextWidth("8888"),
GetTextHeight() ) );
- aSize.setWidth( aSize.Width() + 4 ); // place for highlight border
- aSize.setHeight( aSize.Height() + 3 );
+ aSize.AdjustWidth(4 ); // place for highlight border
+ aSize.AdjustHeight(3 );
SetSizePixel( aSize );
nWidth = nSmallWidth = aSize.Width();
@@ -539,15 +539,15 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
Point aTxtPos(aScrPos);
if (bVertical)
{
- aTxtPos.setX( aTxtPos.X() + (nBarSize-aTextSize.Width())/2 );
- aTxtPos.setY( aTxtPos.Y() + (nSizePix*nLayoutSign-aTextSize.Height())/2 );
+ aTxtPos.AdjustX((nBarSize-aTextSize.Width())/2 );
+ aTxtPos.AdjustY((nSizePix*nLayoutSign-aTextSize.Height())/2 );
if ( bMirrored )
- aTxtPos.setX( aTxtPos.X() + 1 ); // dark border is left instead of right
+ aTxtPos.AdjustX(1 ); // dark border is left instead of right
}
else
{
- aTxtPos.setX( aTxtPos.X() + (nSizePix*nLayoutSign-aTextSize.Width()+1)/2 );
- aTxtPos.setY( aTxtPos.Y() + (nBarSize-aTextSize.Height())/2 );
+ aTxtPos.AdjustX((nSizePix*nLayoutSign-aTextSize.Width()+1)/2 );
+ aTxtPos.AdjustY((nBarSize-aTextSize.Height())/2 );
}
DrawText( aTxtPos, aString );
}
@@ -711,13 +711,13 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
tools::Rectangle aVis( aPoint,GetOutputSizePixel() );
if (bVertical)
{
- aVis.Left() = LONG_MIN;
- aVis.Right() = LONG_MAX;
+ aVis.SetLeft( LONG_MIN );
+ aVis.SetRight( LONG_MAX );
}
else
{
- aVis.Top() = LONG_MIN;
- aVis.Bottom() = LONG_MAX;
+ aVis.SetTop( LONG_MIN );
+ aVis.SetBottom( LONG_MAX );
}
pSelEngine->SetVisibleArea( aVis );
diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index 63fbcb98c1e3..ef58c74cca98 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -128,7 +128,7 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlaySequ
const drawinglayer::primitive2d::Primitive2DReference aMessage(pMessage);
aSeq.push_back(aMessage);
- aLineStart.setY( aLineStart.Y() + nLineHeight );
+ aLineStart.AdjustY(nLineHeight );
}
rRange.expand(basegfx::B2DTuple(rRange.getMaxX() + aHintMargin.Width(),
diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx
index 8b41d42b4f06..d8b3021168eb 100644
--- a/sc/source/ui/view/notemark.cxx
+++ b/sc/source/ui/view/notemark.cxx
@@ -54,9 +54,9 @@ ScNoteMarker::ScNoteMarker( vcl::Window* pWin, vcl::Window* pRight, vcl::Window*
{
Size aSizePixel = pWindow->GetOutputSizePixel();
if( pRightWin )
- aSizePixel.setWidth( aSizePixel.Width() + pRightWin->GetOutputSizePixel().Width() );
+ aSizePixel.AdjustWidth(pRightWin->GetOutputSizePixel().Width() );
if( pBottomWin )
- aSizePixel.setHeight( aSizePixel.Height() + pBottomWin->GetOutputSizePixel().Height() );
+ aSizePixel.AdjustHeight(pBottomWin->GetOutputSizePixel().Height() );
tools::Rectangle aVisPixel( Point( 0, 0 ), aSizePixel );
aVisRect = pWindow->PixelToLogic( aVisPixel, aMapMode );
@@ -144,8 +144,8 @@ static MapMode lcl_MoveMapMode( const MapMode& rMap, const Size& rMove )
{
MapMode aNew = rMap;
Point aOrigin = aNew.GetOrigin();
- aOrigin.setX( aOrigin.X() - rMove.Width() );
- aOrigin.setY( aOrigin.Y() - rMove.Height() );
+ aOrigin.AdjustX( -(rMove.Width()) );
+ aOrigin.Y() -= rMove.Height();
aNew.SetOrigin(aOrigin);
return aNew;
}
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 5bb9df7a5eb2..16db6a191dc1 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -831,10 +831,10 @@ void drawDataBars(vcl::RenderContext& rRenderContext, const ScDataBarInfo* pOldD
{
long nPosZero = 0;
tools::Rectangle aPaintRect = rRect;
- aPaintRect.SetTop( aPaintRect.Top() + 2 * nOneY );
- aPaintRect.SetBottom( aPaintRect.Bottom() - 2 * nOneY );
- aPaintRect.SetLeft( aPaintRect.Left() + 2 * nOneX );
- aPaintRect.SetRight( aPaintRect.Right() - 2 * nOneX );
+ aPaintRect.AdjustTop(2 * nOneY );
+ aPaintRect.AdjustBottom( -(2 * nOneY) );
+ aPaintRect.Left() += 2 * nOneX;
+ aPaintRect.AdjustRight( -(2 * nOneX) );
if(pOldDataBarInfo->mnZero)
{
// need to calculate null point in cell
@@ -1267,16 +1267,16 @@ void ScOutputData::DrawExtraShadow(bool bLeft, bool bTop, bool bRight, bool bBot
if (ePart == SC_SHADOW_HSTART)
{
if (eLoc == SvxShadowLocation::TopLeft || eLoc == SvxShadowLocation::BottomLeft)
- aRect.SetRight( aRect.Right() - nSizeX );
+ aRect.AdjustRight( -nSizeX );
else
- aRect.SetLeft( aRect.Left() + nSizeX );
+ aRect.AdjustLeft(nSizeX );
}
if (ePart == SC_SHADOW_VSTART)
{
if (eLoc == SvxShadowLocation::TopLeft || eLoc == SvxShadowLocation::TopRight)
- aRect.SetBottom( aRect.Bottom() - nSizeY );
+ aRect.AdjustBottom( -nSizeY );
else
- aRect.SetTop( aRect.Top() + nSizeY );
+ aRect.AdjustTop(nSizeY );
}
//! merge rectangles?
@@ -2405,11 +2405,11 @@ void ScOutputData::DrawClipMarks()
Point( nStartPosX+nOutWidth-1, nPosY+nOutHeight-1 ) );
}
- aCellRect.SetBottom( aCellRect.Bottom() - 1 ); // don't paint over the cell grid
+ aCellRect.AdjustBottom( -1 ); // don't paint over the cell grid
if ( bLayoutRTL )
- aCellRect.SetLeft( aCellRect.Left() + 1 );
+ aCellRect.AdjustLeft(1 );
else
- aCellRect.SetRight( aCellRect.Right() - 1 );
+ aCellRect.AdjustRight( -1 );
long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
Size aMarkSize( nMarkPixel, (nMarkPixel-1)*2 );
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 8767a91e6559..5404f0c644c0 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1286,7 +1286,7 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
++nRightX;
long nAdd = static_cast<long>( mpDoc->GetColWidth( nRightX, nTab ) * mnPPTX );
nRightMissing -= nAdd;
- rParam.maClipRect.SetRight( rParam.maClipRect.Right() + nAdd * nLayoutSign );
+ rParam.maClipRect.AdjustRight(nAdd * nLayoutSign );
if ( rThisRowInfo.nRowNo == nCellY && nRightX >= nX1 && nRightX <= nX2 )
rThisRowInfo.pCellInfo[nRightX].bHideGrid = true;
@@ -1300,7 +1300,7 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
--nLeftX;
long nAdd = static_cast<long>( mpDoc->GetColWidth( nLeftX, nTab ) * mnPPTX );
nLeftMissing -= nAdd;
- rParam.maClipRect.SetLeft( rParam.maClipRect.Left() - nAdd * nLayoutSign );
+ rParam.maClipRect.AdjustLeft( -(nAdd * nLayoutSign) );
}
}
@@ -1311,14 +1311,14 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
rThisRowInfo.pCellInfo[nRightX+1].nClipMark |= ScClipMark::Right;
bAnyClipped = true;
long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
- rParam.maClipRect.SetRight( rParam.maClipRect.Right() - nMarkPixel * nLayoutSign );
+ rParam.maClipRect.AdjustRight( -(nMarkPixel * nLayoutSign) );
}
if ( nLeftMissing > 0 && bMarkClipped && nLeftX >= nX1 && nLeftX <= nX2 && !bBreak && !bCellIsValue )
{
rThisRowInfo.pCellInfo[nLeftX+1].nClipMark |= ScClipMark::Left;
bAnyClipped = true;
long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
- rParam.maClipRect.SetLeft( rParam.maClipRect.Left() + nMarkPixel * nLayoutSign );
+ rParam.maClipRect.AdjustLeft(nMarkPixel * nLayoutSign );
}
rParam.mbLeftClip = ( nLeftMissing > 0 );
@@ -1345,8 +1345,8 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
// content fits even in the remaining area without the filter button
// -> align within that remaining area
- rParam.maAlignRect.SetRight( rParam.maAlignRect.Right() - nFilter * nLayoutSign );
- rParam.maClipRect.SetRight( rParam.maClipRect.Right() - nFilter * nLayoutSign );
+ rParam.maAlignRect.AdjustRight( -(nFilter * nLayoutSign) );
+ rParam.maClipRect.AdjustRight( -(nFilter * nLayoutSign) );
// if a number doesn't fit, don't hide part of the number behind the button
// -> set clip flags, so "###" replacement is used (but also within the smaller area)
@@ -1983,13 +1983,13 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
{
// undo text width adjustment in pixels
if (bRightAdjusted)
- aDrawTextPos.setX( aDrawTextPos.X() + aVars.GetTextSize().Width() );
+ aDrawTextPos.AdjustX(aVars.GetTextSize().Width() );
aDrawTextPos = mpRefDevice->PixelToLogic( aDrawTextPos );
// redo text width adjustment in logic units
if (bRightAdjusted)
- aDrawTextPos.setX( aDrawTextPos.X() - aVars.GetOriginalWidth() );
+ aDrawTextPos.AdjustX( -(aVars.GetOriginalWidth()) );
}
// in Metafiles always use DrawTextArray to ensure that positions are
@@ -2483,7 +2483,7 @@ void ScOutputData::DrawEditParam::calcPaperSize(
// Subtract some extra value from the height or else the text would go
// outside the cell area. The value of 5 is arbitrary, and is based
// entirely on heuristics.
- rPaperSize.setHeight( rPaperSize.Height() - 5 );
+ rPaperSize.AdjustHeight( -5 );
}
}
@@ -2539,17 +2539,17 @@ void ScOutputData::DrawEditParam::calcStartPosForVertical(
{
// vertical adjustment is within the EditEngine
if (mbPixelToLogic)
- rLogicStart.setY( rLogicStart.Y() + pRefDevice->PixelToLogic(Size(0,nTopM)).Height() );
+ rLogicStart.AdjustY(pRefDevice->PixelToLogic(Size(0,nTopM)).Height() );
else
- rLogicStart.setY( rLogicStart.Y() + nTopM );
+ rLogicStart.AdjustY(nTopM );
switch (meHorJustResult)
{
case SvxCellHorJustify::Center:
- rLogicStart.setX( rLogicStart.X() + (nCellWidth - nEngineWidth) / 2 );
+ rLogicStart.AdjustX((nCellWidth - nEngineWidth) / 2 );
break;
case SvxCellHorJustify::Right:
- rLogicStart.setX( rLogicStart.X() + nCellWidth - nEngineWidth );
+ rLogicStart.AdjustX(nCellWidth - nEngineWidth );
break;
default:
; // do nothing
@@ -2701,7 +2701,7 @@ void ScOutputData::DrawEditParam::adjustForHyperlinkInPDF(Point aURLStart, const
if (isVerticallyOriented())
std::swap( nURLWidth, nURLHeight );
else if (mbAsianVertical)
- aURLStart.setX( aURLStart.X() - nURLWidth );
+ aURLStart.AdjustX( -nURLWidth );
tools::Rectangle aURLRect( aURLStart, Size( nURLWidth, nURLHeight ) );
lcl_DoHyperlinkResult(pDev, aURLRect, maCell);
@@ -3064,7 +3064,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
if ( aAreaParam.maClipRect.Right() - nMarkPixel > aAreaParam.maClipRect.Left() )
- aAreaParam.maClipRect.SetRight( aAreaParam.maClipRect.Right() - nMarkPixel );
+ aAreaParam.maClipRect.AdjustRight( -nMarkPixel );
}
}
@@ -3095,29 +3095,29 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
//! only converting margin?
if (rParam.mbPixelToLogic)
- aLogicStart.setY( aLogicStart.Y() + mpRefDevice->PixelToLogic( Size(0, nTopM +
+ aLogicStart.AdjustY(mpRefDevice->PixelToLogic( Size(0, nTopM +
mpRefDevice->LogicToPixel(aCellSize).Height() -
mpRefDevice->LogicToPixel(Size(0,nEngineHeight)).Height()
)).Height() );
else
- aLogicStart.setY( aLogicStart.Y() + nTopM + aCellSize.Height() - nEngineHeight );
+ aLogicStart.AdjustY(nTopM + aCellSize.Height() - nEngineHeight );
}
else if (rParam.meVerJust==SvxCellVerJustify::Center)
{
if (rParam.mbPixelToLogic)
- aLogicStart.setY( aLogicStart.Y() + mpRefDevice->PixelToLogic( Size(0, nTopM + (
+ aLogicStart.AdjustY(mpRefDevice->PixelToLogic( Size(0, nTopM + (
mpRefDevice->LogicToPixel(aCellSize).Height() -
mpRefDevice->LogicToPixel(Size(0,nEngineHeight)).Height() )
/ 2)).Height() );
else
- aLogicStart.setY( aLogicStart.Y() + nTopM + (aCellSize.Height() - nEngineHeight) / 2 );
+ aLogicStart.AdjustY(nTopM + (aCellSize.Height() - nEngineHeight) / 2 );
}
else // top
{
if (rParam.mbPixelToLogic)
- aLogicStart.setY( aLogicStart.Y() + mpRefDevice->PixelToLogic(Size(0,nTopM)).Height() );
+ aLogicStart.AdjustY(mpRefDevice->PixelToLogic(Size(0,nTopM)).Height() );
else
- aLogicStart.setY( aLogicStart.Y() + nTopM );
+ aLogicStart.AdjustY(nTopM );
}
aURLStart = aLogicStart; // copy before modifying for orientation
@@ -3169,7 +3169,7 @@ void ScOutputData::ShowClipMarks( DrawEditParam& rParam, long nEngineHeight, con
const long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
if ( aAreaParam.maClipRect.Right() - nMarkPixel > aAreaParam.maClipRect.Left() )
- aAreaParam.maClipRect.SetRight( aAreaParam.maClipRect.Right() - nMarkPixel );
+ aAreaParam.maClipRect.AdjustRight( -nMarkPixel );
}
}
@@ -3392,8 +3392,8 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
Size aPSize = rParam.mpEngine->GetPaperSize();
aPSize.setWidth( aCellSize.Height() );
rParam.mpEngine->SetPaperSize(aPSize);
- aLogicStart.setY( aLogicStart.Y() +
- (rParam.mbBreak ? aPSize.Width() : nEngineHeight) );
+ aLogicStart.AdjustY(
+ rParam.mbBreak ? aPSize.Width() : nEngineHeight );
}
else
{
@@ -3421,8 +3421,8 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
}
// First, align text to bottom.
- aLogicStart.setY( aLogicStart.Y() + aCellSize.Height() );
- aLogicStart.setY( aLogicStart.Y() + nTopOffset );
+ aLogicStart.AdjustY(aCellSize.Height() );
+ aLogicStart.AdjustY(nTopOffset );
switch (rParam.meVerJust)
{
@@ -3432,12 +3432,12 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
break;
case SvxCellVerJustify::Center:
// center it.
- aLogicStart.setY( aLogicStart.Y() - nGap / 2 );
+ aLogicStart.AdjustY( -(nGap / 2) );
break;
case SvxCellVerJustify::Block:
case SvxCellVerJustify::Top:
// align to top
- aLogicStart.setY( aLogicStart.Y() - nGap );
+ aLogicStart.AdjustY( -nGap );
break;
default:
;
@@ -3635,7 +3635,7 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam)
if (rParam.meHorJustResult != SvxCellHorJustify::Block)
{
- aLogicStart.setX( aLogicStart.X() + nEngineWidth );
+ aLogicStart.AdjustX(nEngineWidth );
if (!rParam.mbBreak)
{
// Set the paper width to text size.
@@ -3656,18 +3656,18 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam)
nGap = aPSize.Width() - aCellSize.Height();
nTopOffset = nTopM;
}
- aLogicStart.setY( aLogicStart.Y() + nTopOffset );
+ aLogicStart.AdjustY(nTopOffset );
switch (rParam.meVerJust)
{
case SvxCellVerJustify::Standard:
case SvxCellVerJustify::Bottom:
// align to bottom
- aLogicStart.setY( aLogicStart.Y() - nGap );
+ aLogicStart.AdjustY( -nGap );
break;
case SvxCellVerJustify::Center:
// center it.
- aLogicStart.setY( aLogicStart.Y() - nGap / 2 );
+ aLogicStart.AdjustY( -(nGap / 2) );
break;
case SvxCellVerJustify::Block:
case SvxCellVerJustify::Top:
@@ -3897,7 +3897,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam)
long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
if ( aAreaParam.maClipRect.Right() - nMarkPixel > aAreaParam.maClipRect.Left() )
- aAreaParam.maClipRect.SetRight( aAreaParam.maClipRect.Right() - nMarkPixel );
+ aAreaParam.maClipRect.AdjustRight( -nMarkPixel );
}
}
@@ -3920,29 +3920,29 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam)
//! only converting margin?
if (rParam.mbPixelToLogic)
- aLogicStart.setY( aLogicStart.Y() + mpRefDevice->PixelToLogic( Size(0, nTopM +
+ aLogicStart.AdjustY(mpRefDevice->PixelToLogic( Size(0, nTopM +
mpRefDevice->LogicToPixel(aCellSize).Height() -
mpRefDevice->LogicToPixel(Size(0,nEngineHeight)).Height()
)).Height() );
else
- aLogicStart.setY( aLogicStart.Y() + nTopM + aCellSize.Height() - nEngineHeight );
+ aLogicStart.AdjustY(nTopM + aCellSize.Height() - nEngineHeight );
}
else if (rParam.meVerJust==SvxCellVerJustify::Center)
{
if (rParam.mbPixelToLogic)
- aLogicStart.setY( aLogicStart.Y() + mpRefDevice->PixelToLogic( Size(0, nTopM + (
+ aLogicStart.AdjustY(mpRefDevice->PixelToLogic( Size(0, nTopM + (
mpRefDevice->LogicToPixel(aCellSize).Height() -
mpRefDevice->LogicToPixel(Size(0,nEngineHeight)).Height() )
/ 2)).Height() );
else
- aLogicStart.setY( aLogicStart.Y() + nTopM + (aCellSize.Height() - nEngineHeight) / 2 );
+ aLogicStart.AdjustY(nTopM + (aCellSize.Height() - nEngineHeight) / 2 );
}
else // top
{
if (rParam.mbPixelToLogic)
- aLogicStart.setY( aLogicStart.Y() + mpRefDevice->PixelToLogic(Size(0,nTopM)).Height() );
+ aLogicStart.AdjustY(mpRefDevice->PixelToLogic(Size(0,nTopM)).Height() );
else
- aLogicStart.setY( aLogicStart.Y() + nTopM );
+ aLogicStart.AdjustY(nTopM );
}
aURLStart = aLogicStart; // copy before modifying for orientation
@@ -4184,7 +4184,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
if ( aAreaParam.maClipRect.Right() - nMarkPixel > aAreaParam.maClipRect.Left() )
- aAreaParam.maClipRect.SetRight( aAreaParam.maClipRect.Right() - nMarkPixel );
+ aAreaParam.maClipRect.AdjustRight( -nMarkPixel );
}
}
@@ -4206,18 +4206,18 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
// horizontal alignment
if (rParam.meHorJustResult==SvxCellHorJustify::Right)
- aLogicStart.setX( aLogicStart.X() + nAvailWidth - nEngineWidth );
+ aLogicStart.AdjustX(nAvailWidth - nEngineWidth );
else if (rParam.meHorJustResult==SvxCellHorJustify::Center)
- aLogicStart.setX( aLogicStart.X() + (nAvailWidth - nEngineWidth) / 2 );
+ aLogicStart.AdjustX((nAvailWidth - nEngineWidth) / 2 );
// paper size is subtracted below
- aLogicStart.setX( aLogicStart.X() + nEngineWidth );
+ aLogicStart.AdjustX(nEngineWidth );
// vertical adjustment is within the EditEngine
if (rParam.mbPixelToLogic)
- aLogicStart.setY( aLogicStart.Y() + mpRefDevice->PixelToLogic(Size(0,nTopM)).Height() );
+ aLogicStart.AdjustY(mpRefDevice->PixelToLogic(Size(0,nTopM)).Height() );
else
- aLogicStart.setY( aLogicStart.Y() + nTopM );
+ aLogicStart.AdjustY(nTopM );
aURLStart = aLogicStart; // copy before modifying for orientation
@@ -4226,7 +4226,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
// with SetVertical, the start position is top left of
// the whole output area, not the text itself
- aLogicStart.setX( aLogicStart.X() - rParam.mpEngine->GetPaperSize().Width() );
+ aLogicStart.AdjustX( -(rParam.mpEngine->GetPaperSize().Width()) );
rParam.mpEngine->Draw(mpDev, aLogicStart);
}
@@ -4859,7 +4859,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
{
long nDif = nScrX - nStartX;
nClipStartX = nScrX;
- aClipSize.setWidth( aClipSize.Width() - nDif );
+ aClipSize.AdjustWidth( -nDif );
}
}
@@ -4870,7 +4870,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
{
long nDif = nRowPosY - nClipStartY;
nClipStartY = nRowPosY;
- aClipSize.setHeight( aClipSize.Height() - nDif );
+ aClipSize.AdjustHeight( -nDif );
}
}
@@ -4945,20 +4945,20 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
{
// rotated text is centered by default
if (eHorJust==SvxCellHorJustify::Right)
- aLogicStart.setX( aLogicStart.X() + nAvailWidth - nEngineWidth );
+ aLogicStart.AdjustX(nAvailWidth - nEngineWidth );
else if (eHorJust==SvxCellHorJustify::Center ||
eHorJust==SvxCellHorJustify::Standard)
- aLogicStart.setX( aLogicStart.X() + (nAvailWidth - nEngineWidth) / 2 );
+ aLogicStart.AdjustX((nAvailWidth - nEngineWidth) / 2 );
}
}
if ( bLayoutRTL )
{
if (bPixelToLogic)
- aLogicStart.setX( aLogicStart.X() - mpRefDevice->PixelToLogic(
- Size( nCellWidth, 0 ) ).Width() );
+ aLogicStart.AdjustX( -(mpRefDevice->PixelToLogic(
+ Size( nCellWidth, 0 ) ).Width()) );
else
- aLogicStart.setX( aLogicStart.X() - nCellWidth );
+ aLogicStart.AdjustX( -nCellWidth );
}
if ( eOrient==SvxCellOrientation::Standard ||
@@ -4968,23 +4968,23 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
eVerJust==SvxCellVerJustify::Standard)
{
if (bPixelToLogic)
- aLogicStart.setY( aLogicStart.Y() + mpRefDevice->PixelToLogic( Size(0,
+ aLogicStart.AdjustY(mpRefDevice->PixelToLogic( Size(0,
mpRefDevice->LogicToPixel(aCellSize).Height() -
mpRefDevice->LogicToPixel(Size(0,nEngineHeight)).Height()
)).Height() );
else
- aLogicStart.setY( aLogicStart.Y() + aCellSize.Height() - nEngineHeight );
+ aLogicStart.AdjustY(aCellSize.Height() - nEngineHeight );
}
else if (eVerJust==SvxCellVerJustify::Center)
{
if (bPixelToLogic)
- aLogicStart.setY( aLogicStart.Y() + mpRefDevice->PixelToLogic( Size(0,(
+ aLogicStart.AdjustY(mpRefDevice->PixelToLogic( Size(0,(
mpRefDevice->LogicToPixel(aCellSize).Height() -
mpRefDevice->LogicToPixel(Size(0,nEngineHeight)).Height())
/ 2)).Height() );
else
- aLogicStart.setY( aLogicStart.Y() + (aCellSize.Height() - nEngineHeight) / 2 );
+ aLogicStart.AdjustY((aCellSize.Height() - nEngineHeight) / 2 );
}
}
@@ -5042,8 +5042,8 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
nAddX += ( nUp * nCos / fabs(nSin) );
}
- aLogicStart.setX( aLogicStart.X() + static_cast<long>(nAddX) );
- aLogicStart.setY( aLogicStart.Y() + static_cast<long>(nAddY) );
+ aLogicStart.AdjustX(static_cast<long>(nAddX) );
+ aLogicStart.AdjustY(static_cast<long>(nAddY) );
}
// bSimClip is not used here (because nOriVal is set)
diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index 0cb1c9bdd5e9..d86fcb3fcc36 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -44,20 +44,18 @@ Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY )
long nLayoutSign(bLayoutRTL ? -1 : 1);
for (nCol=0; nCol<nX1; nCol++)
- aOffset.setX( aOffset.X() - mpDoc->GetColWidth( nCol, nTab ) * nLayoutSign );
- aOffset.setY( aOffset.Y() - mpDoc->GetRowHeight( 0, nY1-1, nTab ) );
+ aOffset.AdjustX( -(mpDoc->GetColWidth( nCol, nTab ) * nLayoutSign) );
+ aOffset.Y() -= mpDoc->GetRowHeight( 0, nY1-1, nTab );
long nDataWidth = 0;
for (nCol=nX1; nCol<=nX2; nCol++)
nDataWidth += mpDoc->GetColWidth( nCol, nTab );
if ( bLayoutRTL )
- aOffset.setX( aOffset.X() + nDataWidth );
+ aOffset.AdjustX(nDataWidth );
- aRect.SetLeft( -aOffset.X() );
- aRect.SetRight( -aOffset.X() );
- aRect.SetTop( -aOffset.Y() );
- aRect.SetBottom( -aOffset.Y() );
+ aRect.Left() = aRect.Right() = -aOffset.X();
+ aRect.Top() = aRect.Bottom() = -aOffset.Y();
Point aMMOffset( aOffset );
aMMOffset.setX( static_cast<long>(aMMOffset.X() * HMM_PER_TWIPS) );
@@ -67,8 +65,8 @@ Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY )
aMMOffset += Point( nLogStX, nLogStY );
for (nCol=nX1; nCol<=nX2; nCol++)
- aRect.SetRight( aRect.Right() + mpDoc->GetColWidth( nCol, nTab ) );
- aRect.SetBottom( aRect.Bottom() + mpDoc->GetRowHeight( nY1, nY2, nTab ) );
+ aRect.AdjustRight(mpDoc->GetColWidth( nCol, nTab ) );
+ aRect.AdjustBottom(mpDoc->GetRowHeight( nY1, nY2, nTab ) );
aRect.SetLeft( static_cast<long>(aRect.Left() * HMM_PER_TWIPS) );
aRect.SetTop( static_cast<long>(aRect.Top() * HMM_PER_TWIPS) );
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 6833b9ffb210..f8dc39195800 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -596,8 +596,8 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
SetFillColor();
tools::Rectangle aPixel( LogicToPixel( tools::Rectangle( -aOffset.X(), -aOffset.Y(), nPageEndX, nPageEndY ) ) );
- --aPixel.Right();
- --aPixel.Bottom();
+ aPixel.AdjustRight( -1 );
+ aPixel.AdjustBottom( -1 );
DrawRect( PixelToLogic( aPixel ) );
}
@@ -609,15 +609,15 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
tools::Rectangle aPixel;
aPixel = LogicToPixel( tools::Rectangle( nPageEndX, -aOffset.Y(), nPageEndX, nPageEndY ) );
- aPixel.Top() += SC_PREVIEW_SHADOWSIZE;
- aPixel.SetRight( aPixel.Right() + SC_PREVIEW_SHADOWSIZE - 1 );
- aPixel.SetBottom( aPixel.Bottom() + SC_PREVIEW_SHADOWSIZE - 1 );
+ aPixel.AdjustTop(SC_PREVIEW_SHADOWSIZE );
+ aPixel.AdjustRight(SC_PREVIEW_SHADOWSIZE - 1 );
+ aPixel.AdjustBottom(SC_PREVIEW_SHADOWSIZE - 1 );
DrawRect( PixelToLogic( aPixel ) );
aPixel = LogicToPixel( tools::Rectangle( -aOffset.X(), nPageEndY, nPageEndX, nPageEndY ) );
- aPixel.Left() += SC_PREVIEW_SHADOWSIZE;
- aPixel.SetRight( aPixel.Right() + SC_PREVIEW_SHADOWSIZE - 1 );
- aPixel.SetBottom( aPixel.Bottom() + SC_PREVIEW_SHADOWSIZE - 1 );
+ aPixel.AdjustLeft(SC_PREVIEW_SHADOWSIZE );
+ aPixel.AdjustRight(SC_PREVIEW_SHADOWSIZE - 1 );
+ aPixel.AdjustBottom(SC_PREVIEW_SHADOWSIZE - 1 );
DrawRect( PixelToLogic( aPixel ) );
}
}
@@ -815,8 +815,8 @@ sal_uInt16 ScPreview::GetOptimalZoom(bool bWidthOnly)
// but some additional margin is introduced by integer scale values
// -> add only 0.10cm, so there is some margin in all cases.
Size aMarginSize( LogicToPixel(Size(100, 100), MapMode(MapUnit::Map100thMM)) );
- aWinSize.setWidth( aWinSize.Width() - 2 * aMarginSize.Width() );
- aWinSize.setHeight( aWinSize.Height() - 2 * aMarginSize.Height() );
+ aWinSize.AdjustWidth( -(2 * aMarginSize.Width()) );
+ aWinSize.Height() -= 2 * aMarginSize.Height();
Size aLocalPageSize = lcl_GetDocPageSize( &pDocShell->GetDocument(), nTab );
if ( aLocalPageSize.Width() && aLocalPageSize.Height() )
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index eedfa3d50821..f650e0c0d992 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -278,13 +278,13 @@ void ScPreviewShell::UpdateNeededScrollBars( bool bFromZoom )
{
if ( bVert )
{
- aWindowPixelSize.setWidth( aWindowPixelSize.Width() + nBarH );
- aWindowSize.setWidth( aWindowSize.Width() + aHeightOffSet );
+ aWindowPixelSize.AdjustWidth(nBarH );
+ aWindowSize.AdjustWidth(aHeightOffSet );
}
if ( bHori )
{
- aWindowPixelSize.setHeight( aWindowPixelSize.Height() + nBarW );
- aWindowSize.setHeight( aWindowSize.Height() + aWidthOffSet );
+ aWindowPixelSize.AdjustHeight(nBarW );
+ aWindowSize.AdjustHeight(aWidthOffSet );
}
}
@@ -308,9 +308,9 @@ void ScPreviewShell::UpdateNeededScrollBars( bool bFromZoom )
// make room for needed scrollbars ( and reduce the size
// of the preview appropriately )
if ( bHori )
- aWindowPixelSize.setHeight( aWindowPixelSize.Height() - nBarW );
+ aWindowPixelSize.AdjustHeight( -nBarW );
if ( bVert )
- aWindowPixelSize.setWidth( aWindowPixelSize.Width() - nBarH );
+ aWindowPixelSize.AdjustWidth( -nBarH );
pPreview->SetSizePixel( aWindowPixelSize );
pHorScroll->SetPosSizePixel( Point( aPos.X(), aPos.Y() + aWindowPixelSize.Height() ),
@@ -997,7 +997,7 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode )
}
}
else
- aCurPos.setY( aCurPos.Y() - nVLine );
+ aCurPos.AdjustY( -nVLine );
break;
case SID_CURSORDOWN:
if( nMaxVertPos<0 )
@@ -1020,13 +1020,13 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode )
}
}
else
- aCurPos.setY( aCurPos.Y() + nVLine );
+ aCurPos.AdjustY(nVLine );
break;
case SID_CURSORLEFT:
- aCurPos.setX( aCurPos.X() - nHLine );
+ aCurPos.AdjustX( -nHLine );
break;
case SID_CURSORRIGHT:
- aCurPos.setX( aCurPos.X() + nHLine );
+ aCurPos.AdjustX(nHLine );
break;
case SID_CURSORPAGEUP:
if( nThumbPos==0 || nMaxVertPos<0 )
@@ -1042,7 +1042,7 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode )
}
}
else
- aCurPos.setY( aCurPos.Y() - nVPage );
+ aCurPos.AdjustY( -nVPage );
break;
case SID_CURSORPAGEDOWN:
if( (std::abs(nVPage+nThumbPos-nRangeMax)<10) || nMaxVertPos<0 )
@@ -1065,7 +1065,7 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode )
}
}
else
- aCurPos.setY( aCurPos.Y() + nVPage );
+ aCurPos.AdjustY(nVPage );
break;
case SID_CURSORHOME:
if( nMaxVertPos<0 )
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index d4cd3a898cb2..c51b9ea7c714 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1092,17 +1092,17 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
Size ScPrintFunc::GetDataSize() const
{
Size aSize = aPageSize;
- aSize.setWidth( aSize.Width() - nLeftMargin + nRightMargin );
- aSize.setHeight( aSize.Height() - nTopMargin + nBottomMargin );
- aSize.setHeight( aSize.Height() - aHdr.nHeight + aFtr.nHeight );
+ aSize.AdjustWidth( -(nLeftMargin + nRightMargin) );
+ aSize.Height() -= nTopMargin + nBottomMargin;
+ aSize.AdjustHeight( -(aHdr.nHeight + aFtr.nHeight) );
return aSize;
}
void ScPrintFunc::GetScaleData( Size& rPhysSize, long& rDocHdr, long& rDocFtr )
{
rPhysSize = aPageSize;
- rPhysSize.setWidth( rPhysSize.Width() - nLeftMargin + nRightMargin );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list