[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 14 06:06:08 UTC 2019


 sc/source/ui/docshell/dbdocfun.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 4824d5ea717eedd245421272f25d99c0f72642bb
Author:     Martin van Zijl <martin.vanzijl at gmail.com>
AuthorDate: Thu Nov 22 09:42:34 2018 +1300
Commit:     Noel Grandin <noel.grandin at 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.grandin at 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())
     {


More information about the Libreoffice-commits mailing list