summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-06 14:59:27 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-10 19:47:00 +0100
commit1ad75a70c22c84ed8710ee51c69eca31647647ad (patch)
treede5896a3bfe4aac749f753c978088a5286519fa2 /sw
parentba0d21259b0c77bfc5244215d6d62276bb60cb31 (diff)
sw_redlinehide_3: adapt more SwCursorShell InFrontOfLabel funcs
SwCursorShell::LeftRight() and SetCursor(). Change-Id: I71cd382f06a4050c4676864ac50fb268cd099226
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/crsrsh.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 125c85d4642f..6889862e26d2 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -333,10 +333,15 @@ bool SwCursorShell::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
}
// 2. CASE: Cursor is at beginning of numbered paragraph. A move
// to the left will simply set the bInFrontOfLabel flag:
- else if ( bLeft && 0 == pShellCursor->GetPoint()->nContent.GetIndex() &&
- !pShellCursor->IsInFrontOfLabel() && !pShellCursor->HasMark() &&
- nullptr != ( pTextNd = pShellCursor->GetNode().GetTextNode() ) &&
- pTextNd->HasVisibleNumberingOrBullet() )
+ else if (bLeft
+ && pShellCursor->GetPoint()->nNode.GetNode().IsTextNode()
+ && static_cast<SwTextFrame const*>(
+ pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->getLayoutFrame(GetLayout())
+ )->MapModelToViewPos(*pShellCursor->GetPoint()) == TextFrameIndex(0)
+ && !pShellCursor->IsInFrontOfLabel()
+ && !pShellCursor->HasMark()
+ && nullptr != (pTextNd = sw::GetParaPropsNode(*GetLayout(), pShellCursor->GetPoint()->nNode))
+ && pTextNd->HasVisibleNumberingOrBullet())
{
SetInFrontOfLabel( true );
bRet = true;
@@ -751,7 +756,7 @@ int SwCursorShell::SetCursor( const Point &rLPt, bool bOnlyText, bool bBlock )
bOnlyText ? MV_SETONLYTEXT : MV_NONE );
aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable();
- SwTextNode * pTextNd = pCursor->GetNode().GetTextNode();
+ SwTextNode const*const pTextNd = sw::GetParaPropsNode(*GetLayout(), pCursor->GetPoint()->nNode);
if ( pTextNd && !IsTableMode() &&
// #i37515# No bInFrontOfLabel during selection