Kaydet (Commit) 94af1b11 authored tarafından Eike Rathke's avatar Eike Rathke

Check for HasAttrFlags::Protected instead ATTR_PROTECTION, tdf#68290 follow-up

ATTR_PROTECTION at ScAttrArray is not sufficient as also
conditional formatting may apply protection to otherwise
unprotected cells. This now actually enables travelling
Enter->Right in the sample document of tdf#68290 to advance to the
next row / first col if at the end of a row for such protected
cells.

This matches what the ScTabView::MoveCursorRel() call then does
via ScTabView::SkipCursorHorizontal() and
ScTabView::SkipCursorVertical() (additionally checking protection
options for selectable cells which should be done in
ScTable::GetNextPos() as well). Actually when getting things
straight the call to MoveCursorRel() may not be needed anymore and
MoveCursorAbs() could be sufficient, but *only* if we can
differentiate between viewshell cursor travel and UNO
gotoNext()/gotoPrevious() calls.

Change-Id: I0fcb0ecd748bbde982b260db4f4696166cfc5e78
Reviewed-on: https://gerrit.libreoffice.org/56947Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: Jenkins
üst c625bc9a
...@@ -1304,7 +1304,10 @@ bool ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark, ...@@ -1304,7 +1304,10 @@ bool ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark,
if (bMarked && !rMark.IsCellMarked(nCol,nRow)) if (bMarked && !rMark.IsCellMarked(nCol,nRow))
return false; return false;
if (bUnprotected && GetAttr(nCol,nRow,ATTR_PROTECTION)->GetProtection()) /* TODO: for cursor movement *only* this should even take the protection
* options (select locked, select unlocked) into account, see
* ScTabView::SkipCursorHorizontal() and ScTabView::SkipCursorVertical(). */
if (bUnprotected && pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HasAttrFlags::Protected))
return false; return false;
if (bMarked || bUnprotected) //TODO: also in other case ??? if (bMarked || bUnprotected) //TODO: also in other case ???
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment