sc/source/core/data/table1.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 94af1b1100e8b48f755ec66b190d2017aae1dc00 Author: Eike Rathke <er...@redhat.com> Date: Wed Jul 4 14:27:38 2018 +0200 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/56947 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index fe0473590d7b..4506d3e17fe0 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1304,7 +1304,10 @@ bool ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark, if (bMarked && !rMark.IsCellMarked(nCol,nRow)) 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; if (bMarked || bUnprotected) //TODO: also in other case ??? _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits