summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-22 20:59:13 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-04-23 21:08:25 -0400
commit46b35f349ef795d89e4f03fe7f72623ee105e669 (patch)
treeb05eade943256b4e44f7f4489cfeb641e2fca60f /sc
parentd053d40e86381cc4e7c7249e66530f5f4323b514 (diff)
Skip reordering of cell formats when whole range is over one pattern entry.
Change-Id: I2ee377a865f361673912b796af1eb8517c1456f7
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table3.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index a672303acc5c..77ecb69b3ec4 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);
}
}