summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-08-11 17:54:09 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-08-14 16:56:58 +0200
commitf3cb59c46398b3a0646b8b374d5626f715fa6884 (patch)
tree3454eb0a65355bb990ff3037806d8fc711a69600
parentbfd3f939325e53c9dc85d2486316927c2b34eaf8 (diff)
tdf#134746 sw: fix redline hiding of at-char fly on empty paragraphs
If a merged paragraph has no extents, a fly anchored at the start or at the end should be shown. (regression from 28b77c89dfcafae82cf2a6d85731b643ff9290e5) Change-Id: I78135f3c033cf08aad81c86b0ac693528e3f3f8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100543 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--sw/source/core/layout/frmtool.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 9dac5b885233..2a56f8e5cb04 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1274,6 +1274,17 @@ bool IsAnchoredObjShown(SwTextFrame const& rFrame, SwFormatAnchor const& rAnchor
ret = false;
auto const pAnchor(rAnchor.GetContentAnchor());
auto iterFirst(pMergedPara->extents.cbegin());
+ if (iterFirst == pMergedPara->extents.end()
+ && (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA
+ || rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR))
+ {
+ ret = (&pAnchor->nNode.GetNode() == pMergedPara->pFirstNode
+ && (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA
+ || pAnchor->nContent == 0))
+ || (&pAnchor->nNode.GetNode() == pMergedPara->pLastNode
+ && (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA
+ || pAnchor->nContent == pMergedPara->pLastNode->Len()));
+ }
auto iter(iterFirst);
SwTextNode const* pNode(pMergedPara->pFirstNode);
for ( ; ; ++iter)