diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-06 14:59:27 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-15 15:10:05 +0100 |
commit | 3d6169eb3918ffb414ddc6fd36bc9973ccb36135 (patch) | |
tree | e6c07cb8b61d12bab72136c9e03ba3b42f8fd74b /sw | |
parent | 482eb7bee0084408760eddbf1b44f78f98d2707d (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.cxx | 15 |
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 |