LibreOffice Module sc (master)  1
fillinfo.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 /*
4  * This file is part of the LibreOffice project.
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9  *
10  * This file incorporates work covered by the following license notice:
11  *
12  * Licensed to the Apache Software Foundation (ASF) under one or more
13  * contributor license agreements. See the NOTICE file distributed
14  * with this work for additional information regarding copyright
15  * ownership. The ASF licenses this file to you under the Apache
16  * License, Version 2.0 (the "License"); you may not use this file
17  * except in compliance with the License. You may obtain a copy of
18  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19  */
20 
21 #include <scitems.hxx>
22 #include <editeng/boxitem.hxx>
23 #include <editeng/lineitem.hxx>
24 #include <editeng/shaditem.hxx>
25 #include <editeng/brushitem.hxx>
26 #include <svx/framelink.hxx>
27 #include <osl/diagnose.h>
28 
29 #include <fillinfo.hxx>
30 #include <document.hxx>
31 #include <table.hxx>
32 #include <attrib.hxx>
33 #include <attarray.hxx>
34 #include <markarr.hxx>
35 #include <markdata.hxx>
36 #include <patattr.hxx>
37 #include <poolhelp.hxx>
38 #include <docpool.hxx>
39 #include <conditio.hxx>
40 #include <stlpool.hxx>
41 #include <cellvalue.hxx>
42 #include <mtvcellfunc.hxx>
43 
44 #include <algorithm>
45 #include <limits>
46 #include <vector>
47 #include <memory>
48 
49 // Similar as in output.cxx
50 
51 static void lcl_GetMergeRange( SCCOL nX, SCROW nY, SCSIZE nArrY,
52  const ScDocument* pDoc, RowInfo* pRowInfo,
53  SCCOL nX1, SCROW nY1, SCTAB nTab,
54  SCCOL& rStartX, SCROW& rStartY, SCCOL& rEndX, SCROW& rEndY )
55 {
56  CellInfo* pInfo = &pRowInfo[nArrY].pCellInfo[nX+1];
57 
58  rStartX = nX;
59  rStartY = nY;
60  bool bHOver = pInfo->bHOverlapped;
61  bool bVOver = pInfo->bVOverlapped;
62  SCCOL nLastCol;
63  SCROW nLastRow;
64 
65  while (bHOver) // nY constant
66  {
67  --rStartX;
68  if (rStartX >= nX1 && !pDoc->ColHidden(rStartX, nTab, nullptr, &nLastCol))
69  {
70  bHOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bHOverlapped;
71  bVOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bVOverlapped;
72  }
73  else
74  {
75  ScMF nOverlap = pDoc->GetAttr( rStartX, rStartY, nTab, ATTR_MERGE_FLAG )->GetValue();
76  bHOver = bool(nOverlap & ScMF::Hor);
77  bVOver = bool(nOverlap & ScMF::Ver);
78  }
79  }
80 
81  while (bVOver)
82  {
83  --rStartY;
84 
85  if (nArrY>0)
86  --nArrY; // local copy !
87 
88  if (rStartX >= nX1 && rStartY >= nY1 &&
89  !pDoc->ColHidden(rStartX, nTab, nullptr, &nLastCol) &&
90  !pDoc->RowHidden(rStartY, nTab, nullptr, &nLastRow) &&
91  pRowInfo[nArrY].nRowNo == rStartY)
92  {
93  bVOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bVOverlapped;
94  }
95  else
96  {
97  ScMF nOverlap = pDoc->GetAttr(
98  rStartX, rStartY, nTab, ATTR_MERGE_FLAG )->GetValue();
99  bVOver = bool(nOverlap & ScMF::Ver);
100  }
101  }
102 
103  const ScMergeAttr* pMerge;
104  if (rStartX >= nX1 && rStartY >= nY1 &&
105  !pDoc->ColHidden(rStartX, nTab, nullptr, &nLastCol) &&
106  !pDoc->RowHidden(rStartY, nTab, nullptr, &nLastRow) &&
107  pRowInfo[nArrY].nRowNo == rStartY)
108  {
109  pMerge = &pRowInfo[nArrY].pCellInfo[rStartX+1].pPatternAttr->
111  }
112  else
113  pMerge = pDoc->GetAttr(rStartX,rStartY,nTab,ATTR_MERGE);
114 
115  rEndX = rStartX + pMerge->GetColMerge() - 1;
116  rEndY = rStartY + pMerge->GetRowMerge() - 1;
117 }
118 
119 namespace {
120 
121 class RowInfoFiller
122 {
123  ScDocument& mrDoc;
124  SCTAB mnTab;
125  RowInfo* mpRowInfo;
126  SCCOL mnArrX;
127  SCSIZE mnArrY;
128  SCROW mnHiddenEndRow;
129  bool mbHiddenRow;
130 
131  bool isHidden(size_t nRow)
132  {
133  SCROW nThisRow = static_cast<SCROW>(nRow);
134  if (nThisRow > mnHiddenEndRow)
135  mbHiddenRow = mrDoc.RowHidden(nThisRow, mnTab, nullptr, &mnHiddenEndRow);
136  return mbHiddenRow;
137  }
138 
139  void alignArray(size_t nRow)
140  {
141  while (mpRowInfo[mnArrY].nRowNo < static_cast<SCROW>(nRow))
142  ++mnArrY;
143  }
144 
145  void setInfo(size_t nRow, const ScRefCellValue& rCell)
146  {
147  alignArray(nRow);
148 
149  RowInfo& rThisRowInfo = mpRowInfo[mnArrY];
150  CellInfo& rInfo = rThisRowInfo.pCellInfo[mnArrX];
151  rInfo.maCell = rCell;
152  rInfo.bEmptyCellText = false;
153  ++mnArrY;
154  }
155 
156 public:
157  RowInfoFiller(ScDocument& rDoc, SCTAB nTab, RowInfo* pRowInfo, SCCOL nArrX, SCSIZE nArrY) :
158  mrDoc(rDoc), mnTab(nTab), mpRowInfo(pRowInfo), mnArrX(nArrX), mnArrY(nArrY),
159  mnHiddenEndRow(-1), mbHiddenRow(false) {}
160 
161  void operator() (size_t nRow, double fVal)
162  {
163  if (!isHidden(nRow))
164  setInfo(nRow, ScRefCellValue(fVal));
165  }
166 
167  void operator() (size_t nRow, const svl::SharedString& rStr)
168  {
169  if (!isHidden(nRow))
170  setInfo(nRow, ScRefCellValue(&rStr));
171  }
172 
173  void operator() (size_t nRow, const EditTextObject* p)
174  {
175  if (!isHidden(nRow))
176  setInfo(nRow, ScRefCellValue(p));
177  }
178 
179  void operator() (size_t nRow, const ScFormulaCell* p)
180  {
181  if (!isHidden(nRow))
182  setInfo(nRow, ScRefCellValue(const_cast<ScFormulaCell*>(p)));
183  }
184 };
185 
186 bool isRotateItemUsed(const ScDocumentPool *pPool)
187 {
188  return pPool->GetItemCount2( ATTR_ROTATE_VALUE ) > 0;
189 }
190 
191 void initRowInfo(const ScDocument* pDoc, RowInfo* pRowInfo, const SCSIZE nMaxRow,
192  double fRowScale, SCROW nRow1, SCTAB nTab, SCROW& rYExtra, SCSIZE& rArrRow, SCROW& rRow2)
193 {
194  sal_uInt16 nDocHeight = ScGlobal::nStdRowHeight;
195  SCROW nDocHeightEndRow = -1;
196  for (SCROW nSignedY=nRow1-1; nSignedY<=rYExtra; nSignedY++)
197  {
198  SCROW nY;
199  if (nSignedY >= 0)
200  nY = nSignedY;
201  else
202  nY = MAXROW+1; // invalid
203 
204  if (nY > nDocHeightEndRow)
205  {
206  if (pDoc->ValidRow(nY))
207  nDocHeight = pDoc->GetRowHeight( nY, nTab, nullptr, &nDocHeightEndRow );
208  else
209  nDocHeight = ScGlobal::nStdRowHeight;
210  }
211 
212  if ( rArrRow==0 || nDocHeight || nY > MAXROW )
213  {
214  RowInfo* pThisRowInfo = &pRowInfo[rArrRow];
215  pThisRowInfo->pCellInfo = nullptr; // is loaded below
216 
217  sal_uInt16 nHeight = static_cast<sal_uInt16>(
218  std::clamp(
219  nDocHeight * fRowScale, 1.0, double(std::numeric_limits<sal_uInt16>::max())));
220 
221  pThisRowInfo->nRowNo = nY; //TODO: case < 0 ?
222  pThisRowInfo->nHeight = nHeight;
223  pThisRowInfo->bEmptyBack = true;
224  pThisRowInfo->bChanged = true;
225  pThisRowInfo->bAutoFilter = false;
226  pThisRowInfo->bPivotButton = false;
227  pThisRowInfo->nRotMaxCol = SC_ROTMAX_NONE;
228 
229  ++rArrRow;
230  if (rArrRow >= nMaxRow)
231  {
232  OSL_FAIL("FillInfo: Range too big" );
233  rYExtra = nSignedY; // End
234  rRow2 = rYExtra - 1; // Adjust range
235  }
236  }
237  else
238  if (nSignedY == rYExtra) // hidden additional line?
239  ++rYExtra;
240  }
241 }
242 
243 void initCellInfo(RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nRotMax,
244  const SvxShadowItem* pDefShadow)
245 {
246  for (SCSIZE nArrRow = 0; nArrRow < nArrCount; ++nArrRow)
247  {
248  RowInfo& rThisRowInfo = pRowInfo[nArrRow];
249  rThisRowInfo.pCellInfo = new CellInfo[nRotMax + 1 + 2]; // to delete the caller!
250 
251  for (SCCOL nArrCol = 0; nArrCol <= nRotMax+2; ++nArrCol) // Preassign cell info
252  {
253  CellInfo& rInfo = rThisRowInfo.pCellInfo[nArrCol];
254  rInfo.bEmptyCellText = true;
255  rInfo.pShadowAttr = pDefShadow;
256  }
257  }
258 }
259 
260 void initColWidths(RowInfo* pRowInfo, const ScDocument* pDoc, double fColScale, SCTAB nTab, SCCOL nCol2, SCCOL nRotMax)
261 {
262  for (SCCOL nArrCol=nCol2+3; nArrCol<=nRotMax+2; nArrCol++) // Add remaining widths
263  {
264  SCCOL nX = nArrCol-1;
265  if ( pDoc->ValidCol(nX) )
266  {
267  if (!pDoc->ColHidden(nX, nTab))
268  {
269  sal_uInt16 nThisWidth = static_cast<sal_uInt16>(pDoc->GetColWidth( nX, nTab ) * fColScale);
270  if (!nThisWidth)
271  nThisWidth = 1;
272 
273  pRowInfo[0].pCellInfo[nArrCol].nWidth = nThisWidth;
274  }
275  }
276  }
277 }
278 
279 bool handleConditionalFormat(ScConditionalFormatList& rCondFormList, const ScCondFormatIndexes& rCondFormats,
280  CellInfo* pInfo, ScStyleSheetPool* pStlPool,
281  const ScAddress& rAddr, bool& bHidden, bool& bHideFormula, bool bTabProtect)
282 {
283  bool bFound = false;
284  bool bAnyCondition = false;
285  for(const auto& rCondFormat : rCondFormats)
286  {
287  ScConditionalFormat* pCondForm = rCondFormList.GetFormat(rCondFormat);
288  if(!pCondForm)
289  continue;
290 
291  ScCondFormatData aData = pCondForm->GetData(
292  pInfo->maCell, rAddr);
293  if (!aData.aStyleName.isEmpty())
294  {
295  SfxStyleSheetBase* pStyleSheet =
296  pStlPool->Find( aData.aStyleName, SfxStyleFamily::Para );
297  if ( pStyleSheet )
298  {
299  //TODO: cache Style-Sets !!!
300  pInfo->pConditionSet = &pStyleSheet->GetItemSet();
301  bAnyCondition = true;
302 
303  // TODO: moggi: looks like there is a bug around bHidden and bHideFormula
304  // They are normally for the whole pattern and not for a single cell
305  // we need to check already here for protected cells
306  const SfxPoolItem* pItem;
307  if ( bTabProtect && pInfo->pConditionSet->GetItemState( ATTR_PROTECTION, true, &pItem ) == SfxItemState::SET )
308  {
309  const ScProtectionAttr* pProtAttr = static_cast<const ScProtectionAttr*>(pItem);
310  bHidden = pProtAttr->GetHideCell();
311  bHideFormula = pProtAttr->GetHideFormula();
312 
313  }
314  bFound = true;
315 
316  }
317  // if style is not there, treat like no condition
318  }
319 
320  if(aData.mxColorScale)
321  {
322  pInfo->mxColorScale = aData.mxColorScale;
323  bFound = true;
324  }
325 
326  if(aData.pDataBar)
327  {
328  pInfo->pDataBar = std::move(aData.pDataBar);
329  bFound = true;
330  }
331 
332  if(aData.pIconSet)
333  {
334  pInfo->pIconSet = std::move(aData.pIconSet);
335  bFound = true;
336  }
337 
338  if (bFound)
339  break;
340  }
341 
342  return bAnyCondition;
343 }
344 
345 }
346 
348  ScTableInfo& rTabInfo, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
349  SCTAB nTab, double fColScale, double fRowScale, bool bPageMode, bool bFormulaMode,
350  const ScMarkData* pMarkData )
351 {
352  OSL_ENSURE( maTabs[nTab], "Table does not exist" );
353 
354  bool bLayoutRTL = IsLayoutRTL( nTab );
355 
356  ScDocumentPool* pPool = mxPoolHelper->GetDocPool();
357  ScStyleSheetPool* pStlPool = mxPoolHelper->GetStylePool();
358 
359  RowInfo* pRowInfo = rTabInfo.mpRowInfo.get();
360 
361  const SvxBrushItem* pDefBackground =
362  &pPool->GetDefaultItem( ATTR_BACKGROUND );
363  const ScMergeAttr* pDefMerge =
364  &pPool->GetDefaultItem( ATTR_MERGE );
365  const SvxShadowItem* pDefShadow =
366  &pPool->GetDefaultItem( ATTR_SHADOW );
367 
368  SCSIZE nArrRow;
369  SCSIZE nArrCount;
370  bool bAnyMerged = false;
371  bool bAnyShadow = false;
372  bool bAnyCondition = false;
373  bool bAnyPreview = false;
374 
375  bool bTabProtect = IsTabProtected(nTab);
376 
377  // first only the entries for the entire column
378 
379  nArrRow=0;
380  SCROW nYExtra = nRow2+1;
381  initRowInfo(this, pRowInfo, rTabInfo.mnArrCapacity, fRowScale, nRow1,
382  nTab, nYExtra, nArrRow, nRow2);
383  nArrCount = nArrRow; // incl. Dummys
384 
385  // Rotated text...
386 
387  // Is Attribute really used in document?
388  bool bAnyItem = isRotateItemUsed(pPool);
389 
390  SCCOL nRotMax = nCol2;
391  if ( bAnyItem && HasAttrib( 0, nRow1, nTab, MAXCOL, nRow2+1, nTab,
393  {
394  //TODO: check Conditionals also for HasAttrFlags::Rotate ????
395 
396  OSL_ENSURE( nArrCount>2, "nArrCount too small" );
397  FindMaxRotCol( nTab, &pRowInfo[1], nArrCount-1, nCol1, nCol2 );
398  // FindMaxRotCol setzt nRotMaxCol
399 
400  for (nArrRow=0; nArrRow<nArrCount; nArrRow++)
401  if (pRowInfo[nArrRow].nRotMaxCol != SC_ROTMAX_NONE && pRowInfo[nArrRow].nRotMaxCol > nRotMax)
402  nRotMax = pRowInfo[nArrRow].nRotMaxCol;
403  }
404 
405  // Allocate cell information only after the test rotation
406  // to nRotMax due to nRotateDir Flag
407  initCellInfo(pRowInfo, nArrCount, nRotMax, pDefShadow);
408 
409  initColWidths(pRowInfo, this, fColScale, nTab, nCol2, nRotMax);
410 
411  ScConditionalFormatList* pCondFormList = GetCondFormList(nTab);
412  if (pCondFormList)
413  pCondFormList->startRendering();
414 
415  for (SCCOL nArrCol=0; nArrCol<=nCol2+2; nArrCol++) // left & right + 1
416  {
417  SCCOL nX = (nArrCol>0) ? nArrCol-1 : MAXCOL+1; // negative -> invalid
418 
419  if (ValidCol(nX))
420  {
421  // #i58049#, #i57939# Hidden columns must be skipped here, or their attributes
422  // will disturb the output
423 
424  // TODO: Optimize this loop.
425  if (!ColHidden(nX, nTab))
426  {
427  sal_uInt16 nThisWidth = static_cast<sal_uInt16>(std::clamp(GetColWidth( nX, nTab ) * fColScale, 1.0, double(std::numeric_limits<sal_uInt16>::max())));
428 
429  pRowInfo[0].pCellInfo[nArrCol].nWidth = nThisWidth; //TODO: this should be enough
430 
431  const ScAttrArray* pThisAttrArr; // Attribute
432  if (nX < maTabs[nTab]->GetAllocatedColumnsCount())
433  {
434  ScColumn* pThisCol = &maTabs[nTab]->aCol[nX]; // Column data
435 
436  nArrRow = 1;
437  // Iterate between rows nY1 and nY2 and pick up non-empty
438  // cells that are not hidden.
439  RowInfoFiller aFunc(*this, nTab, pRowInfo, nArrCol, nArrRow);
440  sc::ParseAllNonEmpty(pThisCol->maCells.begin(), pThisCol->maCells, nRow1, nRow2,
441  aFunc);
442 
443  pThisAttrArr = pThisCol->pAttrArray.get();
444  }
445  else
446  pThisAttrArr = &maTabs[nTab]->aDefaultColAttrArray;
447 
448  if (nX+1 >= nCol1) // Attribute/Blockmark from nX1-1
449  {
450  nArrRow = 0;
451 
452  SCROW nCurRow=nRow1; // single rows
453  if (nCurRow>0)
454  --nCurRow; // 1 more on top
455  else
456  nArrRow = 1;
457 
458  SCROW nThisRow;
459  SCSIZE nIndex;
460  if ( pThisAttrArr->Count() )
461  (void) pThisAttrArr->Search( nCurRow, nIndex );
462  else
463  nIndex = 0;
464 
465  do
466  {
467  const ScPatternAttr* pPattern = nullptr;
468  if ( pThisAttrArr->Count() )
469  {
470  nThisRow = pThisAttrArr->mvData[nIndex].nEndRow; // End of range
471  pPattern = pThisAttrArr->mvData[nIndex].pPattern;
472  }
473  else
474  {
475  nThisRow = MAXROW;
476  pPattern = GetDefPattern();
477  }
478 
479  const SvxBrushItem* pBackground = &pPattern->GetItem(ATTR_BACKGROUND);
480  const SvxBoxItem* pLinesAttr = &pPattern->GetItem(ATTR_BORDER);
481 
482  const SvxLineItem* pTLBRLine = &pPattern->GetItem( ATTR_BORDER_TLBR );
483  const SvxLineItem* pBLTRLine = &pPattern->GetItem( ATTR_BORDER_BLTR );
484 
485  const SvxShadowItem* pShadowAttr = &pPattern->GetItem(ATTR_SHADOW);
486  if (pShadowAttr != pDefShadow)
487  bAnyShadow = true;
488 
489  const ScMergeAttr* pMergeAttr = &pPattern->GetItem(ATTR_MERGE);
490  bool bMerged = ( pMergeAttr != pDefMerge && *pMergeAttr != *pDefMerge );
491  ScMF nOverlap = pPattern->GetItemSet().
492  Get(ATTR_MERGE_FLAG).GetValue();
493  bool bHOverlapped(nOverlap & ScMF::Hor);
494  bool bVOverlapped(nOverlap & ScMF::Ver);
495  bool bAutoFilter(nOverlap & ScMF::Auto);
496  bool bPivotButton(nOverlap & ScMF::Button);
497  bool bScenario(nOverlap & ScMF::Scenario);
498  bool bPivotPopupButton(nOverlap & ScMF::ButtonPopup);
499  bool bFilterActive(nOverlap & ScMF::HiddenMember);
500  if (bMerged||bHOverlapped||bVOverlapped)
501  bAnyMerged = true; // internal
502 
503  bool bHidden, bHideFormula;
504  if (bTabProtect)
505  {
506  const ScProtectionAttr& rProtAttr = pPattern->GetItem(ATTR_PROTECTION);
507  bHidden = rProtAttr.GetHideCell();
508  bHideFormula = rProtAttr.GetHideFormula();
509  }
510  else
511  bHidden = bHideFormula = false;
512 
513  const ScCondFormatIndexes& rCondFormats = pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData();
514  bool bContainsCondFormat = !rCondFormats.empty();
515 
516  do
517  {
518  SCROW nLastHiddenRow = -1;
519  bool bRowHidden = RowHidden(nCurRow, nTab, nullptr, &nLastHiddenRow);
520  if ( nArrRow==0 || !bRowHidden )
521  {
522  if ( GetPreviewCellStyle( nX, nCurRow, nTab ) != nullptr )
523  bAnyPreview = true;
524  RowInfo* pThisRowInfo = &pRowInfo[nArrRow];
525  if (pBackground != pDefBackground) // Column background == Default ?
526  pThisRowInfo->bEmptyBack = false;
527  if (bContainsCondFormat)
528  pThisRowInfo->bEmptyBack = false;
529  if (bAutoFilter)
530  pThisRowInfo->bAutoFilter = true;
531  if (bPivotButton || bPivotPopupButton)
532  pThisRowInfo->bPivotButton = true;
533 
534  CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrCol];
535  pInfo->pBackground = pBackground;
536  pInfo->pPatternAttr = pPattern;
537  pInfo->bMerged = bMerged;
538  pInfo->bHOverlapped = bHOverlapped;
539  pInfo->bVOverlapped = bVOverlapped;
540  pInfo->bAutoFilter = bAutoFilter;
541  pInfo->bPivotButton = bPivotButton;
542  pInfo->bPivotPopupButton = bPivotPopupButton;
543  pInfo->bFilterActive = bFilterActive;
544  pInfo->pLinesAttr = pLinesAttr;
545  pInfo->mpTLBRLine = pTLBRLine;
546  pInfo->mpBLTRLine = pBLTRLine;
547  pInfo->pShadowAttr = pShadowAttr;
548  // nWidth is no longer set individually
549 
550  if (bScenario)
551  {
553  pThisRowInfo->bEmptyBack = false;
554  }
555 
556  if (bContainsCondFormat && pCondFormList)
557  {
558  bAnyCondition |= handleConditionalFormat(*pCondFormList, rCondFormats, pInfo, pStlPool, ScAddress(nX, nCurRow, nTab),
559  bHidden, bHideFormula, bTabProtect);
560  }
561 
562  if (bHidden || (bFormulaMode && bHideFormula && pInfo->maCell.meType == CELLTYPE_FORMULA))
563  pInfo->bEmptyCellText = true;
564 
565  ++nArrRow;
566  }
567  else if (nLastHiddenRow >= 0)
568  {
569  nCurRow = nLastHiddenRow;
570  if (nCurRow > nThisRow)
571  nCurRow = nThisRow;
572  }
573  ++nCurRow;
574  }
575  while (nCurRow <= nThisRow && nCurRow <= nYExtra);
576  ++nIndex;
577  }
578  while ( nIndex < pThisAttrArr->Count() && nThisRow < nYExtra );
579 
580  if (pMarkData && pMarkData->IsMultiMarked())
581  {
582  // Block marks
583  ScMarkArray aThisMarkArr(pMarkData->GetMarkArray( nX ));
584  nArrRow = 1;
585  nCurRow = nRow1; // single rows
586 
587  if ( aThisMarkArr.Search( nRow1, nIndex ) )
588  {
589  do
590  {
591  nThisRow=aThisMarkArr.mvData[nIndex].nRow; // End of range
592 
593  do
594  {
595  if ( !RowHidden( nCurRow,nTab ) )
596  {
597  ++nArrRow;
598  }
599  ++nCurRow;
600  }
601  while (nCurRow <= nThisRow && nCurRow <= nRow2);
602  ++nIndex;
603  }
604  while ( nIndex < aThisMarkArr.mvData.size() && nThisRow < nRow2 );
605  }
606  }
607  }
608  else // columns in front
609  {
610  for (nArrRow=1; nArrRow+1<nArrCount; nArrRow++)
611  {
612  RowInfo* pThisRowInfo = &pRowInfo[nArrRow];
613  CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrCol];
614 
615  pInfo->nWidth = nThisWidth; //TODO: or check only 0 ??
616  }
617  }
618  }
619  }
620  else
621  pRowInfo[0].pCellInfo[nArrCol].nWidth = STD_COL_WIDTH;
622  // STD_COL_WIDTH farthest to the left and right is needed for DrawExtraShadow
623  }
624 
625  if (pCondFormList)
626  pCondFormList->endRendering();
627 
628  // evaluate conditional formatting
629  std::vector< std::unique_ptr<ScPatternAttr> > aAltPatterns;
630  // favour preview over condition
631  if (bAnyCondition || bAnyPreview)
632  {
633  for (nArrRow=0; nArrRow<nArrCount; nArrRow++)
634  {
635  for (SCCOL nArrCol=nCol1; nArrCol<=nCol2+2; nArrCol++) // 1 more left and right
636  {
637  CellInfo* pInfo = &pRowInfo[nArrRow].pCellInfo[nArrCol];
638  SCCOL nCol = (nArrCol>0) ? nArrCol-1 : MAXCOL+1;
639  ScPatternAttr* pModifiedPatt = nullptr;
640 
641  if ( ValidCol(nCol) && pRowInfo[nArrRow].nRowNo <= MAXROW )
642  {
643  if ( ScStyleSheet* pPreviewStyle = GetPreviewCellStyle( nCol, pRowInfo[nArrRow].nRowNo, nTab ) )
644  {
645  aAltPatterns.push_back( std::make_unique<ScPatternAttr>( *pInfo->pPatternAttr ) );
646  pModifiedPatt = aAltPatterns.back().get();
647  pModifiedPatt->SetStyleSheet( pPreviewStyle );
648  }
649  }
650  // favour preview over condition
651  const SfxItemSet* pCondSet = pModifiedPatt ? &pModifiedPatt->GetItemSet() : pInfo->pConditionSet;
652 
653  if (pCondSet)
654  {
655  const SfxPoolItem* pItem;
656 
657  // Background
658  if ( pCondSet->GetItemState( ATTR_BACKGROUND, true, &pItem ) == SfxItemState::SET )
659  {
660  pInfo->pBackground = static_cast<const SvxBrushItem*>(pItem);
661  pRowInfo[nArrRow].bEmptyBack = false;
662  }
663 
664  // Border
665  if ( pCondSet->GetItemState( ATTR_BORDER, true, &pItem ) == SfxItemState::SET )
666  pInfo->pLinesAttr = static_cast<const SvxBoxItem*>(pItem);
667 
668  if ( pCondSet->GetItemState( ATTR_BORDER_TLBR, true, &pItem ) == SfxItemState::SET )
669  pInfo->mpTLBRLine = static_cast< const SvxLineItem* >( pItem );
670  if ( pCondSet->GetItemState( ATTR_BORDER_BLTR, true, &pItem ) == SfxItemState::SET )
671  pInfo->mpBLTRLine = static_cast< const SvxLineItem* >( pItem );
672 
673  // Shadow
674  if ( pCondSet->GetItemState( ATTR_SHADOW, true, &pItem ) == SfxItemState::SET )
675  {
676  pInfo->pShadowAttr = static_cast<const SvxShadowItem*>(pItem);
677  bAnyShadow = true;
678  }
679  }
680  if( bAnyCondition && pInfo->mxColorScale)
681  {
682  pRowInfo[nArrRow].bEmptyBack = false;
683  pInfo->pBackground = &pPool->Put(SvxBrushItem(*pInfo->mxColorScale, ATTR_BACKGROUND));
684  }
685  }
686  }
687  }
688 
689  // End conditional formatting
690 
691  // Adjust data from merged cells
692 
693  if (bAnyMerged)
694  {
695  for (nArrRow=0; nArrRow<nArrCount; nArrRow++)
696  {
697  RowInfo* pThisRowInfo = &pRowInfo[nArrRow];
698  SCROW nSignedY = nArrRow ? pThisRowInfo->nRowNo : nRow1-1;
699 
700  for (SCCOL nArrCol=nCol1; nArrCol<=nCol2+2; nArrCol++) // 1 more left and right
701  {
702  SCCOL nSignedX = nArrCol - 1;
703  CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrCol];
704 
705  if (pInfo->bMerged || pInfo->bHOverlapped || pInfo->bVOverlapped)
706  {
707  SCCOL nStartX;
708  SCROW nStartY;
709  SCCOL nEndX;
710  SCROW nEndY;
711  lcl_GetMergeRange( nSignedX,nSignedY, nArrRow, this,pRowInfo, nCol1,nRow1,nTab,
712  nStartX,nStartY, nEndX,nEndY );
713  const ScPatternAttr* pStartPattern = GetPattern( nStartX,nStartY,nTab );
714  const SfxItemSet* pStartCond = GetCondResult( nStartX,nStartY,nTab );
715  const SfxPoolItem* pItem;
716 
717  // Copy Background (or in output.cxx)
718 
719  if ( !pStartCond || pStartCond->
720  GetItemState(ATTR_BACKGROUND,true,&pItem) != SfxItemState::SET )
721  pItem = &pStartPattern->GetItem(ATTR_BACKGROUND);
722  pInfo->pBackground = static_cast<const SvxBrushItem*>(pItem);
723  pRowInfo[nArrRow].bEmptyBack = false;
724 
725  // Shadow
726 
727  if ( !pStartCond || pStartCond->
728  GetItemState(ATTR_SHADOW,true,&pItem) != SfxItemState::SET )
729  pItem = &pStartPattern->GetItem(ATTR_SHADOW);
730  pInfo->pShadowAttr = static_cast<const SvxShadowItem*>(pItem);
731  if (pInfo->pShadowAttr != pDefShadow)
732  bAnyShadow = true;
733  }
734  }
735  }
736  }
737 
738  if (bAnyShadow) // distribute Shadow
739  {
740  for (nArrRow=0; nArrRow<nArrCount; nArrRow++)
741  {
742  bool bTop = ( nArrRow == 0 );
743  bool bBottom = ( nArrRow+1 == nArrCount );
744 
745  for (SCCOL nArrCol=nCol1; nArrCol<=nCol2+2; nArrCol++) // 1 more left and right
746  {
747  bool bLeft = ( nArrCol == nCol1 );
748  bool bRight = ( nArrCol == nCol2+2 );
749 
750  CellInfo* pInfo = &pRowInfo[nArrRow].pCellInfo[nArrCol];
751  const SvxShadowItem* pThisAttr = pInfo->pShadowAttr;
752  SvxShadowLocation eLoc = pThisAttr ? pThisAttr->GetLocation() : SvxShadowLocation::NONE;
753  if (eLoc != SvxShadowLocation::NONE)
754  {
755  // or test on != eLoc
756 
757  SCCOL nDxPos = 1;
758  SCCOL nDxNeg = -1;
759 
760  while ( nArrCol+nDxPos < nCol2+2 && pRowInfo[0].pCellInfo[nArrCol+nDxPos].nWidth == 0 )
761  ++nDxPos;
762  while ( nArrCol+nDxNeg > nCol1 && pRowInfo[0].pCellInfo[nArrCol+nDxNeg].nWidth == 0 )
763  --nDxNeg;
764 
765  bool bLeftDiff = !bLeft &&
766  pRowInfo[nArrRow].pCellInfo[nArrCol+nDxNeg].pShadowAttr->GetLocation() == SvxShadowLocation::NONE;
767  bool bRightDiff = !bRight &&
768  pRowInfo[nArrRow].pCellInfo[nArrCol+nDxPos].pShadowAttr->GetLocation() == SvxShadowLocation::NONE;
769  bool bTopDiff = !bTop &&
770  pRowInfo[nArrRow-1].pCellInfo[nArrCol].pShadowAttr->GetLocation() == SvxShadowLocation::NONE;
771  bool bBottomDiff = !bBottom &&
772  pRowInfo[nArrRow+1].pCellInfo[nArrCol].pShadowAttr->GetLocation() == SvxShadowLocation::NONE;
773 
774  if ( bLayoutRTL )
775  {
776  switch (eLoc)
777  {
778  case SvxShadowLocation::BottomRight: eLoc = SvxShadowLocation::BottomLeft; break;
779  case SvxShadowLocation::BottomLeft: eLoc = SvxShadowLocation::BottomRight; break;
780  case SvxShadowLocation::TopRight: eLoc = SvxShadowLocation::TopLeft; break;
781  case SvxShadowLocation::TopLeft: eLoc = SvxShadowLocation::TopRight; break;
782  default:
783  {
784  // added to avoid warnings
785  }
786  }
787  }
788 
789  switch (eLoc)
790  {
791  case SvxShadowLocation::BottomRight:
792  if (bBottomDiff)
793  {
794  pRowInfo[nArrRow+1].pCellInfo[nArrCol].pHShadowOrigin = pThisAttr;
795  pRowInfo[nArrRow+1].pCellInfo[nArrCol].eHShadowPart =
796  bLeftDiff ? SC_SHADOW_HSTART : SC_SHADOW_HORIZ;
797  }
798  if (bRightDiff)
799  {
800  pRowInfo[nArrRow].pCellInfo[nArrCol+1].pVShadowOrigin = pThisAttr;
801  pRowInfo[nArrRow].pCellInfo[nArrCol+1].eVShadowPart =
802  bTopDiff ? SC_SHADOW_VSTART : SC_SHADOW_VERT;
803  }
804  if (bBottomDiff && bRightDiff)
805  {
806  pRowInfo[nArrRow+1].pCellInfo[nArrCol+1].pHShadowOrigin = pThisAttr;
807  pRowInfo[nArrRow+1].pCellInfo[nArrCol+1].eHShadowPart = SC_SHADOW_CORNER;
808  }
809  break;
810 
811  case SvxShadowLocation::BottomLeft:
812  if (bBottomDiff)
813  {
814  pRowInfo[nArrRow+1].pCellInfo[nArrCol].pHShadowOrigin = pThisAttr;
815  pRowInfo[nArrRow+1].pCellInfo[nArrCol].eHShadowPart =
816  bRightDiff ? SC_SHADOW_HSTART : SC_SHADOW_HORIZ;
817  }
818  if (bLeftDiff)
819  {
820  pRowInfo[nArrRow].pCellInfo[nArrCol-1].pVShadowOrigin = pThisAttr;
821  pRowInfo[nArrRow].pCellInfo[nArrCol-1].eVShadowPart =
822  bTopDiff ? SC_SHADOW_VSTART : SC_SHADOW_VERT;
823  }
824  if (bBottomDiff && bLeftDiff)
825  {
826  pRowInfo[nArrRow+1].pCellInfo[nArrCol-1].pHShadowOrigin = pThisAttr;
827  pRowInfo[nArrRow+1].pCellInfo[nArrCol-1].eHShadowPart = SC_SHADOW_CORNER;
828  }
829  break;
830 
831  case SvxShadowLocation::TopRight:
832  if (bTopDiff)
833  {
834  pRowInfo[nArrRow-1].pCellInfo[nArrCol].pHShadowOrigin = pThisAttr;
835  pRowInfo[nArrRow-1].pCellInfo[nArrCol].eHShadowPart =
836  bLeftDiff ? SC_SHADOW_HSTART : SC_SHADOW_HORIZ;
837  }
838  if (bRightDiff)
839  {
840  pRowInfo[nArrRow].pCellInfo[nArrCol+1].pVShadowOrigin = pThisAttr;
841  pRowInfo[nArrRow].pCellInfo[nArrCol+1].eVShadowPart =
842  bBottomDiff ? SC_SHADOW_VSTART : SC_SHADOW_VERT;
843  }
844  if (bTopDiff && bRightDiff)
845  {
846  pRowInfo[nArrRow-1].pCellInfo[nArrCol+1].pHShadowOrigin = pThisAttr;
847  pRowInfo[nArrRow-1].pCellInfo[nArrCol+1].eHShadowPart = SC_SHADOW_CORNER;
848  }
849  break;
850 
851  case SvxShadowLocation::TopLeft:
852  if (bTopDiff)
853  {
854  pRowInfo[nArrRow-1].pCellInfo[nArrCol].pHShadowOrigin = pThisAttr;
855  pRowInfo[nArrRow-1].pCellInfo[nArrCol].eHShadowPart =
856  bRightDiff ? SC_SHADOW_HSTART : SC_SHADOW_HORIZ;
857  }
858  if (bLeftDiff)
859  {
860  pRowInfo[nArrRow].pCellInfo[nArrCol-1].pVShadowOrigin = pThisAttr;
861  pRowInfo[nArrRow].pCellInfo[nArrCol-1].eVShadowPart =
862  bBottomDiff ? SC_SHADOW_VSTART : SC_SHADOW_VERT;
863  }
864  if (bTopDiff && bLeftDiff)
865  {
866  pRowInfo[nArrRow-1].pCellInfo[nArrCol-1].pHShadowOrigin = pThisAttr;
867  pRowInfo[nArrRow-1].pCellInfo[nArrCol-1].eHShadowPart = SC_SHADOW_CORNER;
868  }
869  break;
870 
871  default:
872  OSL_FAIL("wrong Shadow-Enum");
873  }
874  }
875  }
876  }
877  }
878 
879  rTabInfo.mnArrCount = sal::static_int_cast<sal_uInt16>(nArrCount);
880  rTabInfo.mbPageMode = bPageMode;
881 
882  // *** create the frame border array ***
883 
884  // RowInfo structs are filled in the range [ 0 , nArrCount-1 ]
885  // each RowInfo contains CellInfo structs in the range [ nX1-1 , nX2+1 ]
886 
887  size_t nColCount = nCol2 - nCol1 + 3;
888  size_t nRowCount = nArrCount;
889 
890  svx::frame::Array& rArray = rTabInfo.maArray;
891  rArray.Initialize( nColCount, nRowCount );
892 
893  for( size_t nRow = 0; nRow < nRowCount; ++nRow )
894  {
895  sal_uInt16 nCellInfoY = static_cast< sal_uInt16 >( nRow );
896  RowInfo& rThisRowInfo = pRowInfo[ nCellInfoY ];
897 
898  for( size_t nCol = 0; nCol < nColCount; ++nCol )
899  {
900  sal_uInt16 nCellInfoX = static_cast< sal_uInt16 >( nCol + nCol1 );
901  const CellInfo& rInfo = rThisRowInfo.pCellInfo[ nCellInfoX ];
902 
903  const SvxBoxItem* pBox = rInfo.pLinesAttr;
904  const SvxLineItem* pTLBR = rInfo.mpTLBRLine;
905  const SvxLineItem* pBLTR = rInfo.mpBLTRLine;
906 
907  size_t nFirstCol = nCol;
908  size_t nFirstRow = nRow;
909 
910  // *** merged cells *** -------------------------------------------
911 
912  if( !rArray.IsMerged( nCol, nRow ) && (rInfo.bMerged || rInfo.bHOverlapped || rInfo.bVOverlapped) )
913  {
914  // *** insert merged range in svx::frame::Array ***
915 
916  /* #i69369# top-left cell of a merged range may be located in
917  a hidden column or row. Use lcl_GetMergeRange() to find the
918  complete merged range, then calculate dimensions and
919  document position of the visible range. */
920 
921  // note: document columns are always one less than CellInfoX coords
922  // note: document rows must be looked up in RowInfo structs
923 
924  // current column and row in document coordinates
925  SCCOL nCurrDocCol = static_cast< SCCOL >( nCellInfoX - 1 );
926  SCROW nCurrDocRow = static_cast< SCROW >( (nCellInfoY > 0) ? rThisRowInfo.nRowNo : (nRow1 - 1) );
927 
928  // find entire merged range in document, returns signed document coordinates
929  SCCOL nFirstRealDocColS, nLastRealDocColS;
930  SCROW nFirstRealDocRowS, nLastRealDocRowS;
931  lcl_GetMergeRange( nCurrDocCol, nCurrDocRow,
932  nCellInfoY, this, pRowInfo, nCol1,nRow1,nTab,
933  nFirstRealDocColS, nFirstRealDocRowS, nLastRealDocColS, nLastRealDocRowS );
934 
935  // *complete* merged range in document coordinates
936  SCCOL nFirstRealDocCol = nFirstRealDocColS;
937  SCROW nFirstRealDocRow = nFirstRealDocRowS;
938  SCCOL nLastRealDocCol = nLastRealDocColS;
939  SCROW nLastRealDocRow = nLastRealDocRowS;
940 
941  // first visible column (nX1-1 is first processed document column)
942  SCCOL nFirstDocCol = (nCol1 > 0) ? ::std::max< SCCOL >( nFirstRealDocCol, nCol1 - 1 ) : nFirstRealDocCol;
943  sal_uInt16 nFirstCellInfoX = static_cast< sal_uInt16 >( nFirstDocCol + 1 );
944  nFirstCol = static_cast< size_t >( nFirstCellInfoX - nCol1 );
945 
946  // last visible column (nX2+1 is last processed document column)
947  SCCOL nLastDocCol = (nCol2 < MAXCOL) ? ::std::min< SCCOL >( nLastRealDocCol, nCol2 + 1 ) : nLastRealDocCol;
948  sal_uInt16 nLastCellInfoX = static_cast< sal_uInt16 >( nLastDocCol + 1 );
949  size_t nLastCol = static_cast< size_t >( nLastCellInfoX - nCol1 );
950 
951  // first visible row
952  sal_uInt16 nFirstCellInfoY = nCellInfoY;
953  while( ((nFirstCellInfoY > 1) && (pRowInfo[ nFirstCellInfoY - 1 ].nRowNo >= nFirstRealDocRow)) ||
954  ((nFirstCellInfoY == 1) && (static_cast< SCROW >( nRow1 - 1 ) >= nFirstRealDocRow)) )
955  --nFirstCellInfoY;
956  SCROW nFirstDocRow = (nFirstCellInfoY > 0) ? pRowInfo[ nFirstCellInfoY ].nRowNo : static_cast< SCROW >( nRow1 - 1 );
957  nFirstRow = static_cast< size_t >( nFirstCellInfoY );
958 
959  // last visible row
960  sal_uInt16 nLastCellInfoY = nCellInfoY;
961  while( (sal::static_int_cast<SCSIZE>(nLastCellInfoY + 1) < nArrCount) &&
962  (pRowInfo[ nLastCellInfoY + 1 ].nRowNo <= nLastRealDocRow) )
963  ++nLastCellInfoY;
964  SCROW nLastDocRow = (nLastCellInfoY > 0) ? pRowInfo[ nLastCellInfoY ].nRowNo : static_cast< SCROW >( nRow1 - 1 );
965  size_t nLastRow = static_cast< size_t >( nLastCellInfoY );
966 
967  // insert merged range
968  rArray.SetMergedRange( nFirstCol, nFirstRow, nLastCol, nLastRow );
969 
970  // *** find additional size not included in svx::frame::Array ***
971 
972  // additional space before first column
973  if( nFirstCol == 0 )
974  {
975  tools::Long nSize = 0;
976  for( SCCOL nDocCol = nFirstRealDocCol; nDocCol < nFirstDocCol; ++nDocCol )
977  nSize += std::max( tools::Long(GetColWidth( nDocCol, nTab ) * fColScale), tools::Long(1) );
978  rArray.SetAddMergedLeftSize( nCol, nRow, nSize );
979  }
980  // additional space after last column
981  if( nLastCol + 1 == nColCount )
982  {
983  tools::Long nSize = 0;
984  for( SCCOL nDocCol = nLastDocCol + 1; nDocCol <= nLastRealDocCol; ++nDocCol )
985  nSize += std::max( tools::Long(GetColWidth( nDocCol, nTab ) * fColScale), tools::Long(1) );
986  rArray.SetAddMergedRightSize( nCol, nRow, nSize );
987  }
988  // additional space above first row
989  if( nFirstRow == 0 )
990  {
991  tools::Long nSize = 0;
992  for( SCROW nDocRow = nFirstRealDocRow; nDocRow < nFirstDocRow; ++nDocRow )
993  nSize += std::max( tools::Long(GetRowHeight( nDocRow, nTab ) * fRowScale), tools::Long(1) );
994  rArray.SetAddMergedTopSize( nCol, nRow, nSize );
995  }
996  // additional space beyond last row
997  if( nLastRow + 1 == nRowCount )
998  {
999  tools::Long nSize = 0;
1000  for( SCROW nDocRow = nLastDocRow + 1; nDocRow <= nLastRealDocRow; ++nDocRow )
1001  nSize += std::max( tools::Long(GetRowHeight( nDocRow, nTab ) * fRowScale), tools::Long(1) );
1002  rArray.SetAddMergedBottomSize( nCol, nRow, nSize );
1003  }
1004 
1005  // *** use line attributes from real origin cell ***
1006 
1007  if( (nFirstRealDocCol != nCurrDocCol) || (nFirstRealDocRow != nCurrDocRow) )
1008  {
1009  if( const ScPatternAttr* pPattern = GetPattern( nFirstRealDocCol, nFirstRealDocRow, nTab ) )
1010  {
1011  const SfxItemSet* pCond = GetCondResult( nFirstRealDocCol, nFirstRealDocRow, nTab );
1012  pBox = &pPattern->GetItem( ATTR_BORDER, pCond );
1013  pTLBR = &pPattern->GetItem( ATTR_BORDER_TLBR, pCond );
1014  pBLTR = &pPattern->GetItem( ATTR_BORDER_BLTR, pCond );
1015  }
1016  else
1017  {
1018  pBox = nullptr;
1019  pTLBR = pBLTR = nullptr;
1020  }
1021  }
1022  }
1023 
1024  // *** borders *** ------------------------------------------------
1025 
1026  if( pBox )
1027  {
1028  rArray.SetCellStyleLeft( nFirstCol, nFirstRow, svx::frame::Style( pBox->GetLeft(), fColScale ) );
1029  rArray.SetCellStyleRight( nFirstCol, nFirstRow, svx::frame::Style( pBox->GetRight(), fColScale ) );
1030  rArray.SetCellStyleTop( nFirstCol, nFirstRow, svx::frame::Style( pBox->GetTop(), fRowScale ) );
1031  rArray.SetCellStyleBottom( nFirstCol, nFirstRow, svx::frame::Style( pBox->GetBottom(), fRowScale ) );
1032  }
1033 
1034  if( pTLBR )
1035  rArray.SetCellStyleTLBR( nFirstCol, nFirstRow, svx::frame::Style( pTLBR->GetLine(), fRowScale ) );
1036  if( pBLTR )
1037  rArray.SetCellStyleBLTR( nFirstCol, nFirstRow, svx::frame::Style( pBLTR->GetLine(), fRowScale ) );
1038  }
1039  }
1040 
1041  /* Mirror the entire frame array. */
1042  if( bLayoutRTL )
1043  rArray.MirrorSelfX();
1044 }
1045 
1047  : mpRowInfo(new RowInfo[capacity])
1048  , mnArrCount(0)
1049  , mnArrCapacity(capacity)
1050  , mbPageMode(false)
1051 {
1052  memset(static_cast<void*>(mpRowInfo.get()), 0, mnArrCapacity * sizeof(RowInfo));
1053 }
1054 
1056 {
1057  for( SCSIZE nIdx = 0; nIdx < mnArrCapacity; ++nIdx )
1058  delete [] mpRowInfo[ nIdx ].pCellInfo;
1059 }
1060 
1061 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< RowInfo[]> mpRowInfo
Definition: fillinfo.hxx:194
void FillInfo(ScTableInfo &rTabInfo, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, double fColScale, double fRowScale, bool bPageMode, bool bFormulaMode, const ScMarkData *pMarkData=nullptr)
Definition: fillinfo.cxx:347
SCCOL GetColMerge() const
Definition: attrib.hxx:68
const SCCOL SC_ROTMAX_NONE
Definition: fillinfo.hxx:170
bool mbPageMode
Definition: fillinfo.hxx:197
sal_Int32 nIndex
void SetCellStyleTLBR(size_t nCol, size_t nRow, const Style &rStyle)
const SvxLineItem * mpTLBRLine
original item from document.
Definition: fillinfo.hxx:143
std::vector< ScMarkEntry > mvData
Definition: markarr.hxx:46
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
Definition: documen3.cxx:1906
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:42
std::unique_ptr< ScAttrArray > pAttrArray
Definition: column.hxx:130
bool bPivotButton
Definition: fillinfo.hxx:162
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
bool bHOverlapped
Definition: fillinfo.hxx:159
const SfxPoolItem * GetItem(const SwTextAttr &rAttr, sal_uInt16 nWhich)
long Long
SCSIZE mnArrCount
Definition: fillinfo.hxx:195
std::optional< Color > mxColorScale
Definition: conditio.hxx:218
const SfxItemSet & GetItemSet() const
CellStoreType::const_iterator ParseAllNonEmpty(const typename CellStoreType::const_iterator &itPos, const CellStoreType &rCells, SCROW nRow1, SCROW nRow2, Func &rFunc)
Definition: mtvcellfunc.hxx:95
static SvxBrushItem * GetButtonBrushItem()
Definition: global.cxx:425
virtual SfxItemSet & GetItemSet()
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:103
constexpr TypedWhichId< ScProtectionAttr > ATTR_PROTECTION(149)
const editeng::SvxBorderLine * GetRight() const
ScConditionalFormat * GetFormat(sal_uInt32 nKey)
Definition: conditio.cxx:2069
void SetCellStyleTop(size_t nCol, size_t nRow, const Style &rStyle)
void SetCellStyleBottom(size_t nCol, size_t nRow, const Style &rStyle)
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
Definition: document.cxx:5205
SCROW nRowNo
Definition: fillinfo.hxx:181
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4192
const SvxBoxItem * pLinesAttr
Definition: fillinfo.hxx:142
constexpr TypedWhichId< ScRotateValueItem > ATTR_ROTATE_VALUE(135)
sal_uInt32 GetItemCount2(sal_uInt16 nWhich) const
SC_DLLPUBLIC ScConditionalFormatList * GetCondFormList(SCTAB nTab) const
Definition: documen4.cxx:858
#define STD_COL_WIDTH
Definition: global.hxx:94
SvxShadowLocation GetLocation() const
std::unique_ptr< const ScDataBarInfo > pDataBar
Definition: fillinfo.hxx:137
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
constexpr TypedWhichId< SvxShadowItem > ATTR_SHADOW(152)
This is a rather odd datastructure.
Definition: markarr.hxx:43
bool IsMultiMarked() const
Definition: markdata.hxx:82
const SvxShadowItem * pShadowAttr
original item from document.
Definition: fillinfo.hxx:146
TableContainer maTabs
Definition: document.hxx:374
const SCROW MAXROW
Definition: address.hxx:68
sc::CellStoreType maCells
Definition: column.hxx:128
ScTableInfo(const SCSIZE capacity=1024)
Definition: fillinfo.cxx:1046
sal_uInt16 nHeight
Definition: fillinfo.hxx:180
bool Search(SCROW nRow, SCSIZE &nIndex) const
Definition: attarray.cxx:194
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:4766
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4745
SC_DLLPUBLIC SCCOL GetAllocatedColumnsCount(SCTAB nTab) const
Definition: documen3.cxx:2145
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
Definition: patattr.hxx:70
ScStyleSheet * GetPreviewCellStyle()
Definition: document.hxx:1343
constexpr OUStringLiteral aData
void SetCellStyleLeft(size_t nCol, size_t nRow, const Style &rStyle)
bool bAutoFilter
Definition: fillinfo.hxx:161
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_TLBR(141)
std::vector< ScAttrEntry > mvData
Definition: attarray.hxx:92
bool GetHideCell() const
Definition: attrib.hxx:147
static SC_DLLPUBLIC sal_uInt16 nStdRowHeight
Definition: global.hxx:583
void SetAddMergedTopSize(size_t nCol, size_t nRow, tools::Long nAddSize)
const editeng::SvxBorderLine * GetTop() const
std::unique_ptr< const ScIconSetInfo > pIconSet
Definition: fillinfo.hxx:138
dp button with popup arrow
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: document.cxx:4476
SCCOL nRotMaxCol
Definition: fillinfo.hxx:182
const ScPatternAttr * pPatternAttr
Definition: fillinfo.hxx:134
const editeng::SvxBorderLine * GetLeft() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
std::unique_ptr< ScIconSetInfo > pIconSet
Definition: conditio.hxx:220
bool bChanged
Definition: fillinfo.hxx:187
bool bFilterActive
Definition: fillinfo.hxx:164
sal_Int16 SCCOL
Definition: types.hxx:21
bool ValidCol(SCCOL nCol) const
Definition: document.hxx:873
svx::frame::Array maArray
Definition: fillinfo.hxx:192
Count
bool GetHideFormula() const
Definition: attrib.hxx:145
const SCCOL MAXCOL
Definition: address.hxx:69
autofilter arrow
ScMarkArray GetMarkArray(SCCOL nCol) const
Definition: markdata.cxx:942
bool bEmptyBack
Definition: fillinfo.hxx:184
void Initialize(size_t nWidth, size_t nHeight)
bool bVOverlapped
Definition: fillinfo.hxx:160
bool IsMerged(size_t nCol, size_t nRow) const
bool empty() const
ScRefCellValue maCell
Definition: fillinfo.hxx:132
SC_DLLPUBLIC const SfxItemSet * GetCondResult(SCCOL nCol, SCROW nRow, SCTAB nTab, ScRefCellValue *pCell=nullptr) const
Definition: documen4.cxx:789
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SCSIZE Count() const
Definition: attarray.hxx:218
void SetCellStyleBLTR(size_t nCol, size_t nRow, const Style &rStyle)
const SvxBrushItem * pBackground
Definition: fillinfo.hxx:140
void SetStyleSheet(ScStyleSheet *pNewStyle, bool bClearDirectFormat=true)
Definition: patattr.cxx:1168
const SvxShadowItem * pVShadowOrigin
Definition: fillinfo.hxx:149
static void lcl_GetMergeRange(SCCOL nX, SCROW nY, SCSIZE nArrY, const ScDocument *pDoc, RowInfo *pRowInfo, SCCOL nX1, SCROW nY1, SCTAB nTab, SCCOL &rStartX, SCROW &rStartY, SCCOL &rEndX, SCROW &rEndY)
Definition: fillinfo.cxx:51
bool bPivotButton
Definition: fillinfo.hxx:186
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
SCSIZE mnArrCapacity
Definition: fillinfo.hxx:196
ScShadowPart eHShadowPart
Definition: fillinfo.hxx:151
CellType meType
Definition: cellvalue.hxx:105
void FindMaxRotCol(SCTAB nTab, RowInfo *pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2) const
Definition: document.cxx:5262
ScCondFormatData GetData(ScRefCellValue &rCell, const ScAddress &rPos) const
Definition: conditio.cxx:1811
std::optional< Color > mxColorScale
Definition: fillinfo.hxx:136
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
sal_Int32 SCROW
Definition: types.hxx:17
void SetMergedRange(size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow)
sal_uInt16 nWidth
Definition: fillinfo.hxx:154
bool ValidRow(SCROW nRow) const
Definition: document.hxx:874
ScMF
Definition: attrib.hxx:34
const editeng::SvxBorderLine * GetLine() const
bool bPivotPopupButton
Definition: fillinfo.hxx:163
ScShadowPart eVShadowPart
Definition: fillinfo.hxx:152
std::unique_ptr< ScDataBarInfo > pDataBar
Definition: conditio.hxx:219
field button for datapilot
const T & Put(std::unique_ptr< T > xItem, sal_uInt16 nWhich=0)
constexpr TypedWhichId< ScCondFormatItem > ATTR_CONDITIONAL(154)
SC_DLLPUBLIC ScPatternAttr * GetDefPattern() const
Definition: document.cxx:6082
void SetCellStyleRight(size_t nCol, size_t nRow, const Style &rStyle)
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Definition: document.cxx:985
void SetAddMergedRightSize(size_t nCol, size_t nRow, tools::Long nAddSize)
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
Definition: document.cxx:4460
const SvxLineItem * mpBLTRLine
original item from document.
Definition: fillinfo.hxx:144
rtl::Reference< ScPoolHelper > mxPoolHelper
Definition: document.hxx:354
void SetAddMergedLeftSize(size_t nCol, size_t nRow, tools::Long nAddSize)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
SCROW GetRowMerge() const
Definition: attrib.hxx:69
CellInfo * pCellInfo
Definition: fillinfo.hxx:178
bool bAutoFilter
Definition: fillinfo.hxx:185
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4151
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
bool bEmptyCellText
Definition: fillinfo.hxx:157
OUString aStyleName
Definition: conditio.hxx:221
const editeng::SvxBorderLine * GetBottom() const
void SetAddMergedBottomSize(size_t nCol, size_t nRow, tools::Long nAddSize)
const SvxShadowItem * pHShadowOrigin
Definition: fillinfo.hxx:148
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_BLTR(142)
bool bMerged
Definition: fillinfo.hxx:158
sal_Int16 SCTAB
Definition: types.hxx:22
const SfxItemSet * pConditionSet
Definition: fillinfo.hxx:135
SvxShadowLocation