From 1ad75a70c22c84ed8710ee51c69eca31647647ad Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 6 Nov 2018 14:59:27 +0100 Subject: sw_redlinehide_3: adapt more SwCursorShell InFrontOfLabel funcs SwCursorShell::LeftRight() and SetCursor(). Change-Id: I71cd382f06a4050c4676864ac50fb268cd099226 --- sw/source/core/crsr/crsrsh.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sw') 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( + 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 -- cgit v1.2.3