summaryrefslogtreecommitdiff
path: root/sc/source/core/data/column3.cxx
diff options
context:
space:
mode:
authorDennis Francis <dennisfrancis.in@gmail.com>2016-04-15 21:43:42 +0530
committerEike Rathke <erack@redhat.com>2016-11-10 15:11:28 +0000
commit06d3294502413a231e5c5265609862c7f67a2f2b (patch)
tree10ae793388158381a933632457d0eb17726586b9 /sc/source/core/data/column3.cxx
parent5e416099f088a2f8a8980e08e3d5b731da0a6d9c (diff)
Refactor ScAttrArray for tdf#50916
For a default column, now ScAttrArray does not store the default format. So the case of default pattern from 0 to MAXROW is represented as nCount = 0 and pData = nullptr in ScAttrArray. A new ScAttrArray object (aNextColAttrArray) is introduced as a member of ScTable. This is used to store the formatting of *unallocated* columns (whose indices are from aCol.size() to MAXCOL). In next patches for this bug, I plan to refactor table*.cxx functions related to formatting such that : 1) In formatting setter functions, if colspan of the input range spans the colrange(aCol.size() to MAXCOL) then instead of allocating columns, apply that formatting to aNextColAttrArray. 2) In formatting getter (const) functions, if requested colspan has some intersection with the colrange(aCol.size() to MAXCOL) then use the formatting info stored in aNextColAttrArray to calculate the formatting of the input range. 3) In general setter (non-const) functions if we really need to allocate new columns (example, when data is entered), use the formatting info stored in aNextColAttrArray to create pAttrArray of the new column. Change-Id: Ieb56f853209b396d92fdb2c27e39361703576423 Reviewed-on: https://gerrit.libreoffice.org/27828 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/core/data/column3.cxx')
-rw-r--r--sc/source/core/data/column3.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index b8042604ad7b..8a81dcb47a16 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1545,7 +1545,7 @@ void ScColumn::MixData(
ScAttrIterator* ScColumn::CreateAttrIterator( SCROW nStartRow, SCROW nEndRow ) const
{
- return new ScAttrIterator( pAttrArray, nStartRow, nEndRow );
+ return new ScAttrIterator( pAttrArray, nStartRow, nEndRow, pDocument->GetDefPattern() );
}
namespace {
@@ -2347,7 +2347,7 @@ void ScColumn::RemoveProtected( SCROW nStartRow, SCROW nEndRow )
FormulaToValueHandler aFunc;
sc::CellStoreType::const_iterator itPos = maCells.begin();
- ScAttrIterator aAttrIter( pAttrArray, nStartRow, nEndRow );
+ ScAttrIterator aAttrIter( pAttrArray, nStartRow, nEndRow, pDocument->GetDefPattern() );
SCROW nTop = -1;
SCROW nBottom = -1;
const ScPatternAttr* pPattern = aAttrIter.Next( nTop, nBottom );