[Libreoffice-commits] core.git: editeng/source svtools/source sw/source tools/source

Mike Kaganski mike.kaganski at collabora.com
Tue Nov 29 20:47:18 UTC 2016


 editeng/source/editeng/impedit.cxx |    2 +-
 svtools/source/brwbox/brwbox2.cxx  |    2 +-
 sw/source/core/bastyp/swrect.cxx   |    4 ++--
 sw/source/core/text/inftxt.cxx     |   16 ++++++++--------
 sw/source/filter/html/css1atr.cxx  |    4 ++--
 sw/source/ui/index/cnttab.cxx      |   16 ++++++++--------
 tools/source/generic/poly.cxx      |    2 +-
 7 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit bbda0736edb3c3c0e57e0d6abcd47accfbfe790f
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Tue Nov 29 18:48:15 2016 +0300

    Use derived classes' methods instead of Pair::A/B
    
    Change-Id: I7ffd9a23dbd00672630bc8412e95525a920c5065
    Reviewed-on: https://gerrit.libreoffice.org/31379
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 1b8349b..81f0202 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1068,7 +1068,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
 {
     DBG_ASSERT( pEditEngine->pImpEditEngine->IsFormatted(), "Scroll: Not formatted!" );
     if ( !ndX && !ndY )
-        return Range( 0, 0 );
+        return Pair( 0, 0 );
 
 #ifdef DBG_UTIL
     Rectangle aR( aOutArea );
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index f840d2d..6d2e62e 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -1959,7 +1959,7 @@ Rectangle BrowseBox::calcHeaderRect(bool _bIsColumnBar, bool _bOnScreen)
     {
         aTopLeft.Y() = GetDataRowHeight();
         nWidth = GetColumnWidth(0);
-        nHeight = GetWindowExtentsRelative( pParent ).GetHeight() - aTopLeft.Y() - GetControlArea().GetSize().B();
+        nHeight = GetWindowExtentsRelative( pParent ).GetHeight() - aTopLeft.Y() - GetControlArea().GetSize().Height();
     }
     aTopLeft += GetWindowExtentsRelative( pParent ).TopLeft();
     return Rectangle(aTopLeft,Size(nWidth,nHeight));
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 175c73b..120b0d5 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -216,9 +216,9 @@ void SwRect::SetBottomAndHeight( long nBottom, long nNew )
 void SwRect::SetUpperLeftCorner(  const Point& rNew )
     { m_Point = rNew; }
 void SwRect::SetUpperRightCorner(  const Point& rNew )
-    { m_Point = Point(rNew.A() - m_Size.getWidth(), rNew.B()); }
+    { m_Point = Point(rNew.X() - m_Size.getWidth(), rNew.Y()); }
 void SwRect::SetLowerLeftCorner(  const Point& rNew )
-    { m_Point = Point(rNew.A(), rNew.B() - m_Size.getHeight()); }
+    { m_Point = Point(rNew.X(), rNew.Y() - m_Size.getHeight()); }
 
 #ifdef DBG_UTIL
 SvStream& WriteSwRect(SvStream &rStream, const SwRect &rRect)
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 0f467d2..2db0f19 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -748,22 +748,22 @@ void SwTextPaintInfo::CalcRect( const SwLinePortion& rPor,
         aSize.Height() = nTmp;
         if ( 1 == GetDirection() )
         {
-            aPoint.A() = X() - rPor.GetAscent();
-            aPoint.B() = Y() - aSize.Height();
+            aPoint.X() = X() - rPor.GetAscent();
+            aPoint.Y() = Y() - aSize.Height();
         }
         else
         {
-            aPoint.A() = X() - rPor.Height() + rPor.GetAscent();
-            aPoint.B() = Y();
+            aPoint.X() = X() - rPor.Height() + rPor.GetAscent();
+            aPoint.Y() = Y();
         }
     }
     else
     {
-        aPoint.A() = X();
+        aPoint.X() = X();
         if ( GetTextFrame()->IsVertLR() )
-            aPoint.B() = Y() - rPor.Height() + rPor.GetAscent();
+            aPoint.Y() = Y() - rPor.Height() + rPor.GetAscent();
         else
-            aPoint.B() = Y() - rPor.GetAscent();
+            aPoint.Y() = Y() - rPor.GetAscent();
     }
 
     // Adjust x coordinate if we are inside a bidi portion
@@ -772,7 +772,7 @@ void SwTextPaintInfo::CalcRect( const SwLinePortion& rPor,
                              (  bFrameDir && DIR_LEFT2RIGHT == GetDirection() );
 
     if ( bCounterDir )
-        aPoint.A() -= aSize.Width();
+        aPoint.X() -= aSize.Width();
 
     SwRect aRect( aPoint, aSize );
 
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index eb0aaac..32eebd7 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -2026,8 +2026,8 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat
                     if( pSdrObj )
                     {
                         Point aPos( pSdrObj->GetRelativePos() );
-                        nXPos = aPos.A();
-                        nYPos = aPos.B();
+                        nXPos = aPos.X();
+                        nYPos = aPos.Y();
                     }
                     bOutXPos = bOutYPos = true;
                 }
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 1ba8da3..6e7de7d 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -1570,17 +1570,17 @@ void SwTOXEdit::KeyInput( const KeyEvent& rKEvt )
 {
     const Selection& rSel = GetSelection();
     const sal_Int32 nTextLen = GetText().getLength();
-    if((rSel.A() == rSel.B() &&
-        !rSel.A()) || rSel.A() == nTextLen )
+    if((rSel.Min() == rSel.Max() &&
+        !rSel.Min()) || rSel.Min() == nTextLen )
     {
         bool bCall = false;
         vcl::KeyCode aCode = rKEvt.GetKeyCode();
-        if(aCode.GetCode() == KEY_RIGHT && rSel.A() == nTextLen)
+        if(aCode.GetCode() == KEY_RIGHT && rSel.Min() == nTextLen)
         {
             bNextControl = true;
             bCall = true;
         }
-        else if(aCode.GetCode() == KEY_LEFT && !rSel.A() )
+        else if(aCode.GetCode() == KEY_LEFT && !rSel.Min() )
         {
             bNextControl = false;
             bCall = true;
@@ -3080,8 +3080,8 @@ void SwTokenWindow::InsertAtSelection(const OUString& rText, const SwFormToken&
         aSel.Justify();
 
         const OUString sEditText = static_cast<SwTOXEdit*>(pActiveCtrl.get())->GetText();
-        const OUString sLeft = sEditText.copy( 0, aSel.A() );
-        const OUString sRight = sEditText.copy( aSel.B() );
+        const OUString sLeft = sEditText.copy( 0, aSel.Min() );
+        const OUString sRight = sEditText.copy( aSel.Max() );
 
         static_cast<SwTOXEdit*>(pActiveCtrl.get())->SetText(sLeft);
         static_cast<SwTOXEdit*>(pActiveCtrl.get())->AdjustSize();
@@ -3511,8 +3511,8 @@ IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton&, rBtn, void )
         {
             const sal_Int32 nLen = static_cast<SwTOXEdit*>(pCtrlFocus)->GetText().getLength();
 
-            aSel.A() = nLen;
-            aSel.B() = nLen;
+            aSel.Min() = nLen;
+            aSel.Max() = nLen;
         }
 
         static_cast<SwTOXEdit*>(pCtrlFocus)->SetSelection(aSel);
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index a49d998..593d186 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1129,7 +1129,7 @@ private:
     double              mfX;
     double              mfY;
 public:
-    explicit     Vector2D( const Point& rPair ) : mfX( rPair.A() ), mfY( rPair.B() ) {};
+    explicit     Vector2D( const Point& rPoint ) : mfX( rPoint.X() ), mfY( rPoint.Y() ) {};
     double       GetLength() const { return hypot( mfX, mfY ); }
     Vector2D&    operator-=( const Vector2D& rVec ) { mfX -= rVec.mfX; mfY -= rVec.mfY; return *this; }
     double       Scalar( const Vector2D& rVec ) const { return mfX * rVec.mfX + mfY * rVec.mfY ; }


More information about the Libreoffice-commits mailing list