summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2016-12-09 20:17:09 +0800
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-12-12 19:15:28 +0000
commit6238f71ddbdc766e733b1c808a4fa7d66f7bde87 (patch)
treea2e11ac154bb6feccdd92c37a5ec41e96b29e53f
parentb7d9f4fb2f1cedc788b7319c650ad1b464724fb0 (diff)
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@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/31912
-rw-r--r--sw/inc/swrect.hxx2
-rw-r--r--sw/source/core/bastyp/swrect.cxx3
-rw-r--r--sw/source/core/inc/frame.hxx4
-rw-r--r--sw/source/core/layout/newfrm.cxx20
4 files changed, 29 insertions, 0 deletions
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index e2be41a10d6e..5ae33f5caacf 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 175c73beb74c..768c12ff93d4 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 e8f56ce064e6..f6db821cb563 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -1095,6 +1095,7 @@ struct SwRectFnCollection
SwRectGet fnGetWidth;
SwRectGet fnGetHeight;
SwRectPoint fnGetPos;
+ SwRectSize fnGetSize;
SwRectSet fnSetTop;
SwRectSet fnSetBottom;
@@ -1125,6 +1126,8 @@ struct SwRectFnCollection
SwFrameGet fnGetPrtRight;
SwRectDist fnTopDist;
SwRectDist fnBottomDist;
+ SwRectDist fnLeftDist;
+ SwRectDist fnRightDist;
SwFrameMax fnSetLimit;
SwRectMax fnOverStep;
@@ -1132,6 +1135,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 e49fb633183a..e1a96cd25ac1 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
};