summaryrefslogtreecommitdiff
path: root/sc/inc/table.hxx
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2017-01-31 00:25:12 +0100
committerBartosz Kosiorek <gang65@poczta.onet.pl>2017-02-24 23:15:48 +0000
commita1b1ed766d1110acf843b807d554f9375963234c (patch)
tree916d4b6e8bcc401a81d76f2893d51d344f42610c /sc/inc/table.hxx
parentcffa23b8d0c0b2d660505a11784addb7715a9937 (diff)
tdf#50916 Allow dynamically increase number of columns according to needs
Change-Id: I08b1d70b6aafb01738bb5dec3f4eafd7b21e6bb5 Reviewed-on: https://gerrit.libreoffice.org/33724 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'sc/inc/table.hxx')
-rw-r--r--sc/inc/table.hxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 3d446adce941..5f8711c786f5 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -241,6 +241,21 @@ public:
ScOutlineTable* GetOutlineTable() { return pOutlineTable; }
+ ScColumn& CreateColumnIfNotExists( SCCOL nScCol )
+ {
+ if ( nScCol >= aCol.size() )
+ {
+ SCCOL aOldColSize = aCol.size();
+ bool bUseEmptyAttrArray = false;
+ if ( aOldColSize == 0 )
+ bUseEmptyAttrArray = true;
+ aCol.resize( static_cast< size_t >( nScCol + 1 ) );
+ for (SCCOL i = aOldColSize; i <= nScCol; i++)
+ aCol[i].Init( i, nTab, pDocument, bUseEmptyAttrArray );
+
+ }
+ return aCol[nScCol];
+ }
sal_uLong GetCellCount() const;
sal_uLong GetWeightedCount() const;
sal_uLong GetCodeCount() const; // RPN code in formula
@@ -544,7 +559,7 @@ public:
FormulaError GetErrCode( const ScAddress& rPos ) const
{
- return ValidColRow(rPos.Col(),rPos.Row()) ?
+ return IsColRowValid(rPos.Col(),rPos.Row()) ?
aCol[rPos.Col()].GetErrCode( rPos.Row() ) :
FormulaError::NONE;
}