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