LibreOffice Module sc (master)  1
consoli.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <consoli.hxx>
21 #include <document.hxx>
22 #include <olinetab.hxx>
23 #include <subtotal.hxx>
24 #include <formula/errorcodes.hxx>
25 #include <formulacell.hxx>
26 #include <tokenarray.hxx>
27 #include <osl/diagnose.h>
28 #include <refdata.hxx>
29 
30 #include <string.h>
31 #include <memory>
32 
33 #define SC_CONS_NOTFOUND -1
34 
35 const OpCode eOpCodeTable[] = { // order as for enum ScSubTotalFunc
36  ocBad, // none
37  ocAverage,
38  ocCount,
39  ocCount2,
40  ocMax,
41  ocMin,
42  ocProduct,
43  ocStDev,
44  ocStDevP,
45  ocSum,
46  ocVar,
47  ocVarP };
48 
49 template< typename T >
50 static void lcl_AddString( ::std::vector<OUString>& rData, T& nCount, const OUString& rInsert )
51 {
52  rData.push_back( rInsert);
53  ++nCount;
54 }
55 
57  eFunction(SUBTOTAL_FUNC_SUM),
58  bReference(false),
59  bColByName(false),
60  bRowByName(false),
61  nColCount(0),
62  nRowCount(0),
63  nDataCount(0),
64  bCornerUsed(false)
65 {
66 }
67 
69 {
70 }
71 
73 {
74  ppRefs.reset();
75  ppFunctionData.reset();
76  ppUsed.reset();
77  ppTitlePos.reset();
78  ::std::vector<OUString>().swap( maColHeaders);
79  ::std::vector<OUString>().swap( maRowHeaders);
80  ::std::vector<OUString>().swap( maTitles);
81  nDataCount = 0;
82 
83  if (bColByName) nColCount = 0; // otherwise maColHeaders is wrong
84  if (bRowByName) nRowCount = 0;
85 
86  bCornerUsed = false;
87  aCornerText.clear();
88 }
89 
91 {
92  if (bReference && nColCount && !ppRefs)
93  {
94  ppRefs.reset(new std::unique_ptr<ScReferenceList[]>[nColCount]);
95  for (SCSIZE i=0; i<nColCount; i++)
96  ppRefs[i].reset(new ScReferenceList[nRowCount]);
97  }
98  else if (nColCount && !ppFunctionData)
99  {
100  ppFunctionData.reset( new std::unique_ptr<ScFunctionData[]>[nColCount] );
101  for (SCSIZE i=0; i<nColCount; i++)
102  {
103  ppFunctionData[i].reset( new ScFunctionData[nRowCount] );
104  }
105  }
106 
107  if (nColCount && !ppUsed)
108  {
109  ppUsed.reset( new std::unique_ptr<bool[]>[nColCount] );
110  for (SCSIZE i=0; i<nColCount; i++)
111  {
112  ppUsed[i].reset( new bool[nRowCount] );
113  memset( ppUsed[i].get(), 0, nRowCount * sizeof(bool) );
114  }
115  }
116 
117  if (nRowCount && nDataCount && !ppTitlePos)
118  {
119  ppTitlePos.reset( new std::unique_ptr<SCSIZE[]>[nRowCount] );
120  for (SCSIZE i=0; i<nRowCount; i++)
121  {
122  ppTitlePos[i].reset( new SCSIZE[nDataCount] );
123  memset( ppTitlePos[i].get(), 0, nDataCount * sizeof(SCSIZE) ); //TODO: not necessary ?
124  }
125  }
126 
127  // CornerText: single String
128 }
129 
131 {
132  InitData();
133 }
134 
135 void ScConsData::SetSize( SCCOL nCols, SCROW nRows )
136 {
137  DeleteData();
138  nColCount = static_cast<SCSIZE>(nCols);
139  nRowCount = static_cast<SCSIZE>(nRows);
140 }
141 
142 void ScConsData::GetSize( SCCOL& rCols, SCROW& rRows ) const
143 {
144  rCols = static_cast<SCCOL>(nColCount);
145  rRows = static_cast<SCROW>(nRowCount);
146 }
147 
148 void ScConsData::SetFlags( ScSubTotalFunc eFunc, bool bColName, bool bRowName, bool bRef )
149 {
150  DeleteData();
151  bReference = bRef;
152  bColByName = bColName;
153  if (bColName) nColCount = 0;
154  bRowByName = bRowName;
155  if (bRowName) nRowCount = 0;
156  eFunction = eFunc;
157 }
158 
159 void ScConsData::AddFields( const ScDocument* pSrcDoc, SCTAB nTab,
160  SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
161 {
162  ++nDataCount;
163 
164  OUString aTitle;
165 
166  SCCOL nStartCol = nCol1;
167  SCROW nStartRow = nRow1;
168  if (bColByName) ++nStartRow;
169  if (bRowByName) ++nStartCol;
170 
171  if (bColByName)
172  {
173  for (SCCOL nCol=nStartCol; nCol<=nCol2; nCol++)
174  {
175  aTitle = pSrcDoc->GetString(nCol, nRow1, nTab);
176  if (!aTitle.isEmpty())
177  {
178  bool bFound = false;
179  for (SCSIZE i=0; i<nColCount && !bFound; i++)
180  if ( maColHeaders[i] == aTitle )
181  bFound = true;
182  if (!bFound)
184  }
185  }
186  }
187 
188  if (!bRowByName)
189  return;
190 
191  for (SCROW nRow=nStartRow; nRow<=nRow2; nRow++)
192  {
193  aTitle = pSrcDoc->GetString(nCol1, nRow, nTab);
194  if (!aTitle.isEmpty())
195  {
196  bool bFound = false;
197  for (SCSIZE i=0; i<nRowCount && !bFound; i++)
198  if ( maRowHeaders[i] == aTitle )
199  bFound = true;
200  if (!bFound)
202  }
203  }
204 }
205 
206 void ScConsData::AddName( const OUString& rName )
207 {
208  SCSIZE nArrX;
209  SCSIZE nArrY;
210 
211  if (!bReference)
212  return;
213 
214  maTitles.push_back( rName);
215  size_t nTitleCount = maTitles.size();
216 
217  for (nArrY=0; nArrY<nRowCount; nArrY++)
218  {
219  // set all data to same length
220 
221  SCSIZE nMax = 0;
222  for (nArrX=0; nArrX<nColCount; nArrX++)
223  nMax = std::max( nMax, ppRefs[nArrX][nArrY].size() );
224 
225  for (nArrX=0; nArrX<nColCount; nArrX++)
226  {
227  ppUsed[nArrX][nArrY] = true;
228  ppRefs[nArrX][nArrY].resize( nMax, { SC_CONS_NOTFOUND, SC_CONS_NOTFOUND, SC_CONS_NOTFOUND });
229  }
230 
231  // store positions
232 
233  if (ppTitlePos)
234  if (nTitleCount < nDataCount)
235  ppTitlePos[nArrY][nTitleCount] = nMax;
236  }
237 }
238 
239 void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab,
240  SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
241 {
242  PutInOrder(nCol1,nCol2);
243  PutInOrder(nRow1,nRow2);
244  if ( nCol2 >= sal::static_int_cast<SCCOL>(nCol1 + nColCount) && !bColByName )
245  {
246  OSL_FAIL("range too big");
247  nCol2 = sal::static_int_cast<SCCOL>( nCol1 + nColCount - 1 );
248  }
249  if ( nRow2 >= sal::static_int_cast<SCROW>(nRow1 + nRowCount) && !bRowByName )
250  {
251  OSL_FAIL("range too big");
252  nRow2 = sal::static_int_cast<SCROW>( nRow1 + nRowCount - 1 );
253  }
254 
255  SCCOL nCol;
256  SCROW nRow;
257 
258  // left top corner
259 
260  if ( bColByName && bRowByName )
261  {
262  OUString aThisCorner = pSrcDoc->GetString(nCol1, nRow1, nTab);
263  if (bCornerUsed)
264  {
265  if (aCornerText != aThisCorner)
266  aCornerText.clear();
267  }
268  else
269  {
270  aCornerText = aThisCorner;
271  bCornerUsed = true;
272  }
273  }
274 
275  // search title
276 
277  SCCOL nStartCol = nCol1;
278  SCROW nStartRow = nRow1;
279  if (bColByName) ++nStartRow;
280  if (bRowByName) ++nStartCol;
281  OUString aTitle;
282  std::unique_ptr<SCCOL[]> pDestCols;
283  std::unique_ptr<SCROW[]> pDestRows;
284  if (bColByName)
285  {
286  pDestCols.reset(new SCCOL[nCol2-nStartCol+1]);
287  for (nCol=nStartCol; nCol<=nCol2; nCol++)
288  {
289  aTitle = pSrcDoc->GetString(nCol, nRow1, nTab);
291  if (!aTitle.isEmpty())
292  {
293  bool bFound = false;
294  for (SCSIZE i=0; i<nColCount && !bFound; i++)
295  if ( maColHeaders[i] == aTitle )
296  {
297  nPos = static_cast<SCCOL>(i);
298  bFound = true;
299  }
300  OSL_ENSURE(bFound, "column not found");
301  }
302  pDestCols[nCol-nStartCol] = nPos;
303  }
304  }
305  if (bRowByName)
306  {
307  pDestRows.reset(new SCROW[nRow2-nStartRow+1]);
308  for (nRow=nStartRow; nRow<=nRow2; nRow++)
309  {
310  aTitle = pSrcDoc->GetString(nCol1, nRow, nTab);
312  if (!aTitle.isEmpty())
313  {
314  bool bFound = false;
315  for (SCSIZE i=0; i<nRowCount && !bFound; i++)
316  if ( maRowHeaders[i] == aTitle )
317  {
318  nPos = static_cast<SCROW>(i);
319  bFound = true;
320  }
321  OSL_ENSURE(bFound, "row not found");
322  }
323  pDestRows[nRow-nStartRow] = nPos;
324  }
325  }
326  nCol1 = nStartCol;
327  nRow1 = nStartRow;
328 
329  // data
330 
331  bool bAnyCell = ( eFunction == SUBTOTAL_FUNC_CNT2 );
332  for (nCol=nCol1; nCol<=nCol2; nCol++)
333  {
334  SCCOL nArrX = nCol-nCol1;
335  if (bColByName) nArrX = pDestCols[nArrX];
336  if (nArrX != SC_CONS_NOTFOUND)
337  {
338  for (nRow=nRow1; nRow<=nRow2; nRow++)
339  {
340  SCROW nArrY = nRow-nRow1;
341  if (bRowByName) nArrY = pDestRows[nArrY];
342  if ( nArrY != SC_CONS_NOTFOUND && (
343  bAnyCell ? pSrcDoc->HasData( nCol, nRow, nTab )
344  : pSrcDoc->HasValueData( nCol, nRow, nTab ) ) )
345  {
346  if (bReference)
347  {
348  ppUsed[nArrX][nArrY] = true;
349  ppRefs[nArrX][nArrY].push_back( { nCol, nRow, nTab } );
350  }
351  else
352  {
353  double nVal;
354  pSrcDoc->GetValue( nCol, nRow, nTab, nVal );
355  if (!ppUsed[nArrX][nArrY])
356  {
357  ppUsed[nArrX][nArrY] = true;
358  ppFunctionData[nArrX][nArrY] = ScFunctionData( eFunction);
359  }
360  ppFunctionData[nArrX][nArrY].update( nVal);
361  }
362  }
363  }
364  }
365  }
366 }
367 
368 // check before, how many rows to insert (for Undo)
369 
371 {
372  SCROW nInsert = 0;
373  SCSIZE nArrX;
374  SCSIZE nArrY;
375  if ( ppRefs && ppUsed )
376  {
377  for (nArrY=0; nArrY<nRowCount; nArrY++)
378  {
379  SCSIZE nNeeded = 0;
380  for (nArrX=0; nArrX<nColCount; nArrX++)
381  nNeeded = std::max( nNeeded, ppRefs[nArrX][nArrY].size() );
382 
383  nInsert += nNeeded;
384  }
385  }
386  return nInsert;
387 }
388 
389 // store completed data to document
390 //TODO: optimize on columns?
391 
392 void ScConsData::OutputToDocument( ScDocument& rDestDoc, SCCOL nCol, SCROW nRow, SCTAB nTab )
393 {
394  OpCode eOpCode = eOpCodeTable[eFunction];
395 
396  SCSIZE nArrX;
397  SCSIZE nArrY;
398 
399  // left top corner
400 
401  if ( bColByName && bRowByName && !aCornerText.isEmpty() )
402  rDestDoc.SetString( nCol, nRow, nTab, aCornerText );
403 
404  // title
405 
406  SCCOL nStartCol = nCol;
407  SCROW nStartRow = nRow;
408  if (bColByName) ++nStartRow;
409  if (bRowByName) ++nStartCol;
410 
411  if (bColByName)
412  for (SCSIZE i=0; i<nColCount; i++)
413  rDestDoc.SetString( sal::static_int_cast<SCCOL>(nStartCol+i), nRow, nTab, maColHeaders[i] );
414  if (bRowByName)
415  for (SCSIZE j=0; j<nRowCount; j++)
416  rDestDoc.SetString( nCol, sal::static_int_cast<SCROW>(nStartRow+j), nTab, maRowHeaders[j] );
417 
418  nCol = nStartCol;
419  nRow = nStartRow;
420 
421  // data
422 
423  if ( ppFunctionData && ppUsed ) // insert values directly
424  {
425  for (nArrX=0; nArrX<nColCount; nArrX++)
426  for (nArrY=0; nArrY<nRowCount; nArrY++)
427  if (ppUsed[nArrX][nArrY])
428  {
429  double fVal = ppFunctionData[nArrX][nArrY].getResult();
430  if (ppFunctionData[nArrX][nArrY].getError())
431  rDestDoc.SetError( sal::static_int_cast<SCCOL>(nCol+nArrX),
432  sal::static_int_cast<SCROW>(nRow+nArrY), nTab, FormulaError::NoValue );
433  else
434  rDestDoc.SetValue( sal::static_int_cast<SCCOL>(nCol+nArrX),
435  sal::static_int_cast<SCROW>(nRow+nArrY), nTab, fVal );
436  }
437  }
438 
439  if ( !(ppRefs && ppUsed) ) // insert Reference
440  return;
441 
442  //TODO: differentiate, if split into categories
443  OUString aString;
444 
445  ScSingleRefData aSRef; // data for Reference formula cells
446  aSRef.InitFlags(); // this reference is absolute at all times
447  aSRef.SetFlag3D(true);
448 
449  ScComplexRefData aCRef; // data for Sum cells
450  aCRef.InitFlags();
451  aCRef.Ref1.SetColRel(true); aCRef.Ref1.SetRowRel(true); aCRef.Ref1.SetTabRel(true);
452  aCRef.Ref2.SetColRel(true); aCRef.Ref2.SetRowRel(true); aCRef.Ref2.SetTabRel(true);
453 
454  for (nArrY=0; nArrY<nRowCount; nArrY++)
455  {
456  SCSIZE nNeeded = 0;
457  for (nArrX=0; nArrX<nColCount; nArrX++)
458  nNeeded = std::max( nNeeded, ppRefs[nArrX][nArrY].size() );
459 
460  if (nNeeded)
461  {
462  rDestDoc.InsertRow( 0,nTab, rDestDoc.MaxCol(),nTab, nRow+nArrY, nNeeded );
463 
464  for (nArrX=0; nArrX<nColCount; nArrX++)
465  if (ppUsed[nArrX][nArrY])
466  {
467  SCSIZE nCount = ppRefs[nArrX][nArrY].size();
468  if (nCount)
469  {
470  for (SCSIZE nPos=0; nPos<nCount; nPos++)
471  {
472  ScReferenceEntry aRef = ppRefs[nArrX][nArrY][nPos];
473  if (aRef.nTab != SC_CONS_NOTFOUND)
474  {
475  // insert reference (absolute, 3d)
476 
477  aSRef.SetAddress(rDestDoc.GetSheetLimits(), ScAddress(aRef.nCol,aRef.nRow,aRef.nTab), ScAddress());
478 
479  ScTokenArray aRefArr(rDestDoc);
480  aRefArr.AddSingleReference(aSRef);
481  aRefArr.AddOpCode(ocStop);
482  ScAddress aDest( sal::static_int_cast<SCCOL>(nCol+nArrX),
483  sal::static_int_cast<SCROW>(nRow+nArrY+nPos), nTab );
484  ScFormulaCell* pCell = new ScFormulaCell(rDestDoc, aDest, aRefArr);
485  rDestDoc.SetFormulaCell(aDest, pCell);
486  }
487  }
488 
489  // insert sum (relative, not 3d)
490 
491  ScAddress aDest( sal::static_int_cast<SCCOL>(nCol+nArrX),
492  sal::static_int_cast<SCROW>(nRow+nArrY+nNeeded), nTab );
493 
494  ScRange aRange(sal::static_int_cast<SCCOL>(nCol+nArrX), nRow+nArrY, nTab);
495  aRange.aEnd.SetRow(nRow+nArrY+nNeeded-1);
496  aCRef.SetRange(rDestDoc.GetSheetLimits(), aRange, aDest);
497 
498  ScTokenArray aArr(rDestDoc);
499  aArr.AddOpCode(eOpCode); // selected function
500  aArr.AddOpCode(ocOpen);
501  aArr.AddDoubleReference(aCRef);
502  aArr.AddOpCode(ocClose);
503  aArr.AddOpCode(ocStop);
504  ScFormulaCell* pCell = new ScFormulaCell(rDestDoc, aDest, aArr);
505  rDestDoc.SetFormulaCell(aDest, pCell);
506  }
507  }
508 
509  // insert outline
510 
511  ScOutlineArray& rOutArr = rDestDoc.GetOutlineTable( nTab, true )->GetRowArray();
512  SCROW nOutStart = nRow+nArrY;
513  SCROW nOutEnd = nRow+nArrY+nNeeded-1;
514  bool bSize = false;
515  rOutArr.Insert( nOutStart, nOutEnd, bSize );
516  for (SCROW nOutRow=nOutStart; nOutRow<=nOutEnd; nOutRow++)
517  rDestDoc.ShowRow( nOutRow, nTab, false );
518  rDestDoc.SetDrawPageSize(nTab);
519  rDestDoc.UpdateOutlineRow( nOutStart, nOutEnd, nTab, false );
520 
521  // sub title
522 
523  if (ppTitlePos && !maTitles.empty() && !maRowHeaders.empty())
524  {
525  for (SCSIZE nPos=0; nPos<nDataCount; nPos++)
526  {
527  SCSIZE nTPos = ppTitlePos[nArrY][nPos];
528  bool bDo = true;
529  if (nPos+1<nDataCount)
530  if (ppTitlePos[nArrY][nPos+1] == nTPos)
531  bDo = false; // empty
532  if ( bDo && nTPos < nNeeded )
533  {
534  aString = maRowHeaders[nArrY] + " / " + maTitles[nPos];
535  rDestDoc.SetString( nCol-1, nRow+nArrY+nTPos, nTab, aString );
536  }
537  }
538  }
539 
540  nRow += nNeeded;
541  }
542  }
543 }
544 
545 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define SC_CONS_NOTFOUND
Definition: consoli.cxx:33
formula::FormulaToken * AddDoubleReference(const ScComplexRefData &rRef)
Definition: token.cxx:2281
ocStop
ocStDevP
void AddName(const OUString &rName)
Definition: consoli.cxx:206
~ScConsData()
Definition: consoli.cxx:68
ocVar
Single reference (one address) into the sheet.
Definition: refdata.hxx:29
void InitFlags()
Definition: refdata.hxx:128
SC_DLLPUBLIC void SetDrawPageSize(SCTAB nTab)
Definition: documen9.cxx:195
void DoneFields()
Definition: consoli.cxx:130
bool bCornerUsed
Definition: consoli.hxx:64
ocOpen
formula::FormulaToken * AddSingleReference(const ScSingleRefData &rRef)
ScSingleRefToken with ocPush.
Definition: token.cxx:2271
SCSIZE nDataCount
Definition: consoli.hxx:62
ScAddress aEnd
Definition: address.hxx:500
ocProduct
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
Definition: document.cxx:3489
void SetRowRel(bool bVal)
Definition: refdata.hxx:66
ocCount
ocMin
ocCount2
const OpCode eOpCodeTable[]
Definition: consoli.cxx:35
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition: address.hxx:44
ScConsData()
Definition: consoli.cxx:56
OpCode
int nCount
void GetSize(SCCOL &rCols, SCROW &rRows) const
Definition: consoli.cxx:142
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
Definition: document.cxx:3517
std::unique_ptr< std::unique_ptr< SCSIZE[]>[]> ppTitlePos
Definition: consoli.hxx:63
void InitData()
Definition: consoli.cxx:90
void SetTabRel(bool bVal)
Definition: refdata.hxx:68
void SetRow(SCROW nRowP)
Definition: address.hxx:274
void SetError(SCCOL nCol, SCROW nRow, SCTAB nTab, const FormulaError nError)
Definition: documen2.cxx:1061
void SetFlags(ScSubTotalFunc eFunc, bool bColName, bool bRowName, bool bRef)
Definition: consoli.cxx:148
void PutInOrder(T &nStart, T &nEnd)
Definition: address.hxx:953
::std::vector< OUString > maRowHeaders
Definition: consoli.hxx:60
SC_DLLPUBLIC double GetValue(const ScAddress &rPos) const
Definition: document.cxx:3659
ocVarP
void AddFields(const ScDocument *pSrcDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Definition: consoli.cxx:159
void swap(cow_wrapper< T, P > &a, cow_wrapper< T, P > &b)
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
Definition: document.cxx:3394
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:871
int i
bool bColByName
Definition: consoli.hxx:52
SCSIZE nRowCount
Definition: consoli.hxx:55
void SetFlag3D(bool bVal)
Definition: refdata.hxx:89
const ScOutlineArray & GetRowArray() const
Definition: olinetab.hxx:160
sal_Int16 SCCOL
Definition: types.hxx:21
void OutputToDocument(ScDocument &rDestDoc, SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: consoli.cxx:392
ScSheetLimits & GetSheetLimits() const
Definition: document.hxx:873
ScSingleRefData Ref1
Definition: refdata.hxx:124
const SvxPageUsage aArr[]
bool InsertRow(SCCOL nStartCol, SCTAB nStartTab, SCCOL nEndCol, SCTAB nEndTab, SCROW nStartRow, SCSIZE nSize, ScDocument *pRefUndoDoc=nullptr, const ScMarkData *pTabMark=nullptr)
Definition: document.cxx:1240
ScSingleRefData Ref2
Definition: refdata.hxx:125
void AddData(ScDocument *pSrcDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Definition: consoli.cxx:239
ocBad
size
SCSIZE nColCount
Definition: consoli.hxx:54
ocMax
std::unique_ptr< std::unique_ptr< bool[]>[]> ppUsed
Definition: consoli.hxx:56
SC_DLLPUBLIC bool HasValueData(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3796
std::unique_ptr< std::unique_ptr< ScFunctionData[]>[]> ppFunctionData
Definition: consoli.hxx:57
static void lcl_AddString(::std::vector< OUString > &rData, T &nCount, const OUString &rInsert)
Definition: consoli.cxx:50
void DeleteData()
Definition: consoli.cxx:72
virtual formula::FormulaToken * AddOpCode(OpCode eCode) override
Definition: token.cxx:2264
bool bRowByName
Definition: consoli.hxx:53
SCROW GetInsertCount() const
Definition: consoli.cxx:370
sal_Int32 SCROW
Definition: types.hxx:17
To calculate a single subtotal function.
Definition: subtotal.hxx:60
void SetSize(SCCOL nCols, SCROW nRows)
Definition: consoli.cxx:135
SC_DLLPUBLIC ScFormulaCell * SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell)
Set formula cell, and transfer its ownership to the document.
Definition: documen2.cxx:1086
ocAverage
std::unique_ptr< std::unique_ptr< ScReferenceList[]>[]> ppRefs
Definition: consoli.hxx:58
void InitFlags()
No default ctor, because used in ScRawToken union, set InitFlags!
Definition: refdata.hxx:54
::std::vector< OUString > maTitles
Definition: consoli.hxx:61
SC_DLLPUBLIC ScOutlineTable * GetOutlineTable(SCTAB nTab, bool bCreate=false)
Definition: documen3.cxx:736
::std::vector< OUString > maColHeaders
Definition: consoli.hxx:59
void SetRange(const ScSheetLimits &rLimits, const ScRange &rRange, const ScAddress &rPos)
Set a new range, assuming that the ordering of the range matches the ordering of the reference data f...
Definition: refdata.cxx:498
SC_DLLPUBLIC bool HasData(SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: documen5.cxx:526
bool UpdateOutlineRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bShow)
Definition: documen3.cxx:1425
void SetAddress(const ScSheetLimits &rLimits, const ScAddress &rAddr, const ScAddress &rPos)
Definition: refdata.cxx:213
Complex reference (a range) into the sheet.
Definition: refdata.hxx:122
ScSubTotalFunc eFunction
Definition: consoli.hxx:50
ScSubTotalFunc
Definition: global.hxx:850
bool bReference
Definition: consoli.hxx:51
std::vector< ScReferenceEntry > ScReferenceList
Definition: consoli.hxx:49
OUString aCornerText
Definition: consoli.hxx:65
bool Insert(SCCOLROW nStartPos, SCCOLROW nEndPos, bool &rSizeChanged, bool bHidden=false)
Definition: olinetab.cxx:197
void SetColRel(bool bVal)
Definition: refdata.hxx:64
ocClose
SC_DLLPUBLIC void ShowRow(SCROW nRow, SCTAB nTab, bool bShow)
Definition: document.cxx:4335
sal_uInt16 nPos
sal_Int16 SCTAB
Definition: types.hxx:22
ocStDev
ocSum