diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-16 12:48:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-16 15:14:05 +0100 |
commit | 413c7b426543e71f4865c858b5b4ca62b48573d3 (patch) | |
tree | ce0c71f47ffab017ba13b50263e06e36556fc5e0 /dbaccess/source/ui/querydesign/ConnectionLine.cxx | |
parent | 1d180f48bc61444c610c35083e35745d38c6cce2 (diff) |
Revert "loplugin:changetoolsgen in dbaccess..desktop" 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 a9ca38bdf7ff9d15529b5903e640987fc14c0fa7.
Change-Id: I662ef2f1100a06a68decb2c71975fbc61aeaa47d
Reviewed-on: https://gerrit.libreoffice.org/49847
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source/ui/querydesign/ConnectionLine.cxx')
-rw-r--r-- | dbaccess/source/ui/querydesign/ConnectionLine.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index 8e8569db5e39..158b6c88beea 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -85,16 +85,16 @@ namespace if ( _pEntry ) { const long nRowHeight = pListBox->GetEntryHeight(); - _rNewConPos.setY( _rNewConPos.Y() + pListBox->GetPosPixel().Y() ); + _rNewConPos.AdjustY(pListBox->GetPosPixel().Y() ); long nEntryPos = pListBox->GetEntryPosition( _pEntry ).Y(); if( nEntryPos >= 0 ) { - _rNewConPos.setY( _rNewConPos.Y() + nEntryPos ); - _rNewConPos.Y() += static_cast<long>( 0.5 * nRowHeight ); + _rNewConPos.AdjustY(nEntryPos ); + _rNewConPos.AdjustY(static_cast<long>( 0.5 * nRowHeight ) ); } else - _rNewConPos.setY( _rNewConPos.Y() - static_cast<long>( 0.5 * nRowHeight ) ); + _rNewConPos.AdjustY( -static_cast<long>( 0.5 * nRowHeight ) ); long nListBoxBottom = _pWin->GetPosPixel().Y() + pListBox->GetPosPixel().Y() @@ -103,9 +103,9 @@ namespace _rNewConPos.setY( nListBoxBottom + 2 ); } else - _rNewConPos.setY( _rNewConPos.Y() + static_cast<sal_Int32>(pListBox->GetPosPixel().Y()*0.5) ); + _rNewConPos.AdjustY(static_cast<sal_Int32>(pListBox->GetPosPixel().Y()*0.5) ); - _rNewDescrPos.Y() = _rNewConPos.Y(); + _rNewDescrPos.setY( _rNewConPos.Y() ); } } @@ -182,8 +182,8 @@ tools::Rectangle OConnectionLine::GetBoundingRect() // line proceeds in z-Form if( pSourceWin == pDestWin || std::abs(m_aSourceConnPos.X() - m_aDestConnPos.X()) > std::abs(m_aSourceDescrLinePos.X() - m_aDestDescrLinePos.X()) ) { - aTopLeft.setX( aTopLeft.X() - DESCRIPT_LINE_WIDTH ); - aBottomRight.X() += DESCRIPT_LINE_WIDTH; + aTopLeft.AdjustX( -DESCRIPT_LINE_WIDTH ); + aBottomRight.AdjustX(DESCRIPT_LINE_WIDTH ); } aBoundingRect = tools::Rectangle( aTopLeft-Point(2,17), aBottomRight+Point(2,2) ); @@ -195,14 +195,14 @@ void calcPointX1(const OTableWindow* _pWin,Point& _rNewConPos,Point& _rNewDescrP { _rNewConPos.setX( _pWin->GetPosPixel().X() + _pWin->GetSizePixel().Width() ); _rNewDescrPos.setX( _rNewConPos.X() ); - _rNewConPos.setX( _rNewConPos.X() + DESCRIPT_LINE_WIDTH ); + _rNewConPos.AdjustX(DESCRIPT_LINE_WIDTH ); } void calcPointX2(const OTableWindow* _pWin,Point& _rNewConPos,Point& _rNewDescrPos) { _rNewConPos.setX( _pWin->GetPosPixel().X() ); _rNewDescrPos.setX( _rNewConPos.X() ); - _rNewConPos.setX( _rNewConPos.X() - DESCRIPT_LINE_WIDTH ); + _rNewConPos.AdjustX( -DESCRIPT_LINE_WIDTH ); } bool OConnectionLine::RecalcLine() @@ -337,7 +337,7 @@ Point OConnectionLine::getMidPoint() const { Point aDest = m_aDestConnPos - m_aSourceConnPos; aDest.setX( aDest.X() / 2 ); - aDest.Y() /= 2; + aDest.setY( aDest.Y() / 2 ); return m_aSourceConnPos + aDest; } |