[Libreoffice-commits] core.git: toolkit/source tools/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Feb 22 06:22:58 UTC 2018


 toolkit/source/awt/scrollabledialog.cxx      |    4 +-
 toolkit/source/awt/vclxgraphics.cxx          |    4 +-
 toolkit/source/awt/vclxwindow.cxx            |   12 ++++----
 toolkit/source/awt/vclxwindows.cxx           |   16 +++++-----
 toolkit/source/controls/dialogcontrol.cxx    |    4 +-
 toolkit/source/controls/stdtabcontroller.cxx |    4 +-
 toolkit/source/controls/tabpagemodel.cxx     |    4 +-
 toolkit/source/helper/vclunohelper.cxx       |    4 +-
 tools/source/generic/line.cxx                |    4 +-
 tools/source/generic/poly.cxx                |   40 +++++++++++++--------------
 tools/source/generic/svborder.cxx            |    8 ++---
 11 files changed, 52 insertions(+), 52 deletions(-)

New commits:
commit 8ec0f90a287febe661c89e098be457c5d593ded3
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 21 14:43:13 2018 +0200

    loplugin:changetoolsgen in tools..toolkit
    
    Change-Id: I3d87ee59258567b5a82cb459248539faea1b3ca9
    Reviewed-on: https://gerrit.libreoffice.org/50101
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/toolkit/source/awt/scrollabledialog.cxx b/toolkit/source/awt/scrollabledialog.cxx
index 0a808114a17f..3751ad5f29b9 100644
--- a/toolkit/source/awt/scrollabledialog.cxx
+++ b/toolkit/source/awt/scrollabledialog.cxx
@@ -138,13 +138,13 @@ void ScrollableDialog::SetScrollLeft( long nLeft )
 
 void ScrollableDialog::SetScrollWidth( long nWidth )
 {
-    maScrollArea.Width() = nWidth;
+    maScrollArea.setWidth( nWidth );
     ResetScrollBars();
 }
 
 void ScrollableDialog::SetScrollHeight( long nHeight )
 {
-    maScrollArea.Height() = nHeight;
+    maScrollArea.setHeight( nHeight );
     ResetScrollBars();
 }
 
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index e8496a105b6f..16a725bd8280 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -310,13 +310,13 @@ void VCLXGraphics::draw( const uno::Reference< awt::XDisplayBitmap >& rxBitmapHa
         if(nDestWidth != nSourceWidth)
         {
             float zoomX = static_cast<float>(nDestWidth) / static_cast<float>(nSourceWidth);
-            aSz.Width() = static_cast<long>(static_cast<float>(aSz.Width()) * zoomX);
+            aSz.setWidth( static_cast<long>(static_cast<float>(aSz.Width()) * zoomX) );
         }
 
         if(nDestHeight != nSourceHeight)
         {
             float zoomY = static_cast<float>(nDestHeight) / static_cast<float>(nSourceHeight);
-            aSz.Height() = static_cast<long>(static_cast<float>(aSz.Height()) * zoomY);
+            aSz.setHeight( static_cast<long>(static_cast<float>(aSz.Height()) * zoomY) );
         }
 
         if(nSourceX || nSourceY || aSz.Width() != nSourceWidth || aSz.Height() != nSourceHeight)
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 0c2a44a51ce3..f6aa5766de20 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -895,8 +895,8 @@ Size VCLXWindow::ImplCalcWindowSize( const Size& rOutSz ) const
     {
         sal_Int32 nLeft, nTop, nRight, nBottom;
         pWindow->GetBorder( nLeft, nTop, nRight, nBottom );
-        aSz.Width() += nLeft+nRight;
-        aSz.Height() += nTop+nBottom;
+        aSz.AdjustWidth(nLeft+nRight );
+        aSz.AdjustHeight(nTop+nBottom );
     }
     return aSz;
 }
@@ -2166,8 +2166,8 @@ css::awt::Size VCLXWindow::getMinimumSize(  )
         switch ( nWinType )
         {
             case WindowType::CONTROL:
-                aSz.Width() = GetWindow()->GetTextWidth( GetWindow()->GetText() )+2*12;
-                aSz.Height() = GetWindow()->GetTextHeight()+2*6;
+                aSz.setWidth( GetWindow()->GetTextWidth( GetWindow()->GetText() )+2*12 );
+                aSz.setHeight( GetWindow()->GetTextHeight()+2*6 );
             break;
 
             case WindowType::PATTERNBOX:
@@ -2177,8 +2177,8 @@ css::awt::Size VCLXWindow::getMinimumSize(  )
             case WindowType::DATEBOX:
             case WindowType::TIMEBOX:
             case WindowType::LONGCURRENCYBOX:
-                aSz.Width() = GetWindow()->GetTextWidth( GetWindow()->GetText() )+2*2;
-                aSz.Height() = GetWindow()->GetTextHeight()+2*2;
+                aSz.setWidth( GetWindow()->GetTextWidth( GetWindow()->GetText() )+2*2 );
+                aSz.setHeight( GetWindow()->GetTextHeight()+2*2 );
             break;
             case WindowType::SCROLLBARBOX:
                 return VCLXScrollBar::implGetMinimumSize( GetWindow() );
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index d984f94f66a1..a2dd7d4873a6 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -469,14 +469,14 @@ css::awt::Size VCLXButton::calcAdjustedSize( const css::awt::Size& rNewSize )
         if ( pButton->GetText().isEmpty() )
         {
             if ( aSz.Width() < aMinSz.Width() )
-                aSz.Width() = aMinSz.Width();
+                aSz.setWidth( aMinSz.Width() );
             if ( aSz.Height() < aMinSz.Height() )
-                aSz.Height() = aMinSz.Height();
+                aSz.setHeight( aMinSz.Height() );
         }
         else
         {
             if ( ( aSz.Width() > aMinSz.Width() ) && ( aSz.Height() < aMinSz.Height() ) )
-                aSz.Height() = aMinSz.Height();
+                aSz.setHeight( aMinSz.Height() );
             else
                 aSz = aMinSz;
         }
@@ -937,7 +937,7 @@ css::awt::Size VCLXCheckBox::calcAdjustedSize( const css::awt::Size& rNewSize )
     {
         Size aMinSz = pCheckBox->CalcMinimumSize();
         if ( ( aSz.Width() > aMinSz.Width() ) && ( aSz.Height() < aMinSz.Height() ) )
-            aSz.Height() = aMinSz.Height();
+            aSz.setHeight( aMinSz.Height() );
         else
             aSz = aMinSz;
     }
@@ -1279,7 +1279,7 @@ css::awt::Size VCLXRadioButton::calcAdjustedSize( const css::awt::Size& rNewSize
     {
         Size aMinSz = pRadioButton->CalcMinimumSize();
         if ( ( aSz.Width() > aMinSz.Width() ) && ( aSz.Height() < aMinSz.Height() ) )
-            aSz.Height() = aMinSz.Height();
+            aSz.setHeight( aMinSz.Height() );
         else
             aSz = aMinSz;
     }
@@ -1979,7 +1979,7 @@ css::awt::Size VCLXListBox::getPreferredSize(  )
     {
         aSz = pListBox->CalcMinimumSize();
         if ( pListBox->GetStyle() & WB_DROPDOWN )
-            aSz.Height() += 4;
+            aSz.AdjustHeight(4 );
     }
     return AWTSize(aSz);
 }
@@ -4025,7 +4025,7 @@ css::awt::Size VCLXEdit::getPreferredSize(  )
     if ( pEdit )
     {
         aSz = pEdit->CalcMinimumSize();
-        aSz.Height() += 4;
+        aSz.AdjustHeight(4 );
     }
     return AWTSize(aSz);
 }
@@ -4451,7 +4451,7 @@ css::awt::Size VCLXComboBox::getPreferredSize(  )
     {
         aSz = pComboBox->CalcMinimumSize();
         if ( pComboBox->GetStyle() & WB_DROPDOWN )
-            aSz.Height() += 4;
+            aSz.AdjustHeight(4 );
     }
     return AWTSize(aSz);
 }
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index edb95a6f3a94..05458dd13f05 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -502,8 +502,8 @@ void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e )
     if ( xDialogDevice.is() && mbDesignMode )
     {
         DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
-        aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
-        aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
+        aAppFontSize.AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
+        aAppFontSize.AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
     }
 
     aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx
index bf8a8192a58a..0b1c48045ea9 100644
--- a/toolkit/source/controls/stdtabcontroller.cxx
+++ b/toolkit/source/controls/stdtabcontroller.cxx
@@ -262,8 +262,8 @@ void StdTabController::autoTabOrder(  )
         ComponentEntry* pE = new ComponentEntry;
         pE->pComponent = pC;
         awt::Rectangle aPosSize = pC->getPosSize();
-        pE->aPos.X() = aPosSize.X;
-        pE->aPos.Y() = aPosSize.Y;
+        pE->aPos.setX( aPosSize.X );
+        pE->aPos.setY( aPosSize.Y );
 
         ComponentEntryList::size_type nPos;
         for ( nPos = 0; nPos < aCtrls.size(); nPos++ )
diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx
index 73a10f3c5461..e80407ef5780 100644
--- a/toolkit/source/controls/tabpagemodel.cxx
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -247,8 +247,8 @@ void SAL_CALL UnoControlTabPage::windowResized( const css::awt::WindowEvent& e )
     if ( xDialogDevice.is() )
     {
         DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
-        aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
-        aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
+        aAppFontSize.AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
+        aAppFontSize.AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
     }
 
     aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index cd8a2e5c4e25..904e520fd0ea 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -179,8 +179,8 @@ tools::Polygon VCLUnoHelper::CreatePolygon( const css::uno::Sequence< sal_Int32
     for ( sal_Int32 n = 0; n < nLen; n++ )
     {
         Point aPnt;
-        aPnt.X() = pDataX[n];
-        aPnt.Y() = pDataY[n];
+        aPnt.setX( pDataX[n] );
+        aPnt.setY( pDataY[n] );
         aPoly[n] = aPnt;
     }
     return aPoly;
diff --git a/tools/source/generic/line.cxx b/tools/source/generic/line.cxx
index 597b783f3523..b1a23635e9d6 100644
--- a/tools/source/generic/line.cxx
+++ b/tools/source/generic/line.cxx
@@ -39,8 +39,8 @@ bool Line::Intersection( const Line& rLine, Point& rIntersection ) const
 
     if( Intersection( rLine, fX, fY ) )
     {
-        rIntersection.X() = FRound( fX );
-        rIntersection.Y() = FRound( fY );
+        rIntersection.setX( FRound( fX ) );
+        rIntersection.setY( FRound( fY ) );
         bRet = true;
     }
     else
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 3c78b5a04bc8..387282b4af0e 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -206,17 +206,17 @@ ImplPolygon::ImplPolygon( const Point& rCenter, long nRadX, long nRadY )
             long nY = FRound( -nRadY * sin( nAngle ) );
 
             Point* pPt = &(mxPointAry[i]);
-            pPt->X() =  nX + rCenter.X();
-            pPt->Y() =  nY + rCenter.Y();
+            pPt->setX(  nX + rCenter.X() );
+            pPt->setY(  nY + rCenter.Y() );
             pPt = &(mxPointAry[nPoints2-i-1]);
-            pPt->X() = -nX + rCenter.X();
-            pPt->Y() =  nY + rCenter.Y();
+            pPt->setX( -nX + rCenter.X() );
+            pPt->setY(  nY + rCenter.Y() );
             pPt = &(mxPointAry[i+nPoints2]);
-            pPt->X() = -nX + rCenter.X();
-            pPt->Y() = -nY + rCenter.Y();
+            pPt->setX( -nX + rCenter.X() );
+            pPt->setY( -nY + rCenter.Y() );
             pPt = &(mxPointAry[nPoints-i-1]);
-            pPt->X() =  nX + rCenter.X();
-            pPt->Y() = -nY + rCenter.Y();
+            pPt->setX(  nX + rCenter.X() );
+            pPt->setY( -nY + rCenter.Y() );
         }
     }
     else
@@ -297,8 +297,8 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c
         {
             Point& rPt = mxPointAry[nStart];
 
-            rPt.X() = FRound( fCenterX + fRadX * cos( fStart ) );
-            rPt.Y() = FRound( fCenterY - fRadY * sin( fStart ) );
+            rPt.setX( FRound( fCenterX + fRadX * cos( fStart ) ) );
+            rPt.setY( FRound( fCenterY - fRadY * sin( fStart ) ) );
         }
 
         if( PolyStyle::Chord == eStyle )
@@ -340,8 +340,8 @@ ImplPolygon::ImplPolygon( const Point& rBezPt1, const Point& rCtrlPt1,
         double fK12 = fK_1 * fK1_2;
         double fK21 = fK_2 * fK1_1;
 
-        rPt.X() = FRound( fK1_3 * fX0 + fK12 * fX1 + fK21 * fX2 + fK_3 * fX3 );
-        rPt.Y() = FRound( fK1_3 * fY0 + fK12 * fY1 + fK21 * fY2 + fK_3 * fY3 );
+        rPt.setX( FRound( fK1_3 * fX0 + fK12 * fX1 + fK21 * fX2 + fK_3 * fX3 ) );
+        rPt.setY( FRound( fK1_3 * fY0 + fK12 * fY1 + fK21 * fY2 + fK_3 * fY3 ) );
     }
 }
 
@@ -1368,8 +1368,8 @@ void Polygon::Move( long nHorzMove, long nVertMove )
     for ( sal_uInt16 i = 0; i < nCount; i++ )
     {
         Point& rPt = mpImplPolygon->mxPointAry[i];
-        rPt.X() += nHorzMove;
-        rPt.Y() += nVertMove;
+        rPt.AdjustX(nHorzMove );
+        rPt.AdjustY(nVertMove );
     }
 }
 
@@ -1384,8 +1384,8 @@ void Polygon::Scale( double fScaleX, double fScaleY )
     for ( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
     {
         Point& rPnt = mpImplPolygon->mxPointAry[i];
-        rPnt.X() = static_cast<long>( fScaleX * rPnt.X() );
-        rPnt.Y() = static_cast<long>( fScaleY * rPnt.Y() );
+        rPnt.setX( static_cast<long>( fScaleX * rPnt.X() ) );
+        rPnt.setY( static_cast<long>( fScaleY * rPnt.Y() ) );
     }
 }
 
@@ -1411,8 +1411,8 @@ void Polygon::Rotate( const Point& rCenter, double fSin, double fCos )
 
         const long nX = rPt.X() - nCenterX;
         const long nY = rPt.Y() - nCenterY;
-        rPt.X() = FRound( fCos * nX + fSin * nY ) + nCenterX;
-        rPt.Y() = - FRound( fSin * nX - fCos * nY ) + nCenterY;
+        rPt.setX( FRound( fCos * nX + fSin * nY ) + nCenterX );
+        rPt.setY( - FRound( fSin * nX - fCos * nY ) + nCenterY );
     }
 }
 
@@ -1629,8 +1629,8 @@ SvStream& ReadPolygon( SvStream& rIStream, tools::Polygon& rPoly )
         {
             sal_Int32 nTmpX(0), nTmpY(0);
             rIStream.ReadInt32( nTmpX ).ReadInt32( nTmpY );
-            rPoly.mpImplPolygon->mxPointAry[i].X() = nTmpX;
-            rPoly.mpImplPolygon->mxPointAry[i].Y() = nTmpY;
+            rPoly.mpImplPolygon->mxPointAry[i].setX( nTmpX );
+            rPoly.mpImplPolygon->mxPointAry[i].setY( nTmpY );
         }
     }
 
diff --git a/tools/source/generic/svborder.cxx b/tools/source/generic/svborder.cxx
index 053fa25ab315..f9145dc21233 100644
--- a/tools/source/generic/svborder.cxx
+++ b/tools/source/generic/svborder.cxx
@@ -22,11 +22,11 @@ tools::Rectangle & operator += ( tools::Rectangle & rRect, const SvBorder & rBor
 {
     // call GetSize first due to Empty-Rect
     Size aS( rRect.GetSize() );
-    aS.Width()  += rBorder.Left() + rBorder.Right();
-    aS.Height() += rBorder.Top() + rBorder.Bottom();
+    aS.AdjustWidth(rBorder.Left() + rBorder.Right() );
+    aS.AdjustHeight(rBorder.Top() + rBorder.Bottom() );
 
-    rRect.Left()   -= rBorder.Left();
-    rRect.Top()    -= rBorder.Top();
+    rRect.AdjustLeft( -(rBorder.Left()) );
+    rRect.AdjustTop( -(rBorder.Top()) );
     rRect.SetSize( aS );
     return rRect;
 }


More information about the Libreoffice-commits mailing list