From 53ad646f54f8aa33b86c696c04500fd08ea6f3b6 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Sun, 28 Oct 2012 23:23:53 +0100 Subject: Enforce use of accessors on gen.hxx structures Change-Id: Icd1b2937fdeaba6de1877258731f53ddf996002e Reviewed-on: https://gerrit.libreoffice.org/936 Reviewed-by: Michael Stahl Tested-by: Michael Stahl --- svx/source/accessibility/ChildrenManagerImpl.cxx | 8 ++++---- svx/source/dialog/dlgctrl.cxx | 18 +++++++++--------- svx/source/svdraw/svddrgmt.cxx | 10 +++++----- svx/source/table/cell.cxx | 8 ++++---- svx/source/table/svdotable.cxx | 4 ++-- svx/source/table/tablelayouter.cxx | 12 ++++++------ svx/source/table/tablertfimporter.cxx | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) (limited to 'svx') diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index e409eef80d02..d9a92b0c9517 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -305,10 +305,10 @@ void ChildrenManagerImpl::CreateListOfVisibleShapes ( aPos = xShape->getPosition(); aSize = xShape->getSize(); - aBoundingBox.nLeft = aPos.X; - aBoundingBox.nTop = aPos.Y; - aBoundingBox.nRight = aPos.X + aSize.Width; - aBoundingBox.nBottom = aPos.Y + aSize.Height; + aBoundingBox.Left() = aPos.X; + aBoundingBox.Top() = aPos.Y; + aBoundingBox.Right() = aPos.X + aSize.Width; + aBoundingBox.Bottom() = aPos.Y + aSize.Height; // Insert shape if it is visible, i.e. its bounding box overlaps // the visible area. diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index c37687a9fe8d..3b138e7bdca7 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -968,7 +968,7 @@ void HatchingLB::UserDraw( const UserDrawEvent& rUDEvt ) { // Draw gradient with borderrectangle const Rectangle& rDrawRect = rUDEvt.GetRect(); - Rectangle aRect( rDrawRect.nLeft+1, rDrawRect.nTop+1, rDrawRect.nLeft+33, rDrawRect.nBottom-1 ); + Rectangle aRect( rDrawRect.Left()+1, rDrawRect.Top()+1, rDrawRect.Left()+33, rDrawRect.Bottom()-1 ); sal_Int32 nId = rUDEvt.GetItemId(); if( nId >= 0 && nId <= mpList->Count() ) @@ -995,7 +995,7 @@ void HatchingLB::UserDraw( const UserDrawEvent& rUDEvt ) pDevice->SetDrawMode( nOldDrawMode ); // Draw name - pDevice->DrawText( Point( aRect.nRight+7, aRect.nTop-1 ), mpList->GetHatch( rUDEvt.GetItemId() )->GetName() ); + pDevice->DrawText( Point( aRect.Right()+7, aRect.Top()-1 ), mpList->GetHatch( rUDEvt.GetItemId() )->GetName() ); } } } @@ -1087,7 +1087,7 @@ void GradientLB::UserDraw( const UserDrawEvent& rUDEvt ) { // Draw gradient with borderrectangle const Rectangle& rDrawRect = rUDEvt.GetRect(); - Rectangle aRect( rDrawRect.nLeft+1, rDrawRect.nTop+1, rDrawRect.nLeft+33, rDrawRect.nBottom-1 ); + Rectangle aRect( rDrawRect.Left()+1, rDrawRect.Top()+1, rDrawRect.Left()+33, rDrawRect.Bottom()-1 ); sal_Int32 nId = rUDEvt.GetItemId(); if( nId >= 0 && nId <= mpList->Count() ) @@ -1127,7 +1127,7 @@ void GradientLB::UserDraw( const UserDrawEvent& rUDEvt ) pDevice->DrawRect( aRect ); // Draw name - pDevice->DrawText( Point( aRect.nRight+7, aRect.nTop-1 ), mpList->GetGradient( rUDEvt.GetItemId() )->GetName() ); + pDevice->DrawText( Point( aRect.Right()+7, aRect.Top()-1 ), mpList->GetGradient( rUDEvt.GetItemId() )->GetName() ); } } } @@ -1268,20 +1268,20 @@ void BitmapLB::UserDraw( const UserDrawEvent& rUDEvt ) { // Draw bitmap const Rectangle& rDrawRect = rUDEvt.GetRect(); - Rectangle aRect( rDrawRect.nLeft+1, rDrawRect.nTop+1, rDrawRect.nLeft+33, rDrawRect.nBottom-1 ); + Rectangle aRect( rDrawRect.Left()+1, rDrawRect.Top()+1, rDrawRect.Left()+33, rDrawRect.Bottom()-1 ); sal_Int32 nId = rUDEvt.GetItemId(); if( nId >= 0 && nId <= mpList->Count() ) { - Rectangle aClipRect( rDrawRect.nLeft+1, rDrawRect.nTop+1, rDrawRect.nRight-1, rDrawRect.nBottom-1 ); + Rectangle aClipRect( rDrawRect.Left()+1, rDrawRect.Top()+1, rDrawRect.Right()-1, rDrawRect.Bottom()-1 ); OutputDevice* pDevice = rUDEvt.GetDevice(); pDevice->SetClipRegion( Region( aClipRect ) ); aBitmap = mpList->GetBitmap( nId )->GetXBitmap().GetBitmap(); - long nPosBaseX = aRect.nLeft; - long nPosBaseY = aRect.nTop; + long nPosBaseX = aRect.Left(); + long nPosBaseY = aRect.Top(); if( aBitmap.GetSizePixel().Width() > 8 || aBitmap.GetSizePixel().Height() > 8 ) @@ -1303,7 +1303,7 @@ void BitmapLB::UserDraw( const UserDrawEvent& rUDEvt ) pDevice->SetClipRegion(); // Draw name - pDevice->DrawText( Point( aRect.nRight+7, aRect.nTop-1 ), mpList->GetBitmap( nId )->GetName() ); + pDevice->DrawText( Point( aRect.Right()+7, aRect.Top()-1 ), mpList->GetBitmap( nId )->GetName() ); } } } diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index c16bbdba6721..578251bc9d2f 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -3577,7 +3577,7 @@ bool SdrDragCrop::EndSdrDrag(bool bCopy) else aGraphicSize = Application::GetDefaultDevice()->LogicToLogic( aGraphicSize, rGraphicObject.GetPrefMapMode(), aMapMode100thmm); - if( aGraphicSize.nA == 0 || aGraphicSize.nB == 0 ) + if( aGraphicSize.A() == 0 || aGraphicSize.B() == 0 ) return false; const SdrGrafCropItem& rOldCrop = (const SdrGrafCropItem&)pObj->GetMergedItem(SDRATTR_GRAFCROP); @@ -3613,10 +3613,10 @@ bool SdrDragCrop::EndSdrDrag(bool bCopy) aNewRect = Rectangle(aNewRect.TopLeft() - (aNewRect.BottomRight() - aNewRect.TopLeft()), aNewRect.TopLeft()); } - sal_Int32 nDiffLeft = aNewRect.nLeft - aOldRect.nLeft; - sal_Int32 nDiffTop = aNewRect.nTop - aOldRect.nTop; - sal_Int32 nDiffRight = aNewRect.nRight - aOldRect.nRight; - sal_Int32 nDiffBottom = aNewRect.nBottom - aOldRect.nBottom; + sal_Int32 nDiffLeft = aNewRect.Left() - aOldRect.Left(); + sal_Int32 nDiffTop = aNewRect.Top() - aOldRect.Top(); + sal_Int32 nDiffRight = aNewRect.Right() - aOldRect.Right(); + sal_Int32 nDiffBottom = aNewRect.Bottom() - aOldRect.Bottom(); sal_Int32 nLeftCrop = static_cast( rOldCrop.GetLeft() + nDiffLeft * fScaleX ); sal_Int32 nTopCrop = static_cast( rOldCrop.GetTop() + nDiffTop * fScaleY ); diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 7878426e1fe8..b7598208bbba 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -590,10 +590,10 @@ const Rectangle& Cell::GetCurrentBoundRect() const void Cell::TakeTextAnchorRect(Rectangle& rAnchorRect) const { - rAnchorRect.nLeft = maCellRect.nLeft + GetTextLeftDistance(); - rAnchorRect.nRight = maCellRect.nRight - GetTextRightDistance(); - rAnchorRect.nTop = maCellRect.nTop + GetTextUpperDistance(); - rAnchorRect.nBottom = maCellRect.nBottom - GetTextLowerDistance(); + rAnchorRect.Left() = maCellRect.Left() + GetTextLeftDistance(); + rAnchorRect.Right() = maCellRect.Right() - GetTextRightDistance(); + rAnchorRect.Top() = maCellRect.Top() + GetTextUpperDistance(); + rAnchorRect.Bottom() = maCellRect.Bottom() - GetTextLowerDistance(); } // ----------------------------------------------------------------------------- diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index c8be6a5bac5d..6d12c9bb5135 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1040,8 +1040,8 @@ TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_ const sal_Int32 nColCount = mpImpl->getColumnCount(); const sal_Int32 nRowCount = mpImpl->getRowCount(); - sal_Int32 nX = rPos.X() + nTol - aRect.nLeft; - sal_Int32 nY = rPos.Y() + nTol - aRect.nTop; + sal_Int32 nX = rPos.X() + nTol - aRect.Left(); + sal_Int32 nY = rPos.Y() + nTol - aRect.Top(); if( (nX < 0) || (nX > (aRect.GetWidth() + nTol)) || (nY < 0) || (nY > (aRect.GetHeight() + nTol) ) ) return SDRTABLEHIT_NONE; diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index 2a806f0661a2..e5f3ea8aae58 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -864,11 +864,11 @@ void TableLayouter::updateCells( Rectangle& rRectangle ) getCellArea( aPos, aCellArea ); Rectangle aCellRect; - aCellRect.nLeft = aCellArea.getMinX(); - aCellRect.nRight = aCellArea.getMaxX(); - aCellRect.nTop = aCellArea.getMinY(); - aCellRect.nBottom = aCellArea.getMaxY(); - aCellRect.Move( rRectangle.nLeft, rRectangle.nTop ); + aCellRect.Left() = aCellArea.getMinX(); + aCellRect.Right() = aCellArea.getMaxX(); + aCellRect.Top() = aCellArea.getMinY(); + aCellRect.Bottom() = aCellArea.getMaxY(); + aCellRect.Move( rRectangle.Left(), rRectangle.Top() ); xCell->setCellRect( aCellRect ); } } @@ -1115,7 +1115,7 @@ void TableLayouter::DistributeRows( ::Rectangle& rArea, sal_Int32 nFirstRow, sal if( nHeight < nMinHeight ) { sal_Int32 nNeededHeight = nRows * nMinHeight; - rArea.nBottom += nNeededHeight - nAllHeight; + rArea.Bottom() += nNeededHeight - nAllHeight; nHeight = nMinHeight; nAllHeight = nRows * nMinHeight; } diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index a0f6b8a3ae6a..38a060a2ad49 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -296,7 +296,7 @@ void SdrTableRTFParser::FillTable() } Rectangle aRect( mrTableObj.GetSnapRect() ); - aRect.nRight = aRect.nLeft + nLastEdge; + aRect.Right() = aRect.Left() + nLastEdge; mrTableObj.NbcSetSnapRect( aRect ); } -- cgit