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