summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-04-29 13:55:23 +0300
committerJustin Luth <justin_luth@sil.org>2020-05-06 19:09:07 +0200
commit58b57bce7927dfd0ff35cd3dffafa1ed4d0cced7 (patch)
tree04cd93d6a6f4a968be4cbe38d507947eebab72c9
parent65b7873aab5deec7157328047e869a6385e0a74a (diff)
sw layout comments: clarify return value for MoveFwd etc.
Although MoveFwd and MoveBwd sound like mirror functions, their return values have different meanings, so clarify those distinctions and hint at the complexities of what move Fwd/Bwd mean in terms of pages/columns/sections/frames. Change-Id: Ie173fa3d6234c8dd466c32678134945c21f75dfd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93442 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins
-rw-r--r--sw/source/core/layout/flowfrm.cxx9
-rw-r--r--sw/source/core/layout/ftnfrm.cxx1
2 files changed, 7 insertions, 3 deletions
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index b4c8aeb27931..e33cb736ce19 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1826,7 +1826,9 @@ bool SwFlowFrame::ForbiddenForFootnoteCntFwd() const
return m_rThis.IsTabFrame() || m_rThis.IsInTab();
}
-/// Return value tells us whether the Frame has changed the page.
+/// Return value guarantees that a new page was not created,
+/// although false does not NECESSARILY indicate that a new page was created.
+/// Either false or true(MoveFootnoteCntFwd) can be returned if no changes were made
bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways )
{
//!!!!MoveFootnoteCntFwd might need to be updated as well.
@@ -2025,10 +2027,11 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways )
return bSamePage;
}
-/** Return value tells whether the Frame should change the page.
+/** Return value tells whether any changes have been made.
+ * If true, the frame has moved backwards to an earlier column/section/frame/page etc.
*
* @note This should be called by derived classes.
- * @note The actual moving must be implemented in the subclasses.
+ * @note The actual moving must be implemented in the subclasses via Cut()/Paste().
*/
bool SwFlowFrame::MoveBwd( bool &rbReformat )
{
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 274c3ef159d5..1b143e7d7b87 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -2722,6 +2722,7 @@ bool SwLayoutFrame::MoveLowerFootnotes( SwContentFrame *pStart, SwFootnoteBossFr
return bMoved;
}
+/// Return value guarantees that a new page was not created. See SwFlowFrame::MoveFwd.
bool SwContentFrame::MoveFootnoteCntFwd( bool bMakePage, SwFootnoteBossFrame *pOldBoss )
{
OSL_ENSURE( IsInFootnote(), "no footnote." );