[Libreoffice-commits] core.git: Branch 'private/kohei/calc-sort-fix' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Apr 22 17:59:28 PDT 2014


 sc/source/core/data/table3.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 01dc260b9a49e81ce3ad7df867db3ce3f84b50c8
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Apr 22 20:59:13 2014 -0400

    Skip reordering of cell formats when whole range is over one pattern entry.
    
    Change-Id: I2ee377a865f361673912b796af1eb8517c1456f7

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index a672303..77ecb69 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -370,6 +370,10 @@ ScSortInfoArray* ScTable::CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2, b
         for (SCCOL nCol = aSortParam.nCol1; nCol <= aSortParam.nCol2; ++nCol)
         {
             ScColumn& rCol = aCol[nCol];
+
+            // Skip reordering of cell formats if the whole span is on the same pattern entry.
+            bool bUniformPattern = rCol.GetPatternCount(nInd1, nInd2) < 2u;
+
             sc::ColumnBlockConstPosition aBlockPos;
             rCol.InitBlockPosition(aBlockPos);
             for (SCROW nRow = nInd1; nRow <= nInd2; ++nRow)
@@ -382,7 +386,7 @@ ScSortInfoArray* ScTable::CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2, b
                 rCell.mpBroadcaster = rCol.GetBroadcaster(aBlockPos, nRow);
                 rCell.mpNote = rCol.GetCellNote(aBlockPos, nRow);
 
-                if (aSortParam.bIncludePattern)
+                if (!bUniformPattern && aSortParam.bIncludePattern)
                     rCell.mpPattern = rCol.GetPattern(nRow);
             }
         }


More information about the Libreoffice-commits mailing list