summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-05-17 00:09:39 +0200
committerMichael Stahl <mstahl@redhat.com>2013-05-17 00:15:27 +0200
commit38b06c661559e6eca60e2c4a4a3637b8293307b2 (patch)
tree3b25c012d4e44fa5b08de939a4ed92ef7c6ebf33 /sw/source/core
parentbb7360ca9929e9b395b3c903f460c9ed5efdce4d (diff)
fdo#60967: re-enable deletion of paragraph following table
This was actually a documented feature, so removing it just because it only happened to work sometimes by accident was a bad idea :) (regression from f4b6c94c68b5f67b931cde8d0acda6ec8b288bb) So implement this in a less accidental way, so that Ctrl+Shift+Del at the last position inside a table will delete the following paragraph. Do not implement the weird "only delete first sentence and merge rest of paragraph into cell" behavior, because i don't think it makes sense; much better to just delete the whole paragraph, that is also the most likely use-case for this (with table in frame/header/footer). Change-Id: Ia88b3c8958798fd9c64ee75b56c61d787079133e
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/crsr/crsrsh.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 24b2d0e02161..bd1d7499b639 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -975,6 +975,23 @@ bool SwCrsrShell::IsSttPara() const
bool SwCrsrShell::IsEndPara() const
{ return m_pCurCrsr->GetPoint()->nContent == m_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 == m_pCurCrsr->GetPoint()->nNode);
+}
bool SwCrsrShell::IsInFrontOfLabel() const
{