From 15cfc18ffd7bb27f68552f1d6908e657b96b99ad Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: May 04 2015 19:43:15 +0000 Subject: Resolves: tdf#90757 ensure start row / end row order makes sense --- diff --git a/0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch b/0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch new file mode 100644 index 0000000..8460b0e --- /dev/null +++ b/0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch @@ -0,0 +1,97 @@ +From 92ce22450d4a140b368bf95ae6975887f3a30032 Mon Sep 17 00:00:00 2001 +Message-Id: <92ce22450d4a140b368bf95ae6975887f3a30032.1430767502.git.erack@redhat.com> +From: Eike Rathke +Date: Mon, 4 May 2015 20:45:45 +0200 +Subject: [PATCH] Resolves tdf#90757 ensure start row / end row order makes + sense +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------erAck-patch-parts" + +This is a multi-part message in MIME format. +--------------erAck-patch-parts +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + + +... in case the header is the only row. + +(cherry picked from commit 46fa99f61aff88f1697959a9d3c41a5c3c3c05e9) + +Conflicts: + sc/source/ui/docshell/dbdocfun.cxx + +Change-Id: I5e6046007a8d668f9834e108aaf8af0072629fc8 +--- + sc/source/core/data/table3.cxx | 9 ++++----- + sc/source/ui/docshell/dbdocfun.cxx | 13 ++++++++----- + 2 files changed, 12 insertions(+), 10 deletions(-) + + +--------------erAck-patch-parts +Content-Type: text/x-patch; name="0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch" +Content-Transfer-Encoding: 8bit +Content-Disposition: attachment; filename="0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch" + +diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx +index daf370c..c9e9377 100644 +--- a/sc/source/core/data/table3.cxx ++++ b/sc/source/core/data/table3.cxx +@@ -1429,11 +1429,10 @@ void ScTable::Sort( + SCROW nLastRow = 0; + for (SCCOL nCol = rSortParam.nCol1; nCol <= rSortParam.nCol2; nCol++) + nLastRow = std::max(nLastRow, aCol[nCol].GetLastDataPos()); +- rSortParam.nRow2 = nLastRow = std::min(nLastRow, rSortParam.nRow2); +- SCROW nRow1 = (rSortParam.bHasHeader ? +- rSortParam.nRow1 + 1 : rSortParam.nRow1); ++ rSortParam.nRow2 = nLastRow = std::max( std::min(nLastRow, rSortParam.nRow2), rSortParam.nRow1); ++ SCROW nRow1 = (rSortParam.bHasHeader ? rSortParam.nRow1 + 1 : rSortParam.nRow1); + aSortParam = rSortParam; // must be assigned before calling IsSorted() +- if (!IsSorted(nRow1, nLastRow)) ++ if (nRow1 < nLastRow && !IsSorted(nRow1, nLastRow)) + { + if(pProgress) + pProgress->SetState( 0, nLastRow-nRow1 ); +@@ -1459,7 +1458,7 @@ void ScTable::Sort( + SCCOL nCol1 = (rSortParam.bHasHeader ? + rSortParam.nCol1 + 1 : rSortParam.nCol1); + aSortParam = rSortParam; // must be assigned before calling IsSorted() +- if (!IsSorted(nCol1, nLastCol)) ++ if (nCol1 < nLastCol && !IsSorted(nCol1, nLastCol)) + { + if(pProgress) + pProgress->SetState( 0, nLastCol-nCol1 ); +diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx +index c4e81bc..cb132b6 100644 +--- a/sc/source/ui/docshell/dbdocfun.cxx ++++ b/sc/source/ui/docshell/dbdocfun.cxx +@@ -531,10 +531,13 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam, + + pDBData->SetSortParam(rSortParam); + +- ScRange aDirtyRange( +- aLocalParam.nCol1, nStartRow, nTab, +- aLocalParam.nCol2, aLocalParam.nRow2, nTab); +- pDoc->SetDirty( aDirtyRange, true ); ++ if (nStartRow <= aLocalParam.nRow2) ++ { ++ ScRange aDirtyRange( ++ aLocalParam.nCol1, nStartRow, nTab, ++ aLocalParam.nCol2, aLocalParam.nRow2, nTab); ++ pDoc->SetDirty( aDirtyRange, true ); ++ } + + if (bPaint) + { +@@ -552,7 +555,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam, + rDocShell.PostPaint(ScRange(nStartX, nStartY, nTab, nEndX, nEndY, nTab), nPaint); + } + +- if (!bUniformRowHeight) ++ if (!bUniformRowHeight && nStartRow <= aLocalParam.nRow2) + rDocShell.AdjustRowHeight(nStartRow, aLocalParam.nRow2, nTab); + + aModificator.SetDocumentModified(); + +--------------erAck-patch-parts-- + + diff --git a/libreoffice.spec b/libreoffice.spec index f95344d..1d09918 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -381,6 +381,7 @@ Patch69: 0003-rhbz-1205072-sw-resource-mangement-SNAFU-caused-by-S.patch Patch70: 0004-sw-fix-SwAccessibleParagraph-crash-on-delete.patch Patch71: 0001-DOCX-import-fix-handling-of-dropdown-SDT-around-cell.patch Patch72: 0001-rhbz-1213173-connectivity-Calc-driver-prevent-docume.patch +Patch73: 0001-Resolves-tdf-90757-ensure-start-row-end-row-order-ma.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2358,6 +2359,7 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %changelog * Fri Apr 24 2015 Caolán McNamara - 1:4.3.7.2-5.UNBUILT - Resolves: rhbz#1213173 Calc database driver: prevent document being disposed +- Resolves: tdf#90757 ensure start row / end row order makes sense * Fri Apr 24 2015 Caolán McNamara - 1:4.3.7.2-4 - Resolves: tdf#87400 ~SwIndexReg assertion in AutoCorrect