diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 17 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/delete.cxx | 23 |
2 files changed, 39 insertions, 1 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index ac00ff73114b..819fb163c54f 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -987,6 +987,23 @@ bool SwCrsrShell::IsSttPara() const bool SwCrsrShell::IsEndPara() const { return pCurCrsr->GetPoint()->nContent == pCurCrsr->GetCntntNode()->Len(); } +bool SwCrsrShell::IsEndOfTable() const +{ + if (IsTableMode() || IsBlockMode() || !IsEndPara()) + { + return false; + } + SwTableNode const*const pTableNode( IsCrsrInTbl() ); + if (!pTableNode) + { + return false; + } + SwEndNode const*const pEndTableNode(pTableNode->EndOfSectionNode()); + SwNodeIndex const lastNode(*pEndTableNode, -2); + SAL_WARN_IF(!lastNode.GetNode().GetTxtNode(), "sw.core", + "text node expected"); + return (lastNode == pCurCrsr->GetPoint()->nNode); +} bool SwCrsrShell::IsInFrontOfLabel() const { diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx index f714f6ae59e7..0c23dabb1c04 100644 --- a/sw/source/ui/wrtsh/delete.cxx +++ b/sw/source/ui/wrtsh/delete.cxx @@ -469,7 +469,28 @@ long SwWrtShell::DelToEndOfSentence() if(IsEndOfDoc()) return 0; OpenMark(); - long nRet = _FwdSentence() ? Delete() : 0; + long nRet(0); + // fdo#60967: special case that is documented in help: delete + // paragraph following table if cursor is at end of last cell in table + if (IsEndOfTable()) + { + Push(); + ClearMark(); + if (SwCrsrShell::Right(1,CRSR_SKIP_CHARS)) + { + SetMark(); + SwCrsrShell::MovePara(fnParaCurr, fnParaEnd); + if (!IsEndOfDoc()) // do not delete last paragraph in body text + { + nRet = DelFullPara() ? 1 : 0; + } + } + Pop(false); + } + else + { + nRet = _FwdSentence() ? Delete() : 0; + } CloseMark( 0 != nRet ); return nRet; } |