diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-21 15:52:25 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-10-01 10:37:29 +0200 |
commit | 831b9594a2b91a6cb79624ccd28cdb6056165259 (patch) | |
tree | 29abd74c6bdc99c0f74c865747f261fb07460150 | |
parent | 3dfa702ad8edff68ec70ac8d8cdad91c7e9157a9 (diff) |
sw_redlinehide_2: fix SwTextFrame::SwClientNotify corner case with footnotes
Change-Id: I88b611d59fa95b14091510b82f5530998074bfc4
Reviewed-on: https://gerrit.libreoffice.org/60932
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r-- | sw/source/core/text/txtfrm.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index fd9e02c5844e..02d3244e0118 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -2084,8 +2084,17 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint) case RES_TXTATR_FTN : { - nPos = MapModelToView(&rNode, - static_cast<const SwFormatFootnote*>(pNew)->GetTextFootnote()->GetStart()); + if (!IsInFootnote()) + { // the hint may be sent from the anchor node, or from a + // node in the footnote; the anchor index is only valid in the + // anchor node! + assert(&rNode == &static_cast<const SwFormatFootnote*>(pNew)->GetTextFootnote()->GetTextNode()); + nPos = MapModelToView(&rNode, + static_cast<const SwFormatFootnote*>(pNew)->GetTextFootnote()->GetStart()); + } +#ifdef _MSC_VER + else nPos = TextFrameIndex(42); // shut up MSVC 2017 spurious warning C4701 +#endif if (IsInFootnote() || IsIdxInside(nPos, TextFrameIndex(1))) Prepare( PREP_FTN, static_cast<const SwFormatFootnote*>(pNew)->GetTextFootnote() ); break; |