diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-16 08:32:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-16 11:38:45 +0100 |
commit | 261d422d9e0dc4d36ddfa43180e63286cbb89bf4 (patch) | |
tree | 98e486dc80bc5c48dd885ddd5e51934a3f8d6ebe /reportdesign/source | |
parent | 0e687595295e210e6275eda57a253ca66e8249ce (diff) |
Revert "loplugin:changetoolsgen in oox,reportdesign" and reapply..
the 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 457220bc2c0142c5b6f4135cb688ccfc99fec792.
Change-Id: I2c6b1092c8bfa4fa14acbc7445f546d43cb2a86e
Reviewed-on: https://gerrit.libreoffice.org/49833
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign/source')
-rw-r--r-- | reportdesign/source/ui/report/EndMarker.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportWindow.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ScrollHelper.cxx | 8 | ||||
-rw-r--r-- | reportdesign/source/ui/report/SectionWindow.cxx | 10 | ||||
-rw-r--r-- | reportdesign/source/ui/report/StartMarker.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ViewsWindow.cxx | 34 | ||||
-rw-r--r-- | reportdesign/source/ui/report/dlgedfunc.cxx | 4 |
7 files changed, 32 insertions, 32 deletions
diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx index fc1f2703f7f6..0e763fce8c24 100644 --- a/reportdesign/source/ui/report/EndMarker.cxx +++ b/reportdesign/source/ui/report/EndMarker.cxx @@ -48,7 +48,7 @@ void OEndMarker::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangl const long nCornerSpace = long(aCornerSpace); Size aSize = GetSizePixel(); - aSize.setWidth( aSize.Width() + nCornerSpace ); + aSize.AdjustWidth(nCornerSpace ); tools::Rectangle aWholeRect(Point(-nCornerSpace,0),aSize); tools::PolyPolygon aPoly; aPoly.Insert( tools::Polygon(aWholeRect,nCornerSpace,nCornerSpace)); diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 54f5db8c7955..a710f34f62e6 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -192,7 +192,7 @@ void OReportWindow::Resize() m_aHRuler->SetMargin1(0); m_aHRuler->SetMargin2(aPageSize.Width() - nLeftMargin - nRightMargin); - aStartPoint.setY( aStartPoint.Y() + aPageSize.Height() ); + aStartPoint.AdjustY(aPageSize.Height() ); nSectionsHeight -= aStartPoint.Y(); aStartPoint.setX( aOffset.X() ); diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index d43921fdfb42..12251126cea5 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -125,7 +125,7 @@ Size OScrollWindowHelper::ResizeScrollBars() if ( aOutPixSz.Width() == 0 || aOutPixSz.Height() == 0 ) return aOutPixSz; - aOutPixSz.setHeight( aOutPixSz.Height() - m_aReportWindow->getRulerHeight() ); + aOutPixSz.AdjustHeight( -(m_aReportWindow->getRulerHeight()) ); // determine the size of the output-area and if we need scrollbars const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize(); bool bVVisible = false; // by default no vertical-ScrollBar @@ -139,7 +139,7 @@ Size OScrollWindowHelper::ResizeScrollBars() if ( aOutPixSz.Width() < m_aTotalPixelSize.Width() && !bHVisible ) { bHVisible = true; - aOutPixSz.setHeight( aOutPixSz.Height() - nScrSize ); + aOutPixSz.AdjustHeight( -nScrSize ); bChanged = true; } @@ -147,14 +147,14 @@ Size OScrollWindowHelper::ResizeScrollBars() if ( aOutPixSz.Height() < m_aTotalPixelSize.Height() && !bVVisible ) { bVVisible = true; - aOutPixSz.setWidth( aOutPixSz.Width() - nScrSize ); + aOutPixSz.AdjustWidth( -nScrSize ); bChanged = true; } } while ( bChanged ); // until no visibility has changed - aOutPixSz.setHeight( aOutPixSz.Height() + m_aReportWindow->getRulerHeight() ); + aOutPixSz.AdjustHeight(m_aReportWindow->getRulerHeight() ); // show or hide scrollbars m_aVScroll->Show( bVVisible ); diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index c80d20a364aa..0e98b03e0ae3 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -231,7 +231,7 @@ void OSectionWindow::Resize() long nEndWidth = long(REPORT_ENDMARKER_WIDTH * GetMapMode().GetScaleX()); const Point aThumbPos = m_pParent->getView()->getThumbPos(); - aOutputSize.setWidth( aOutputSize.Width() - aThumbPos.X() ); + aOutputSize.AdjustWidth( -(aThumbPos.X()) ); aOutputSize.Height() -= m_aSplitter->GetSizePixel().Height(); if ( m_aStartMarker->isCollapsed() ) @@ -254,19 +254,19 @@ void OSectionWindow::Resize() Point aReportPos(nStartWidth,0); aSectionSize.setWidth( aOutputSize.Width() - nStartWidth ); if ( bShowEndMarker ) - aSectionSize.setWidth( aSectionSize.Width() - nEndWidth ); + aSectionSize.AdjustWidth( -nEndWidth ); m_aReportSection->SetPosSizePixel(aReportPos,aSectionSize); // set splitter - aReportPos.setY( aReportPos.Y() + aSectionSize.Height() ); + aReportPos.AdjustY(aSectionSize.Height() ); m_aSplitter->SetPosSizePixel(aReportPos,Size(aSectionSize.Width(),m_aSplitter->GetSizePixel().Height())); aSectionSize.setHeight( static_cast<long>(1000 * static_cast<double>(GetMapMode().GetScaleY())) ); m_aSplitter->SetDragRectPixel( tools::Rectangle(Point(nStartWidth,0),aSectionSize)); // set end marker - aReportPos.setX( aReportPos.X() + aSectionSize.Width() ); - aReportPos.Y() = 0; + aReportPos.AdjustX(aSectionSize.Width() ); + aReportPos.setY( 0 ); m_aEndMarker->Show(bShowEndMarker); m_aEndMarker->SetPosSizePixel(aReportPos,Size(nEndWidth,aOutputSize.Height())); } diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index 06b90386d8ec..82f36400ef08 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -114,7 +114,7 @@ void OStartMarker::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan { const long nVRulerWidth = m_aVRuler->GetSizePixel().Width(); long nSize = aSize.Width() - nVRulerWidth; - aSize.setWidth( aSize.Width() + nCornerWidth ); + aSize.AdjustWidth(nCornerWidth ); rRenderContext.SetClipRegion(vcl::Region(rRenderContext.PixelToLogic(tools::Rectangle(Point(), Size(nSize, aSize.Height()))))); } @@ -240,7 +240,7 @@ void OStartMarker::Resize() m_aText->SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight)); aPos.setX( nExtraWidth ); - aPos.setY( aPos.Y() + static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText->GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ) ; + aPos.AdjustY(static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText->GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ) ; m_aImage->SetPosSizePixel(aPos,aImageSize); } diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 080b74700d8c..224977bc80de 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -204,12 +204,12 @@ void OViewsWindow::impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Poin aSectionSize.setHeight( nMinHeight ); } const StyleSettings& rSettings = GetSettings().GetStyleSettings(); - aSectionSize.setHeight( aSectionSize.Height() + static_cast<long>(rSettings.GetSplitSize() * static_cast<double>(_rSectionWindow.GetMapMode().GetScaleY())) ); + aSectionSize.AdjustHeight(static_cast<long>(rSettings.GetSplitSize() * static_cast<double>(_rSectionWindow.GetMapMode().GetScaleY())) ); if ( _bSet ) _rSectionWindow.SetPosSizePixel(_rStartPoint,aSectionSize); - _rStartPoint.setY( _rStartPoint.Y() + aSectionSize.Height() ); + _rStartPoint.AdjustY(aSectionSize.Height() ); } @@ -261,7 +261,7 @@ void OViewsWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan Size aOut(GetOutputSizePixel()); long nStartWidth = long(REPORT_STARTMARKER_WIDTH * rRenderContext.GetMapMode().GetScaleX()); - aOut.setWidth( aOut.Width() - nStartWidth ); + aOut.AdjustWidth( -nStartWidth ); aOut = rRenderContext.PixelToLogic(aOut); tools::Rectangle aRect(rRenderContext.PixelToLogic(Point(nStartWidth,0)), aOut); @@ -1023,7 +1023,7 @@ void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const tools::Recta rView.MarkObj( pNewObj, rView.GetSdrPageView() ); } const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); - aNewPos.setY( aNewPos.Y() - nSectionHeight ); + aNewPos.AdjustY( -nSectionHeight ); } } @@ -1045,7 +1045,7 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi if (pView == _pSection) break; const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); - aAbsolutePnt.setY( aAbsolutePnt.Y() + nSectionHeight ); + aAbsolutePnt.AdjustY(nSectionHeight ); } m_aDragDelta = Point(SAL_MAX_INT32, SAL_MAX_INT32); SAL_INFO( @@ -1096,7 +1096,7 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi rView.SetWorkArea( aClipRect ); const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); - aNewObjPos.setY( aNewObjPos.Y() + nSectionHeight ); + aNewObjPos.AdjustY(nSectionHeight ); } const sal_Int32 nDeltaX = std::abs(aLeftTop.X() - aAbsolutePnt.X()); @@ -1128,7 +1128,7 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi rReportSection.getSectionView().BegDragObj(aNewPos, nullptr, pHdl, nDrgLog); const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); - aNewPos.setY( aNewPos.Y() - nSectionHeight ); + aNewPos.AdjustY( -nSectionHeight ); } } @@ -1157,11 +1157,11 @@ void OViewsWindow::BegMarkObj(const Point& _aPnt,const OSectionView* _pSection) else if ( bAdd ) { const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); - aNewPos.setY( aNewPos.Y() + nSectionHeight ); + aNewPos.AdjustY(nSectionHeight ); } else { - aNewPos.setY( aNewPos.Y() - nLastSectionHeight ); + aNewPos.AdjustY( -nLastSectionHeight ); } rReportSection.getSectionView().BegMarkObj ( aNewPos ); nLastSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); @@ -1189,7 +1189,7 @@ OSectionView* OViewsWindow::getSectionRelativeToPosition(const OSectionView* _pS { OReportSection& rReportSection = (*aIter)->getReportSection(); const sal_Int32 nHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); - _rPnt.setY( _rPnt.Y() + nHeight ); + _rPnt.AdjustY(nHeight ); if ( (nCount -1) > 0 && (_rPnt.Y() < 0) ) --aIter; } @@ -1206,7 +1206,7 @@ OSectionView* OViewsWindow::getSectionRelativeToPosition(const OSectionView* _pS const long nHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); if ( (_rPnt.Y() - nHeight) < 0 ) break; - _rPnt.setY( _rPnt.Y() - nHeight ); + _rPnt.AdjustY( -nHeight ); } if ( aIter != aEnd ) pSection = &(*aIter)->getReportSection().getSectionView(); @@ -1361,7 +1361,7 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection, b if ( &rReportSection.getSectionView() == _pSection ) break; const long nSectionHeight = (*aIter)->PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); - aCurrentSectionPos.setY( aCurrentSectionPos.Y() + nSectionHeight ); + aCurrentSectionPos.AdjustY(nSectionHeight ); } aRealMousePos += aCurrentSectionPos; @@ -1386,7 +1386,7 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection, b aClipRect.SetTop( -aPosForWorkArea.Y() ); rView.SetWorkArea( aClipRect ); } - aPosForWorkArea.setY( aPosForWorkArea.Y() + nSectionHeight ); + aPosForWorkArea.AdjustY(nSectionHeight ); } @@ -1401,7 +1401,7 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection, b } rReportSection.getSectionView().MovAction ( aRealMousePos ); const long nSectionHeight = (*aIter)->PixelToLogic((*aIter)->GetOutputSizePixel()).Height(); - aRealMousePos.setY( aRealMousePos.Y() - nSectionHeight ); + aRealMousePos.AdjustY( -nSectionHeight ); } } @@ -1491,7 +1491,7 @@ void OViewsWindow::handleKey(const vcl::KeyCode& _rCode) { // restrict movement to work area tools::Rectangle rWorkArea = rView.GetWorkArea(); - rWorkArea.SetRight( ++rWorkArea.Right() ); + rWorkArea.AdjustRight( 1 ); if ( !rWorkArea.IsEmpty() ) { @@ -1618,8 +1618,8 @@ void OViewsWindow::handleKey(const vcl::KeyCode& _rCode) case SdrHdlKind::UpperLeft: case SdrHdlKind::LowerLeft: case SdrHdlKind::Upper: - aNewRect.SetLeft( aNewRect.Left() + nX ); - aNewRect.SetTop( aNewRect.Top() + nY ); + aNewRect.AdjustLeft(nX ); + aNewRect.AdjustTop(nY ); break; case SdrHdlKind::UpperRight: case SdrHdlKind::Right: diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 1f81381d3619..4ce3b25da416 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -77,7 +77,7 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)); aStartWidth *= m_pParent->GetMapMode().GetScaleX(); - aOut.setWidth( aOut.Width() - static_cast<long>(aStartWidth) ); + aOut.AdjustWidth( -static_cast<long>(aStartWidth) ); aOut.Height() = m_pParent->GetOutputSizePixel().Height(); Point aPos = pScrollWindow->getThumbPos(); @@ -86,7 +86,7 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) tools::Rectangle aOutRect( aPos, aOut ); aOutRect = m_pParent->PixelToLogic( aOutRect ); tools::Rectangle aWorkArea(Point(), pScrollWindow->getTotalSize()); - aWorkArea.SetRight( aWorkArea.Right() - static_cast<long>(aStartWidth) ); + aWorkArea.AdjustRight( -static_cast<long>(aStartWidth) ); aWorkArea = pScrollWindow->PixelToLogic( aWorkArea ); if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) ) { |