[Libreoffice-commits] core.git: Branch 'libreoffice-5-2-4' - sw/inc sw/source

Mark Hung marklh9 at gmail.com
Tue Dec 13 14:18:35 UTC 2016


 sw/inc/swrect.hxx                |    2 ++
 sw/source/core/bastyp/swrect.cxx |    3 +++
 sw/source/core/inc/frame.hxx     |    4 ++++
 sw/source/core/layout/newfrm.cxx |   20 ++++++++++++++++++++
 4 files changed, 29 insertions(+)

New commits:
commit 302b60ef12bf5d90f3a362155816c77252a2bc90
Author: Mark Hung <marklh9 at gmail.com>
Date:   Fri Dec 9 20:17:09 2016 +0800

    tdf#101729 recover fnGetSize,fnLeftDist,fnRightDist,fnXInc
    
    Above field of struct SwRectFnCollection were removed because of
    loplugin:unusedfields. I can't find them refered in the source
    code but they do affect alignments.
    
    Partially recover d2df03574023b379ac09b1f71cae9e3ba3ac53e2
    and e18b08363a939b35e7f5dc435e606d2c62bddebd.
    
    Cherry-picked from
    611354a1c2e8281a80a1c3f5076a6c4593a4fe10
    
    Change-Id: I38f2b7a31565773b749cfeb1f47574c390d38527
    Reviewed-on: https://gerrit.libreoffice.org/31795
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-on: https://gerrit.libreoffice.org/31912
    (cherry picked from commit 6238f71ddbdc766e733b1c808a4fa7d66f7bde87)
    Reviewed-on: https://gerrit.libreoffice.org/31956
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Mark Hung <marklh9 at gmail.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index 99b6bfd..4d56bac 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -128,10 +128,12 @@ public:
     void SetUpperLeftCorner(  const Point& rNew );
     void SetUpperRightCorner(  const Point& rNew );
     void SetLowerLeftCorner(  const Point& rNew );
+    const Size  Size_() const;
     const Point TopLeft()  const;
     const Point TopRight()  const;
     const Point BottomLeft()  const;
     const Point BottomRight()  const;
+    const Size  SwappedSize() const;
     long GetLeftDistance( long ) const;
     long GetBottomDistance( long ) const;
     long GetRightDistance( long ) const;
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 175c73b..768c12f 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -173,6 +173,9 @@ void SwRect::AddBottom( const long nAdd ){ m_Size.Height() += nAdd; }
 void SwRect::SetPosX( const long nNew ){ m_Point.setX(nNew); }
 void SwRect::SetPosY( const long nNew ){ m_Point.setY(nNew); }
 
+const Size  SwRect::Size_() const { return SSize(); }
+const Size  SwRect::SwappedSize() const { return Size( m_Size.getHeight(), m_Size.getWidth() ); }
+
 const Point SwRect::TopLeft() const { return Pos(); }
 const Point SwRect::TopRight() const { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() ); }
 const Point SwRect::BottomLeft() const { return Point( m_Point.getX(), m_Point.getY() + m_Size.getHeight() ); }
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index df85c55..331e47e 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -1102,6 +1102,7 @@ struct SwRectFnCollection
     SwRectGet     fnGetWidth;
     SwRectGet     fnGetHeight;
     SwRectPoint   fnGetPos;
+    SwRectSize    fnGetSize;
 
     SwRectSet     fnSetTop;
     SwRectSet     fnSetBottom;
@@ -1132,6 +1133,8 @@ struct SwRectFnCollection
     SwFrameGet      fnGetPrtRight;
     SwRectDist      fnTopDist;
     SwRectDist      fnBottomDist;
+    SwRectDist      fnLeftDist;
+    SwRectDist      fnRightDist;
     SwFrameMax      fnSetLimit;
     SwRectMax       fnOverStep;
 
@@ -1139,6 +1142,7 @@ struct SwRectFnCollection
     SwFrameMakePos  fnMakePos;
     SwOperator      fnXDiff;
     SwOperator      fnYDiff;
+    SwOperator      fnXInc;
     SwOperator      fnYInc;
 
     SwRectSetTwice  fnSetLeftAndWidth;
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 1470822..ab7f43e 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -63,6 +63,7 @@ static SwRectFnCollection aHorizontal = {
     &SwRect::Width_,
     &SwRect::Height_,
     &SwRect::TopLeft,
+    &SwRect::Size_,
     /* fnRectSet      */
     &SwRect::Top_,
     &SwRect::Bottom_,
@@ -93,6 +94,8 @@ static SwRectFnCollection aHorizontal = {
     &SwFrame::GetPrtRight,
     &SwRect::GetTopDistance,
     &SwRect::GetBottomDistance,
+    &SwRect::GetLeftDistance,
+    &SwRect::GetRightDistance,
     &SwFrame::SetMaxBottom,
     &SwRect::OverStepBottom,
 
@@ -101,6 +104,7 @@ static SwRectFnCollection aHorizontal = {
     &FirstMinusSecond,
     &FirstMinusSecond,
     &SwIncrement,
+    &SwIncrement,
     &SwRect::SetLeftAndWidth,
     &SwRect::SetTopAndHeight
 };
@@ -114,6 +118,7 @@ static SwRectFnCollection aVertical = {
     &SwRect::Height_,
     &SwRect::Width_,
     &SwRect::TopRight,
+    &SwRect::SwappedSize,
     /* fnRectSet      */
     &SwRect::Rigth_,
     &SwRect::Left_,
@@ -144,6 +149,8 @@ static SwRectFnCollection aVertical = {
     &SwFrame::GetPrtBottom,
     &SwRect::GetRightDistance,
     &SwRect::GetLeftDistance,
+    &SwRect::GetTopDistance,
+    &SwRect::GetBottomDistance,
     &SwFrame::SetMinLeft,
     &SwRect::OverStepLeft,
 
@@ -152,6 +159,7 @@ static SwRectFnCollection aVertical = {
     &FirstMinusSecond,
     &SecondMinusFirst,
     &SwIncrement,
+    &SwDecrement,
     &SwRect::SetTopAndHeight,
     &SwRect::SetRightAndWidth
 };
@@ -165,6 +173,7 @@ static SwRectFnCollection aBottomToTop = {
     &SwRect::Width_,
     &SwRect::Height_,
     &SwRect::BottomLeft,
+    &SwRect::Size_,
     /* fnRectSet      */
     &SwRect::Bottom_,
     &SwRect::Top_,
@@ -195,6 +204,8 @@ static SwRectFnCollection aBottomToTop = {
     &SwFrame::GetPrtRight,
     &SwRect::GetBottomDistance,
     &SwRect::GetTopDistance,
+    &SwRect::GetLeftDistance,
+    &SwRect::GetRightDistance,
     &SwFrame::SetMinTop,
     &SwRect::OverStepTop,
 
@@ -203,6 +214,7 @@ static SwRectFnCollection aBottomToTop = {
     &FirstMinusSecond,
     &SecondMinusFirst,
     &SwIncrement,
+    &SwDecrement,
     &SwRect::SetLeftAndWidth,
     &SwRect::SetBottomAndHeight
 };
@@ -216,6 +228,7 @@ static SwRectFnCollection aVerticalRightToLeft = {
     &SwRect::Height_,
     &SwRect::Width_,
     &SwRect::BottomRight,
+    &SwRect::SwappedSize,
     /* fnRectSet      */
     &SwRect::Left_,
     &SwRect::Rigth_,
@@ -246,6 +259,8 @@ static SwRectFnCollection aVerticalRightToLeft = {
     &SwFrame::GetPrtTop,
     &SwRect::GetLeftDistance,
     &SwRect::GetRightDistance,
+    &SwRect::GetBottomDistance,
+    &SwRect::GetTopDistance,
     &SwFrame::SetMaxRight,
     &SwRect::OverStepRight,
 
@@ -254,6 +269,7 @@ static SwRectFnCollection aVerticalRightToLeft = {
     &FirstMinusSecond,
     &FirstMinusSecond,
     &SwDecrement,
+    &SwIncrement,
     &SwRect::SetBottomAndHeight,
     &SwRect::SetLeftAndWidth
 };
@@ -267,6 +283,7 @@ static SwRectFnCollection aVerticalLeftToRight = {
     &SwRect::Height_,
     &SwRect::Width_,
     &SwRect::TopLeft,
+    &SwRect::SwappedSize,
     /* fnRectSet      */
     &SwRect::Left_,
     &SwRect::Rigth_,
@@ -297,6 +314,8 @@ static SwRectFnCollection aVerticalLeftToRight = {
     &SwFrame::GetPrtBottom,
     &SwRect::GetLeftDistance,
     &SwRect::GetRightDistance,
+    &SwRect::GetTopDistance,
+    &SwRect::GetBottomDistance,
     &SwFrame::SetMaxRight,
     &SwRect::OverStepRight,
 
@@ -305,6 +324,7 @@ static SwRectFnCollection aVerticalLeftToRight = {
     &FirstMinusSecond,
     &FirstMinusSecond,
     &SwIncrement,
+    &SwIncrement,
     &SwRect::SetTopAndHeight,
     &SwRect::SetLeftAndWidth
 };


More information about the Libreoffice-commits mailing list