summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-10-16 17:31:25 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-15 15:10:00 +0100
commit2fcde5fa432a3928605bfb6f22d30dc07b9c1652 (patch)
tree7914a93f7f18db5b3a38398eb570ac588bdb49b5 /sw
parentc7314f8903ad251429a81a340c93f1b1121c20a7 (diff)
sw_redlinehide_3: invalidate footnotes in UnHideRedlines
... so the numbers are repainted, both in the document body and in the footnotes. Change-Id: I4164f1bace1b984a841f520f4832a324b811ab3f
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/txtftn.hxx2
-rw-r--r--sw/source/core/layout/wsfrm.cxx13
-rw-r--r--sw/source/core/txtnode/atrftn.cxx7
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 )