diff options
author | Matteo Casalin <matteo.casalin@gmx.com> | 2012-10-28 23:23:53 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-11-20 19:32:43 +0000 |
commit | 53ad646f54f8aa33b86c696c04500fd08ea6f3b6 (patch) | |
tree | 3eef1a050a5cf7b8b531f56e125d7252f4aab8fe /vcl/source | |
parent | 5e5c11c664f67ff9fd1120905b09a32bea3b2f6c (diff) |
Enforce use of accessors on gen.hxx structures
Change-Id: Icd1b2937fdeaba6de1877258731f53ddf996002e
Reviewed-on: https://gerrit.libreoffice.org/936
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/button.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/imgctrl.cxx | 8 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 12 | ||||
-rw-r--r-- | vcl/source/gdi/outdev.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/brdwin.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 36 | ||||
-rw-r--r-- | vcl/source/window/splitwin.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/syswin.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 10 |
11 files changed, 62 insertions, 58 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index f27de4e0c690..b71ca99ebcb1 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -829,7 +829,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF sal_uInt16 nTextStyle = ImplGetTextStyle( nDrawFlags ); sal_uInt16 nStyle; - if( aInRect.nRight < aInRect.nLeft || aInRect.nBottom < aInRect.nTop ) + if( aInRect.Right() < aInRect.Left() || aInRect.Bottom() < aInRect.Top() ) aInRect.SetEmpty(); pDev->Push( PUSH_CLIPREGION ); diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx index 3c28bb8fe3d1..0f0369c26182 100644 --- a/vcl/source/control/imgctrl.cxx +++ b/vcl/source/control/imgctrl.cxx @@ -166,10 +166,10 @@ void ImageControl::Paint( const Rectangle& /*rRect*/ ) pWin->SetFillColor(); pWin->SetLineColor( bFlat ? COL_WHITE : COL_BLACK ); pWin->DrawRect( aRect ); - aRect.nLeft++; - aRect.nRight--; - aRect.nTop++; - aRect.nBottom--; + ++aRect.Left(); + --aRect.Right(); + ++aRect.Top(); + --aRect.Bottom(); pWin->SetLineColor( bFlat ? COL_BLACK : COL_WHITE ); pWin->DrawRect( aRect ); pWin->SetLineColor( oldLineCol ); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index dd048737f765..4e1afc25e29c 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1553,9 +1553,9 @@ long TabControl::PreNotify( NotifyEvent& rNEvt ) // as used by gtk // TODO: query for the correct sizes Rectangle aRect(*pLastRect); - aRect.nLeft-=2; - aRect.nRight+=2; - aRect.nTop-=3; + aRect.Left()-=2; + aRect.Right()+=2; + aRect.Top()-=3; aClipRgn.Union( aRect ); } if( pRect ) @@ -1564,9 +1564,9 @@ long TabControl::PreNotify( NotifyEvent& rNEvt ) // as used by gtk // TODO: query for the correct sizes Rectangle aRect(*pRect); - aRect.nLeft-=2; - aRect.nRight+=2; - aRect.nTop-=3; + aRect.Left()-=2; + aRect.Right()+=2; + aRect.Top()-=3; aClipRgn.Union( aRect ); } if( !aClipRgn.IsEmpty() ) diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index f266bf754c7e..d34cea9f9643 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -530,14 +530,14 @@ void OutputDevice::ImplReMirror( Point &rPoint ) const } void OutputDevice::ImplReMirror( Rectangle &rRect ) const { - long nWidth = rRect.nRight - rRect.nLeft; + long nWidth = rRect.Right() - rRect.Left(); //long lc_x = rRect.nLeft - mnOutOffX; // normalize //lc_x = mnOutWidth - nWidth - 1 - lc_x; // mirror //rRect.nLeft = lc_x + mnOutOffX; // re-normalize - rRect.nLeft = mnOutOffX + mnOutWidth - nWidth - 1 - rRect.nLeft + mnOutOffX; - rRect.nRight = rRect.nLeft + nWidth; + rRect.Left() = mnOutOffX + mnOutWidth - nWidth - 1 - rRect.Left() + mnOutOffX; + rRect.Right() = rRect.Left() + nWidth; } void OutputDevice::ImplReMirror( Region &rRegion ) const { diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index d3cfb45ca6e3..00b9cc34ab05 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -4178,10 +4178,10 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY, pLayout->DrawBase() = Point( nBaseX+mnTextOffX, nBaseY+mnTextOffY ); Rectangle aPixelRect; - aPixelRect.nLeft = nBaseX+mnTextOffX; - aPixelRect.nRight = aPixelRect.nLeft+nWidth; - aPixelRect.nBottom = nBaseY+mpFontEntry->maMetric.mnDescent; - aPixelRect.nTop = nBaseY-mpFontEntry->maMetric.mnAscent; + aPixelRect.Left() = nBaseX+mnTextOffX; + aPixelRect.Right() = aPixelRect.Left()+nWidth; + aPixelRect.Bottom() = nBaseY+mpFontEntry->maMetric.mnDescent; + aPixelRect.Top() = nBaseY-mpFontEntry->maMetric.mnAscent; if (mpFontEntry->mnOrientation) { diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 73c349c4ad8c..e93b1119162c 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8645,10 +8645,10 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik push( PUSH_CLIPREGION ); FontMetric aRefDevFontMetric = m_pReferenceDevice->GetFontMetric(); Rectangle aRect; - aRect.nLeft = rPos.X(); - aRect.nRight = aRect.nLeft+nWidth; - aRect.nBottom = rPos.Y()+aRefDevFontMetric.GetDescent(); - aRect.nTop = rPos.Y()-aRefDevFontMetric.GetAscent(); + aRect.Left() = rPos.X(); + aRect.Right() = aRect.Left()+nWidth; + aRect.Bottom() = rPos.Y()+aRefDevFontMetric.GetDescent(); + aRect.Top() = rPos.Y()-aRefDevFontMetric.GetAscent(); ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry; if (pFontEntry->mnOrientation) diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 34ae191b772f..9fea710b10b2 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -134,10 +134,10 @@ static void ImplDrawBrdWinSymbolButton( OutputDevice* pDev, sal_True, sal_False ); } aTempRect = rRect; - aTempRect.nLeft+=3; - aTempRect.nRight-=4; - aTempRect.nTop+=3; - aTempRect.nBottom-=4; + aTempRect.Left()+=3; + aTempRect.Right()-=4; + aTempRect.Top()+=3; + aTempRect.Bottom()-=4; } else { @@ -1690,8 +1690,10 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p pDev->SetLineColor( aFrameColor ); pDev->SetFillColor(); pDev->DrawRect( aInRect ); - aInRect.nLeft++; aInRect.nRight--; - aInRect.nTop++; aInRect.nBottom--; + ++aInRect.Left(); + --aInRect.Right(); + ++aInRect.Top(); + --aInRect.Bottom(); // restore if ( pData->mnTitleType == BORDERWINDOW_TITLE_POPUP ) diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index e523025fbfda..c48a7f8f0de5 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -190,9 +190,9 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockingHdl) sal_Int32 nLeft, nTop, nRight, nBottom; GetBorder( nLeft, nTop, nRight, nBottom ); // limit borderrect to the caption part only and without the resizing borders - aBorderRect.nBottom = aBorderRect.nTop + nTop; - aBorderRect.nLeft += nLeft; - aBorderRect.nRight -= nRight; + aBorderRect.Bottom() = aBorderRect.Top() + nTop; + aBorderRect.Left() += nLeft; + aBorderRect.Right() -= nRight; PointerState aBorderState = pBorder->GetPointerState(); if( aBorderRect.IsInside( aBorderState.maPos ) ) @@ -675,10 +675,10 @@ void ImplPopupFloatWin::DrawGrip() // draw background Rectangle aRect( GetDragRect() ); - aRect.nTop += POPUP_DRAGBORDER; - aRect.nBottom -= POPUP_DRAGBORDER; - aRect.nLeft+=3; - aRect.nRight-=3; + aRect.Top() += POPUP_DRAGBORDER; + aRect.Bottom() -= POPUP_DRAGBORDER; + aRect.Left()+=3; + aRect.Right()-=3; if( mbHighlight ) { @@ -701,16 +701,18 @@ void ImplPopupFloatWin::DrawGrip() aLineInfo.SetDashLen( 12 ); aLineInfo.SetDashCount( 1 ); - aRect.nLeft+=2; aRect.nRight-=2; + aRect.Left()+=2; + aRect.Right()-=2; - aRect.nTop+=2; - aRect.nBottom = aRect.nTop; + aRect.Top()+=2; + aRect.Bottom() = aRect.Top(); SetLineColor( GetSettings().GetStyleSettings().GetDarkShadowColor() ); DrawLine( aRect.TopLeft(), aRect.TopRight(), aLineInfo ); if( !mbHighlight ) { - aRect.nTop++; aRect.nBottom++; + ++aRect.Top(); + ++aRect.Bottom(); SetLineColor( GetSettings().GetStyleSettings().GetLightColor() ); DrawLine( aRect.TopLeft(), aRect.TopRight(), aLineInfo ); } @@ -718,8 +720,8 @@ void ImplPopupFloatWin::DrawGrip() #else // draw several grip lines SetFillColor( GetSettings().GetStyleSettings().GetShadowColor() ); - aRect.nTop++; - aRect.nBottom = aRect.nTop; + aRect.Top()++; + aRect.Bottom() = aRect.Top(); int width = POPUP_DRAGWIDTH; while( width >= aRect.getWidth() ) @@ -727,15 +729,15 @@ void ImplPopupFloatWin::DrawGrip() if( width <= 0 ) width = aRect.getWidth(); //aRect.nLeft = aRect.nLeft + (aRect.getWidth() - width) / 2; - aRect.nLeft = (aRect.nLeft + aRect.nRight - width) / 2; - aRect.nRight = aRect.nLeft + width; + aRect.Left() = (aRect.Left() + aRect.Right() - width) / 2; + aRect.Right() = aRect.Left() + width; int i=0; while( i< POPUP_DRAGGRIP ) { DrawRect( aRect ); - aRect.nTop+=2; - aRect.nBottom+=2; + aRect.Top()+=2; + aRect.Bottom()+=2; i+=2; } #endif diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 22d26462481a..e3eb5c139fb2 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -1973,9 +1973,9 @@ void SplitWindow::ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool if( bHorz ) { int width = (int) (0.5 * rRect.getWidth() + 0.5); - int i = rRect.nLeft + (rRect.getWidth() - width) / 2; + int i = rRect.Left() + (rRect.getWidth() - width) / 2; width += i; - const int y = rRect.nTop + 1; + const int y = rRect.Top() + 1; ImplDrawFadeArrow( Point( i-8, y), bHorz, bLeft ); while( i <= width ) { @@ -1996,9 +1996,9 @@ void SplitWindow::ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool else { int height = (int) (0.5 * rRect.getHeight() + 0.5); - int i = rRect.nTop + (rRect.getHeight() - height) / 2; + int i = rRect.Top() + (rRect.getHeight() - height) / 2; height += i; - const int x = rRect.nLeft + 1; + const int x = rRect.Left() + 1; ImplDrawFadeArrow( Point( x, i-8), bHorz, bLeft ); while( i <= height ) { diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 835d87415ec3..6338236c6c40 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -718,15 +718,15 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) if( abs(g.nX-aState.mnX) < 2 && abs(g.nY-aState.mnY) < 5 ) { long displacement = g.nTopDecoration ? g.nTopDecoration : 20; - if( (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.nRight || - (unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.nBottom ) + if( (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.Right() || + (unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.Bottom() ) { // displacing would leave screen aState.mnX = g.nLeftDecoration ? g.nLeftDecoration : 10; // should result in (0,0) aState.mnY = displacement; if( bWrapped || - (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.nRight || - (unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.nBottom ) + (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.Right() || + (unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.Bottom() ) break; // further displacement not possible -> break // avoid endless testing bWrapped = sal_True; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 661462eb510d..22c35fa01282 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -7101,7 +7101,7 @@ void Window::setPosSizePixel( long nX, long nY, // --- RTL --- (re-mirror at parent window) Rectangle aRect( Point ( nX, nY ), Size( nWidth, nHeight ) ); GetParent()->ImplReMirror( aRect ); - nX = aRect.nLeft; + nX = aRect.Left(); } } if( !(nFlags & WINDOW_POSSIZE_X) && bHasValidSize && pWindow->mpWindowImpl->mpFrame->maGeometry.nWidth ) @@ -9103,10 +9103,10 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, Rectangle aRect( rRect ); if( bDrawExtBorderOnly ) { - aRect.nLeft -= 1; - aRect.nTop -= 1; - aRect.nRight += 1; - aRect.nBottom += 1; + --aRect.Left(); + --aRect.Top(); + ++aRect.Right(); + ++aRect.Bottom(); } Color oldFillCol = GetFillColor(); Color oldLineCol = GetLineColor(); |