From 58b57bce7927dfd0ff35cd3dffafa1ed4d0cced7 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Wed, 29 Apr 2020 13:55:23 +0300 Subject: 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 Reviewed-by: Justin Luth Tested-by: Jenkins --- sw/source/core/layout/flowfrm.cxx | 9 ++++++--- sw/source/core/layout/ftnfrm.cxx | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'sw/source') 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." ); -- cgit v1.2.3