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