sc/source/ui/docshell/dbdocfun.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
New commits: commit 4824d5ea717eedd245421272f25d99c0f72642bb Author: Martin van Zijl <martin.vanz...@gmail.com> AuthorDate: Thu Nov 22 09:42:34 2018 +1300 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Jan 14 07:05:44 2019 +0100 tdf#119804 allow sort when header row protected Change-Id: I303c11f8dbe4ccd302961b4afc0f67cd9c5d2582 Reviewed-on: https://gerrit.libreoffice.org/66133 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 5060c53ff205..aec29c4434e8 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -504,7 +504,18 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam, nTab = aLocalParam.nDestTab; } - ScEditableTester aTester( &rDoc, nTab, aLocalParam.nCol1,aLocalParam.nRow1, + // tdf#119804: If there is a header row/column, it won't be affected by + // sorting; so we can exclude it from the test. + SCROW nStartingRowToEdit = aLocalParam.nRow1; + SCROW nStartingColToEdit = aLocalParam.nCol1; + if ( aLocalParam.bHasHeader ) + { + if ( aLocalParam.bByRow ) + nStartingRowToEdit++; + else + nStartingColToEdit++; + } + ScEditableTester aTester( &rDoc, nTab, nStartingColToEdit,nStartingRowToEdit, aLocalParam.nCol2,aLocalParam.nRow2 ); if (!aTester.IsEditable()) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits