sw/source/core/text/txtfrm.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
New commits: commit 831b9594a2b91a6cb79624ccd28cdb6056165259 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Fri Sep 21 15:52:25 2018 +0200 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Mon Oct 1 10:37:29 2018 +0200 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.st...@cib.de> 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits