diff options
-rw-r--r-- | sw/inc/txtftn.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/txtnode/atrftn.cxx | 7 |
3 files changed, 21 insertions, 1 deletions
diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx index b18011444c90..faf0c727e83a 100644 --- a/sw/inc/txtftn.hxx +++ b/sw/inc/txtftn.hxx @@ -56,6 +56,8 @@ public: // Check conditional paragraph styles. void CheckCondColl(); + void InvalidateNumberInLayout(); + // For references to footnotes. void SetSeqRefNo(); void SetSeqNo( sal_uInt16 n ) { m_nSeqNo = n; } // For Readers. diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 69f6b1185134..9b81ed2131d9 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -35,6 +35,7 @@ #include <fesh.hxx> #include <docsh.hxx> #include <ftninfo.hxx> +#include <ftnidx.hxx> #include <fmtclbl.hxx> #include <fmtfsize.hxx> #include <fmtpdsc.hxx> @@ -4481,6 +4482,18 @@ void SwRootFrame::SetHideRedlines(bool const bHideRedlines) } } + // invalidate all footnotes to reformat their numbers + SwFootnoteIdxs const& rFootnotes(rDoc.GetFootnoteIdxs()); + for (SwTextFootnote *const pFootnote : rFootnotes) + { + SwFormatFootnote const& rFootnote(pFootnote->GetFootnote()); + if (rFootnote.GetNumber() != rFootnote.GetNumberRLHidden() + && rFootnote.GetNumStr().isEmpty()) + { + pFootnote->InvalidateNumberInLayout(); + } + } + // InvalidateAllContent(SwInvalidateFlags::Size); // ??? TODO what to invalidate? this is the big hammer } diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index 4e86ee932ff5..697019c9d128 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -344,8 +344,13 @@ void SwTextFootnote::SetNumber(const sal_uInt16 nNewNum, rFootnote.m_nNumber = nNewNum; rFootnote.m_nNumberRLHidden = nNumberRLHidden; } + InvalidateNumberInLayout(); +} - OSL_ENSURE( m_pTextNode, "SwTextFootnote: where is my TextNode?" ); +void SwTextFootnote::InvalidateNumberInLayout() +{ + assert(m_pTextNode); + SwFormatFootnote const& rFootnote(GetFootnote()); SwNodes &rNodes = m_pTextNode->GetDoc()->GetNodes(); m_pTextNode->ModifyNotification( nullptr, &rFootnote ); if ( m_pStartNode ) |