LibreOffice Module sc (master) 1
table5.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <scitems.hxx>
21#include <attrib.hxx>
22#include <formulacell.hxx>
23#include <table.hxx>
24#include <column.hxx>
25#include <document.hxx>
26#include <drwlayer.hxx>
27#include <global.hxx>
28#include <stlpool.hxx>
29#include <tabprotection.hxx>
30#include <globstr.hrc>
31#include <scresid.hxx>
32#include <segmenttree.hxx>
33#include <columniterator.hxx>
34#include <globalnames.hxx>
35#include <scmod.hxx>
36#include <printopt.hxx>
37#include <bcaslot.hxx>
38#include <compressedarray.hxx>
39#include <userdat.hxx>
40
41#include <com/sun/star/sheet/TablePageBreakData.hpp>
42
43#include <osl/diagnose.h>
44
45#include <algorithm>
46#include <limits>
47
48using ::com::sun::star::uno::Sequence;
49using ::com::sun::star::sheet::TablePageBreakData;
50using ::std::set;
51
52void ScTable::UpdatePageBreaks(const ScRange* pUserArea)
53{
55 return;
56
57 // pUserArea != NULL -> print area is specified. We need to force-update
58 // the page breaks.
59
60 if (!pUserArea)
61 {
62 if (!bPageSizeValid)
63 return;
64
65 // Always update breaks if force breaks option has changed
66 if (mbPageBreaksValid && mbForceBreaks == SC_MOD()->GetPrintOptions().GetForceBreaks())
67 return;
68 }
69
70 SfxStyleSheetBase* pStyle
71 = rDocument.GetStyleSheetPool()->Find(aPageStyle, SfxStyleFamily::Page);
72 if (!pStyle)
73 {
74 OSL_FAIL("UpdatePageBreaks: Style not found");
75 return;
76 }
77 SfxItemSet* pStyleSet = &pStyle->GetItemSet();
78
79 SCCOL nStartCol = 0;
80 SCROW nStartRow = 0;
81 SCCOL nEndCol = rDocument.MaxCol();
82 SCROW nEndRow = rDocument.MaxRow();
83 if (pUserArea)
84 {
85 nStartCol = pUserArea->aStart.Col();
86 nStartRow = pUserArea->aStart.Row();
87 nEndCol = pUserArea->aEnd.Col();
88 nEndRow = pUserArea->aEnd.Row();
89 }
90 else
91 {
92 sal_uInt16 nAreaCount = GetPrintRangeCount();
93 if (nAreaCount > 1)
94 {
95 // Show nothing, when multiple ranges
96
97 for (SCCOL nX : GetColumnsRange(0, rDocument.MaxCol()))
98 RemoveColBreak(nX, true, false);
99
101
102 return;
103 }
104 else if (nAreaCount == 1)
105 {
106 const ScRange* pArea = GetPrintRange(0);
107 if (pArea)
108 {
109 nStartCol = pArea->aStart.Col();
110 nStartRow = pArea->aStart.Row();
111 nEndCol = pArea->aEnd.Col();
112 nEndRow = pArea->aEnd.Row();
113 }
114 } // otherwise show everything
115 }
116
117 // get bSkipColBreaks/bSkipRowBreaks flags:
118 // fdo#40788 - print range scale settings can cause manual breaks to be
119 // ignored (see below). This behaviour may now be set by the user.
120 mbForceBreaks = SC_MOD()->GetPrintOptions().GetForceBreaks();
121 bool bSkipColBreaks = false;
122 bool bSkipRowBreaks = false;
123
124 if (!mbForceBreaks)
125 {
126 if (const SfxUInt16Item* pItem = pStyleSet->GetItemIfSet(ATTR_PAGE_SCALETOPAGES, false))
127 {
128 bSkipColBreaks = bSkipRowBreaks = pItem->GetValue() > 0;
129 }
130
131 const ScPageScaleToItem* pScaleToItem;
132 if (!bSkipColBreaks && (pScaleToItem = pStyleSet->GetItemIfSet(ATTR_PAGE_SCALETO, false)))
133 {
134 // #i54993# when fitting to width or height, ignore only manual breaks in that direction
135 if (pScaleToItem->GetWidth() > 0)
136 bSkipColBreaks = true;
137 if (pScaleToItem->GetHeight() > 0)
138 bSkipRowBreaks = true;
139 }
140 }
141
142 tools::Long nPageSizeX = aPageSizeTwips.Width();
143 tools::Long nPageSizeY = aPageSizeTwips.Height();
144
145 // Beginning: Remove breaks
146
147 for (SCCOL nX : GetColumnsRange(0, nStartCol - 1))
148 RemoveColBreak(nX, true, false);
149 RemoveRowPageBreaks(0, nStartRow - 1);
150
151 if (nStartCol > 0)
152 SetColBreak(nStartCol, true, false); // AREABREAK
153 if (nStartRow > 0)
154 SetRowBreak(nStartRow, true, false); // AREABREAK
155
156 // Middle part: Distribute breaks
157
158 bool bRepeatCol = (nRepeatStartX != SCCOL_REPEAT_NONE);
159 bool bColFound = false;
160 tools::Long nSizeX = 0;
161 for (SCCOL nX = nStartCol; nX <= nEndCol; nX++)
162 {
163 bool bStartOfPage = false;
164 tools::Long nThisX = ColHidden(nX) ? 0 : mpColWidth->GetValue(nX);
165 bool bManualBreak = HasColManualBreak(nX);
166 if ((nSizeX + nThisX > nPageSizeX) || (bManualBreak && !bSkipColBreaks))
167 {
168 SetColBreak(nX, true, false);
169 nSizeX = 0;
170 bStartOfPage = true;
171 }
172 else if (nX != nStartCol)
173 RemoveColBreak(nX, true, false);
174 else
175 bStartOfPage = true;
176
177 if (bStartOfPage && bRepeatCol && nX > nRepeatStartX && !bColFound)
178 {
179 // subtract size of repeat columns from page size
180 for (SCCOL i = nRepeatStartX; i <= nRepeatEndX; i++)
181 nPageSizeX -= ColHidden(i) ? 0 : mpColWidth->GetValue(i);
182 while (nX <= nRepeatEndX)
183 RemoveColBreak(++nX, true, false);
184 bColFound = true;
185 }
186
187 nSizeX += nThisX;
188 }
189
190 // Remove all page breaks in range.
191 RemoveRowPageBreaks(nStartRow + 1, nEndRow);
192
193 // And set new page breaks.
194 bool bRepeatRow = (nRepeatStartY != SCROW_REPEAT_NONE);
195 bool bRowFound = false;
196 tools::Long nSizeY = 0;
199 SCROW nNextManualBreak = GetNextManualBreak(nStartRow); // -1 => no more manual breaks
200 for (SCROW nY = nStartRow; nY <= nEndRow; ++nY)
201 {
202 bool bStartOfPage = false;
203 bool bThisRowHidden = false;
204 const bool bHasValue = aIterHidden.getValue(nY, bThisRowHidden);
205 assert(bHasValue);
206 (void)bHasValue;
207 tools::Long nThisY = 0;
208 if (!bThisRowHidden)
209 {
210 sal_uInt16 nTmp;
211 const bool bHasHeight = aIterHeights.getValue(nY, nTmp);
212 assert(bHasHeight);
213 if (bHasHeight)
214 nThisY = static_cast<tools::Long>(nTmp);
215 }
216
217 bool bManualBreak = false;
218 if (nNextManualBreak >= 0)
219 {
220 bManualBreak = (nY == nNextManualBreak);
221 if (nY >= nNextManualBreak)
222 // Query the next manual break position.
223 nNextManualBreak = GetNextManualBreak(nY + 1);
224 }
225
226 if ((nSizeY + nThisY > nPageSizeY) || (bManualBreak && !bSkipRowBreaks))
227 {
228 SetRowBreak(nY, true, false);
229 nSizeY = 0;
230 bStartOfPage = true;
231 }
232 else if (nY != nStartRow)
233 ; // page break already removed
234 else
235 bStartOfPage = true;
236
237 if (bStartOfPage && bRepeatRow && nY > nRepeatStartY && !bRowFound)
238 {
239 // subtract size of repeat rows from page size
241#if OSL_DEBUG_LEVEL > 0
242 if (nHeights == ::std::numeric_limits<tools::Long>::max())
243 OSL_FAIL("ScTable::UpdatePageBreaks: row heights overflow");
244#endif
245 nPageSizeY -= nHeights;
246 if (nY <= nRepeatEndY)
248 bRowFound = true;
249 }
250
251 if (bThisRowHidden)
252 {
253 // Hidden row range. Skip them unless there is a manual break.
254 SCROW nLastCommon = aIterHidden.getLastPos();
255 if (nNextManualBreak >= 0)
256 nLastCommon = ::std::min(nLastCommon, nNextManualBreak - 1);
257 nY = nLastCommon;
258 }
259 else
260 {
261 // Visible row range.
262
263 SCROW nLastHidden = aIterHidden.getLastPos();
264 SCROW nLastHeight = aIterHeights.getLastPos();
265 SCROW nLastCommon = ::std::min(nLastHidden, nLastHeight);
266 if (nNextManualBreak >= 0)
267 nLastCommon = ::std::min(nLastCommon, nNextManualBreak - 1);
268
269 if (nLastCommon > nY)
270 {
271 tools::Long nMaxMultiple = static_cast<tools::Long>(nLastCommon - nY);
272 tools::Long nMultiple = (nPageSizeY - nSizeY) / nThisY;
273 if (nMultiple > nMaxMultiple)
274 nMultiple = nMaxMultiple;
275 if (nMultiple > 1)
276 {
277 nSizeY += nThisY * (nMultiple - 1);
278 nY += nMultiple - 1;
279 }
280 }
281 }
282
283 nSizeY += nThisY;
284 }
285
286 // End: Remove Break
287
288 if (nEndCol < rDocument.MaxCol())
289 {
290 SetColBreak(nEndCol + 1, true, false); // AREABREAK
291 for (SCCOL nCol : GetColumnsRange(nEndCol + 2, rDocument.MaxCol()))
292 RemoveColBreak(nCol, true, false);
293 }
294 if (nEndRow < rDocument.MaxRow())
295 {
296 SetRowBreak(nEndRow + 1, true, false); // AREABREAK
297 if (nEndRow + 2 <= rDocument.MaxRow())
298 RemoveRowPageBreaks(nEndRow + 2, rDocument.MaxRow());
299 }
301 = !pUserArea; // #i116881# the valid flag can only apply to the "no user area" case
302}
303
305{
306 maRowManualBreaks.clear();
307 maColManualBreaks.clear();
309
310 SetStreamValid(false);
311}
312
314{
315 return !maRowManualBreaks.empty() || !maColManualBreaks.empty();
316}
317
318void ScTable::SetRowManualBreaks(::std::set<SCROW>&& rBreaks)
319{
320 maRowManualBreaks = std::move(rBreaks);
322 SetStreamValid(false);
323}
324
325void ScTable::SetColManualBreaks(::std::set<SCCOL>&& rBreaks)
326{
327 maColManualBreaks = std::move(rBreaks);
329 SetStreamValid(false);
330}
331
332void ScTable::GetAllRowBreaks(set<SCROW>& rBreaks, bool bPage, bool bManual) const
333{
334 if (bPage)
335 rBreaks = maRowPageBreaks;
336
337 if (bManual)
338 {
340 inserter(rBreaks, rBreaks.begin()));
341 }
342}
343
344void ScTable::GetAllColBreaks(set<SCCOL>& rBreaks, bool bPage, bool bManual) const
345{
346 if (bPage)
347 rBreaks = maColPageBreaks;
348
349 if (bManual)
350 {
352 inserter(rBreaks, rBreaks.begin()));
353 }
354}
355
357{
358 if (!ValidRow(nRow))
359 return false;
360
361 return maRowPageBreaks.find(nRow) != maRowPageBreaks.end();
362}
363
365{
366 if (!ValidCol(nCol))
367 return false;
368
369 return maColPageBreaks.find(nCol) != maColPageBreaks.end();
370}
371
373{
374 if (!ValidRow(nRow))
375 return false;
376
377 return maRowManualBreaks.find(nRow) != maRowManualBreaks.end();
378}
379
381{
382 if (!ValidCol(nCol))
383 return false;
384
385 return maColManualBreaks.find(nCol) != maColManualBreaks.end();
386}
387
389{
390 set<SCROW>::const_iterator itr = maRowManualBreaks.lower_bound(nRow);
391 return itr == maRowManualBreaks.end() ? -1 : *itr;
392}
393
395{
396 if (!ValidRow(nStartRow) || !ValidRow(nEndRow))
397 return;
398
399 set<SCROW>::iterator low = maRowPageBreaks.lower_bound(nStartRow);
400 set<SCROW>::iterator high = maRowPageBreaks.upper_bound(nEndRow);
401 maRowPageBreaks.erase(low, high);
402}
403
404void ScTable::RemoveRowBreak(SCROW nRow, bool bPage, bool bManual)
405{
406 if (!ValidRow(nRow))
407 return;
408
409 if (bPage)
410 maRowPageBreaks.erase(nRow);
411
412 if (bManual)
413 {
414 maRowManualBreaks.erase(nRow);
416 }
417}
418
419void ScTable::RemoveColBreak(SCCOL nCol, bool bPage, bool bManual)
420{
421 if (!ValidCol(nCol))
422 return;
423
424 if (bPage)
425 maColPageBreaks.erase(nCol);
426
427 if (bManual)
428 {
429 maColManualBreaks.erase(nCol);
431 }
432}
433
434void ScTable::SetRowBreak(SCROW nRow, bool bPage, bool bManual)
435{
436 if (!ValidRow(nRow))
437 return;
438
439 if (bPage)
440 maRowPageBreaks.insert(nRow);
441
442 if (bManual)
443 {
444 maRowManualBreaks.insert(nRow);
446 }
447}
448
449void ScTable::SetColBreak(SCCOL nCol, bool bPage, bool bManual)
450{
451 if (!ValidCol(nCol))
452 return;
453
454 if (bPage)
455 maColPageBreaks.insert(nCol);
456
457 if (bManual)
458 {
459 maColManualBreaks.insert(nCol);
461 }
462}
463
464Sequence<TablePageBreakData> ScTable::GetRowBreakData() const
465{
466 using ::std::inserter;
467
468 set<SCROW> aRowBreaks = maRowPageBreaks;
470 inserter(aRowBreaks, aRowBreaks.begin()));
471
472 Sequence<TablePageBreakData> aSeq(aRowBreaks.size());
473 std::transform(aRowBreaks.begin(), aRowBreaks.end(), aSeq.getArray(), [this](const SCROW nRow) {
474 return TablePageBreakData(nRow, HasRowManualBreak(nRow));
475 });
476
477 return aSeq;
478}
479
480bool ScTable::RowHidden(SCROW nRow, SCROW* pFirstRow, SCROW* pLastRow) const
481{
482 if (!ValidRow(nRow))
483 {
484 if (pFirstRow)
485 *pFirstRow = nRow;
486 if (pLastRow)
487 *pLastRow = nRow;
488 return true;
489 }
490
492 if (!mpHiddenRows->getRangeData(nRow, aData))
493 {
494 // search failed.
495 if (pFirstRow)
496 *pFirstRow = nRow;
497 if (pLastRow)
498 *pLastRow = nRow;
499 return true;
500 }
501
502 if (pFirstRow)
503 *pFirstRow = aData.mnRow1;
504 if (pLastRow)
505 *pLastRow = aData.mnRow2;
506
507 return aData.mbValue;
508}
509
510bool ScTable::RowHiddenLeaf(SCROW nRow, SCROW* pFirstRow, SCROW* pLastRow) const
511{
512 if (!ValidRow(nRow))
513 {
514 if (pFirstRow)
515 *pFirstRow = nRow;
516 if (pLastRow)
517 *pLastRow = nRow;
518 return true;
519 }
520
522 if (!mpHiddenRows->getRangeDataLeaf(nRow, aData))
523 {
524 // search failed.
525 if (pFirstRow)
526 *pFirstRow = nRow;
527 if (pLastRow)
528 *pLastRow = nRow;
529 return true;
530 }
531
532 if (pFirstRow)
533 *pFirstRow = aData.mnRow1;
534 if (pLastRow)
535 *pLastRow = aData.mnRow2;
536
537 return aData.mbValue;
538}
539
540bool ScTable::HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const
541{
542 SCROW nRow = nStartRow;
543 while (nRow <= nEndRow)
544 {
545 SCROW nLastRow = -1;
546 bool bHidden = RowHidden(nRow, nullptr, &nLastRow);
547 if (bHidden)
548 return true;
549
550 nRow = nLastRow + 1;
551 }
552 return false;
553}
554
555bool ScTable::ColHidden(SCCOL nCol, SCCOL* pFirstCol, SCCOL* pLastCol) const
556{
557 if (!ValidCol(nCol))
558 return true;
559
561 if (!mpHiddenCols->getRangeData(nCol, aData))
562 return true;
563
564 if (pFirstCol)
565 *pFirstCol = aData.mnCol1;
566 if (pLastCol)
567 *pLastCol = aData.mnCol2;
568
569 return aData.mbValue;
570}
571
572bool ScTable::SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden)
573{
574 bool bChanged = false;
575 if (bHidden)
576 bChanged = mpHiddenRows->setTrue(nStartRow, nEndRow);
577 else
578 bChanged = mpHiddenRows->setFalse(nStartRow, nEndRow);
579
580 // Cell anchored objects might change visibility
581 ScDrawLayer* pDrawLayer = rDocument.GetDrawLayer();
582 if (pDrawLayer)
583 {
584 std::vector<SdrObject*> aRowDrawObjects;
585 aRowDrawObjects = pDrawLayer->GetObjectsAnchoredToRows(GetTab(), nStartRow, nEndRow);
586 for (auto aObj : aRowDrawObjects)
587 {
589 if (pData)
590 {
591 if (bHidden)
592 aObj->SetVisible(false);
593 else if (!GetDoc().ColHidden(pData->maStart.Col(), pData->maStart.Tab()))
594 {
595 // Only change visibility if object is not hidden by a hidden col
596 aObj->SetVisible(true);
597 }
598 }
599 }
600 }
601
602 if (bChanged)
603 {
604 SetStreamValid(false);
605
606 { // Scoped bulk broadcast.
607 // Only subtotal formula cells will accept the notification of
608 // SfxHintId::ScHiddenRowsChanged, leaving the bulk will track
609 // those and broadcast SfxHintId::ScDataChanged to notify all
610 // dependents.
611 ScBulkBroadcast aBulkBroadcast(rDocument.GetBASM(), SfxHintId::ScDataChanged);
612 for (SCCOL i = 0; i < aCol.size(); i++)
613 {
614 aCol[i].BroadcastRows(nStartRow, nEndRow, SfxHintId::ScHiddenRowsChanged);
615 }
616 }
617 }
618
619 return bChanged;
620}
621
622void ScTable::SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden)
623{
624 bool bChanged = false;
625 if (bHidden)
626 bChanged = mpHiddenCols->setTrue(nStartCol, nEndCol);
627 else
628 bChanged = mpHiddenCols->setFalse(nStartCol, nEndCol);
629
630 // Cell anchored objects might change visibility
631 ScDrawLayer* pDrawLayer = rDocument.GetDrawLayer();
632 if (pDrawLayer)
633 {
634 std::vector<SdrObject*> aColDrawObjects;
635 aColDrawObjects = pDrawLayer->GetObjectsAnchoredToCols(GetTab(), nStartCol, nEndCol);
636 for (auto aObj : aColDrawObjects)
637 {
639 if (pData)
640 {
641 if (bHidden)
642 aObj->SetVisible(false);
643 else if (!GetDoc().RowHidden(pData->maStart.Row(), pData->maStart.Tab()))
644 {
645 // Only change visibility if object is not hidden by a hidden row
646 aObj->SetVisible(true);
647 }
648 }
649 }
650 }
651
652 if (bChanged)
653 SetStreamValid(false);
654}
655
656void ScTable::CopyColHidden(const ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol)
657{
658 SCCOL nCol = nStartCol;
659 while (nCol <= nEndCol)
660 {
661 SCCOL nLastCol = -1;
662 bool bHidden = rTable.ColHidden(nCol, nullptr, &nLastCol);
663 if (nLastCol > nEndCol)
664 nLastCol = nEndCol;
665
666 SetColHidden(nCol, nLastCol, bHidden);
667 nCol = nLastCol + 1;
668 }
669}
670
671void ScTable::CopyRowHidden(const ScTable& rTable, SCROW nStartRow, SCROW nEndRow)
672{
673 SCROW nRow = nStartRow;
674 while (nRow <= nEndRow)
675 {
676 SCROW nLastRow = -1;
677 bool bHidden = rTable.RowHidden(nRow, nullptr, &nLastRow);
678 if (nLastRow > nEndRow)
679 nLastRow = nEndRow;
680 SetRowHidden(nRow, nLastRow, bHidden);
681 nRow = nLastRow + 1;
682 }
683}
684
685void ScTable::CopyRowHeight(const ScTable& rSrcTable, SCROW nStartRow, SCROW nEndRow,
686 SCROW nSrcOffset)
687{
688 SCROW nRow = nStartRow;
690 while (nRow <= nEndRow)
691 {
692 if (!rSrcTable.mpRowHeights->getRangeData(nRow + nSrcOffset, aSrcData))
693 // Something is wrong !
694 return;
695
696 SCROW nLastRow = aSrcData.mnRow2 - nSrcOffset;
697 if (nLastRow > nEndRow)
698 nLastRow = nEndRow;
699
700 mpRowHeights->setValue(nRow, nLastRow, aSrcData.mnValue);
701 nRow = nLastRow + 1;
702 }
703}
704
705SCROW ScTable::FirstVisibleRow(SCROW nStartRow, SCROW nEndRow) const
706{
707 SCROW nRow = nStartRow;
709 while (nRow <= nEndRow)
710 {
711 if (!ValidRow(nRow))
712 break;
713
714 if (!mpHiddenRows->getRangeData(nRow, aData))
715 // failed to get range data.
716 break;
717
718 if (!aData.mbValue)
719 // visible row found
720 return nRow;
721
722 nRow = aData.mnRow2 + 1;
723 }
724
725 return ::std::numeric_limits<SCROW>::max();
726}
727
728SCROW ScTable::LastVisibleRow(SCROW nStartRow, SCROW nEndRow) const
729{
730 SCROW nRow = nEndRow;
732 while (nRow >= nStartRow)
733 {
734 if (!ValidRow(nRow))
735 break;
736
737 if (!mpHiddenRows->getRangeData(nRow, aData))
738 // failed to get range data.
739 break;
740
741 if (!aData.mbValue)
742 // visible row found
743 return nRow;
744
745 nRow = aData.mnRow1 - 1;
746 }
747
748 return ::std::numeric_limits<SCROW>::max();
749}
750
752{
753 SCROW nCount = 0;
754 SCROW nRow = nStartRow;
756 while (nRow <= nEndRow)
757 {
758 if (!mpHiddenRows->getRangeData(nRow, aData))
759 break;
760
761 if (aData.mnRow2 > nEndRow)
762 aData.mnRow2 = nEndRow;
763
764 if (!aData.mbValue)
765 nCount += aData.mnRow2 - nRow + 1;
766
767 nRow = aData.mnRow2 + 1;
768 }
769 return nCount;
770}
771
772tools::Long ScTable::GetTotalRowHeight(SCROW nStartRow, SCROW nEndRow, bool bHiddenAsZero) const
773{
774 tools::Long nHeight = 0;
775 SCROW nRow = nStartRow;
777 while (nRow <= nEndRow)
778 {
779 if (!mpHiddenRows->getRangeData(nRow, aData))
780 break;
781
782 if (aData.mnRow2 > nEndRow)
783 aData.mnRow2 = nEndRow;
784
785 if (!(bHiddenAsZero && aData.mbValue))
786 // visible row range.
787 nHeight += mpRowHeights->getSumValue(nRow, aData.mnRow2);
788
789 nRow = aData.mnRow2 + 1;
790 }
791
792 return nHeight;
793}
794
796{
797 assert(nStartCol <= nEndCol);
798 SCCOL nCount = 0;
799 SCCOL nCol = nStartCol;
801 while (nCol <= nEndCol)
802 {
803 if (!mpHiddenCols->getRangeData(nCol, aData))
804 break;
805
806 if (aData.mnCol2 > nEndCol)
807 aData.mnCol2 = nEndCol;
808
809 if (!aData.mbValue)
810 nCount += aData.mnCol2 - nCol + 1;
811
812 nCol = aData.mnCol2 + 1;
813 }
814 return nCount;
815}
816
818{
819 if (bCol)
820 {
821 SCCOL nCol = static_cast<SCCOL>(nPos);
822 if (ColHidden(nCol))
823 {
824 for (SCCOL i = nCol + 1; i <= rDocument.MaxCol(); ++i)
825 {
826 if (!ColHidden(i))
827 return i - 1;
828 }
829 }
830 }
831 else
832 {
833 SCROW nRow = static_cast<SCROW>(nPos);
834 SCROW nLastRow;
835 if (RowHidden(nRow, nullptr, &nLastRow))
836 return static_cast<SCCOLROW>(nLastRow);
837 }
838 return ::std::numeric_limits<SCCOLROW>::max();
839}
840
841bool ScTable::RowFiltered(SCROW nRow, SCROW* pFirstRow, SCROW* pLastRow) const
842{
843 if (!ValidRow(nRow))
844 return false;
845
847 if (!mpFilteredRows->getRangeData(nRow, aData))
848 // search failed.
849 return false;
850
851 if (pFirstRow)
852 *pFirstRow = aData.mnRow1;
853 if (pLastRow)
854 *pLastRow = aData.mnRow2;
855
856 return aData.mbValue;
857}
858
859bool ScTable::ColFiltered(SCCOL nCol, SCCOL* pFirstCol, SCCOL* pLastCol) const
860{
861 if (!ValidCol(nCol))
862 return false;
863
865 if (!mpFilteredCols->getRangeData(nCol, aData))
866 // search failed.
867 return false;
868
869 if (pFirstCol)
870 *pFirstCol = aData.mnCol1;
871 if (pLastCol)
872 *pLastCol = aData.mnCol2;
873
874 return aData.mbValue;
875}
876
877bool ScTable::HasFilteredRows(SCROW nStartRow, SCROW nEndRow) const
878{
879 SCROW nRow = nStartRow;
880 while (nRow <= nEndRow)
881 {
882 SCROW nLastRow = nRow;
883 bool bFiltered = RowFiltered(nRow, nullptr, &nLastRow);
884 if (bFiltered)
885 return true;
886
887 nRow = nLastRow + 1;
888 }
889 return false;
890}
891
892void ScTable::CopyColFiltered(const ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol)
893{
894 SCCOL nCol = nStartCol;
895 while (nCol <= nEndCol)
896 {
897 SCCOL nLastCol = -1;
898 bool bFiltered = rTable.ColFiltered(nCol, nullptr, &nLastCol);
899 if (nLastCol > nEndCol)
900 nLastCol = nEndCol;
901
902 SetColFiltered(nCol, nLastCol, bFiltered);
903 nCol = nLastCol + 1;
904 }
905}
906
907void ScTable::CopyRowFiltered(const ScTable& rTable, SCROW nStartRow, SCROW nEndRow)
908{
909 SCROW nRow = nStartRow;
910 while (nRow <= nEndRow)
911 {
912 SCROW nLastRow = -1;
913 bool bFiltered = rTable.RowFiltered(nRow, nullptr, &nLastRow);
914 if (nLastRow > nEndRow)
915 nLastRow = nEndRow;
916 SetRowFiltered(nRow, nLastRow, bFiltered);
917 nRow = nLastRow + 1;
918 }
919}
920
921void ScTable::SetRowFiltered(SCROW nStartRow, SCROW nEndRow, bool bFiltered)
922{
923 if (bFiltered)
924 mpFilteredRows->setTrue(nStartRow, nEndRow);
925 else
926 mpFilteredRows->setFalse(nStartRow, nEndRow);
927}
928
929void ScTable::SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, bool bFiltered)
930{
931 if (bFiltered)
932 mpFilteredCols->setTrue(nStartCol, nEndCol);
933 else
934 mpFilteredCols->setFalse(nStartCol, nEndCol);
935}
936
938{
939 SCROW nRow = nStartRow;
941 while (nRow <= nEndRow)
942 {
943 if (!ValidRow(nRow))
944 break;
945
946 if (!mpFilteredRows->getRangeData(nRow, aData))
947 // failed to get range data.
948 break;
949
950 if (!aData.mbValue)
951 // non-filtered row found
952 return nRow;
953
954 nRow = aData.mnRow2 + 1;
955 }
956
957 return ::std::numeric_limits<SCROW>::max();
958}
959
961{
962 SCROW nRow = nEndRow;
964 while (nRow >= nStartRow)
965 {
966 if (!ValidRow(nRow))
967 break;
968
969 if (!mpFilteredRows->getRangeData(nRow, aData))
970 // failed to get range data.
971 break;
972
973 if (!aData.mbValue)
974 // non-filtered row found
975 return nRow;
976
977 nRow = aData.mnRow1 - 1;
978 }
979
980 return ::std::numeric_limits<SCROW>::max();
981}
982
984{
985 SCROW nCount = 0;
986 SCROW nRow = nStartRow;
988 while (nRow <= nEndRow)
989 {
990 if (!mpFilteredRows->getRangeData(nRow, aData))
991 break;
992
993 if (aData.mnRow2 > nEndRow)
994 aData.mnRow2 = nEndRow;
995
996 if (!aData.mbValue)
997 nCount += aData.mnRow2 - nRow + 1;
998
999 nRow = aData.mnRow2 + 1;
1000 }
1001 return nCount;
1002}
1003
1005{
1006 return bool(pRowFlags->GetValue(nRow) & CRFlags::ManualSize);
1007}
1008
1009namespace
1010{
1011void lcl_syncFlags(const ScDocument* pDocument, ScFlatBoolColSegments& rColSegments,
1012 const ScFlatBoolRowSegments& rRowSegments,
1014 ScBitMaskCompressedArray<SCROW, CRFlags>* pRowFlags, const CRFlags nFlagMask)
1015{
1016 using ::sal::static_int_cast;
1017
1018 CRFlags nFlagMaskComplement = ~nFlagMask;
1019
1020 pRowFlags->AndValue(0, pDocument->MaxRow(), nFlagMaskComplement);
1021 pColFlags->AndValue(0, pDocument->MaxCol() + 1, nFlagMaskComplement);
1022
1023 {
1024 // row hidden flags.
1025
1026 SCROW nRow = 0;
1028 while (nRow <= pDocument->MaxRow())
1029 {
1030 if (!rRowSegments.getRangeData(nRow, aData))
1031 break;
1032
1033 if (aData.mbValue)
1034 pRowFlags->OrValue(nRow, aData.mnRow2, nFlagMask);
1035
1036 nRow = aData.mnRow2 + 1;
1037 }
1038 }
1039
1040 {
1041 // column hidden flags.
1042
1043 SCCOL nCol = 0;
1045 while (nCol <= pDocument->MaxCol())
1046 {
1047 if (!rColSegments.getRangeData(nCol, aData))
1048 break;
1049
1050 if (aData.mbValue)
1051 pColFlags->OrValue(nCol, aData.mnCol2, nFlagMask);
1052
1053 nCol = aData.mnCol2 + 1;
1054 }
1055 }
1056}
1057}
1058
1060{
1061 CRFlags nManualBreakComplement = ~CRFlags::ManualBreak;
1062
1063 // Manual breaks.
1064 pRowFlags->AndValue(0, rDocument.MaxRow(), nManualBreakComplement);
1065 mpColFlags->AndValue(0, rDocument.MaxCol() + 1, nManualBreakComplement);
1066
1067 for (const auto& rBreakPos : maRowManualBreaks)
1068 pRowFlags->OrValue(rBreakPos, CRFlags::ManualBreak);
1069
1070 for (const auto& rBreakPos : maColManualBreaks)
1071 mpColFlags->OrValue(rBreakPos, CRFlags::ManualBreak);
1072
1073 // Hidden flags.
1074 lcl_syncFlags(&rDocument, *mpHiddenCols, *mpHiddenRows, mpColFlags.get(), pRowFlags.get(),
1076 lcl_syncFlags(&rDocument, *mpFilteredCols, *mpFilteredRows, mpColFlags.get(), pRowFlags.get(),
1078}
1079
1080void ScTable::SetPageSize(const Size& rSize)
1081{
1082 if (!rSize.IsEmpty())
1083 {
1084 if (aPageSizeTwips != rSize)
1086
1087 bPageSizeValid = true;
1088 aPageSizeTwips = rSize;
1089 }
1090 else
1091 bPageSizeValid = false;
1092}
1093
1094bool ScTable::IsProtected() const { return pTabProtection && pTabProtection->isProtected(); }
1095
1097{
1098 if (pProtect)
1099 pTabProtection.reset(new ScTableProtection(*pProtect));
1100 else
1101 pTabProtection.reset();
1102
1103 SetStreamValid(false);
1104}
1105
1107
1109{
1110 if (bPageSizeValid)
1111 return aPageSizeTwips;
1112 else
1113 return Size(); // blank
1114}
1115
1116void ScTable::SetRepeatArea(SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow)
1117{
1118 // #i117952# page break calculation uses these values (set from ScPrintFunc), not pRepeatColRange/pRepeatRowRange
1119 if (nStartCol != nRepeatStartX || nEndCol != nRepeatEndX || nStartRow != nRepeatStartY
1120 || nEndRow != nRepeatEndY)
1122
1123 nRepeatStartX = nStartCol;
1124 nRepeatEndX = nEndCol;
1125 nRepeatStartY = nStartRow;
1126 nRepeatEndY = nEndRow;
1127}
1128
1129void ScTable::StartListening(const ScAddress& rAddress, SvtListener* pListener)
1130{
1131 if (!ValidCol(rAddress.Col()))
1132 return;
1133
1134 CreateColumnIfNotExists(rAddress.Col()).StartListening(*pListener, rAddress.Row());
1135}
1136
1137void ScTable::EndListening(const ScAddress& rAddress, SvtListener* pListener)
1138{
1139 if (!ValidCol(rAddress.Col()))
1140 return;
1141
1142 if (rAddress.Col() < aCol.size())
1143 aCol[rAddress.Col()].EndListening(*pListener, rAddress.Row());
1144}
1145
1147 SvtListener& rListener)
1148{
1149 if (!ValidCol(rAddress.Col()))
1150 return;
1151
1152 CreateColumnIfNotExists(rAddress.Col()).StartListening(rCxt, rAddress, rListener);
1153}
1154
1156 SvtListener& rListener)
1157{
1158 if (!ValidCol(rAddress.Col()))
1159 return;
1160
1161 if (rAddress.Col() < aCol.size())
1162 aCol[rAddress.Col()].EndListening(rCxt, rAddress, rListener);
1163}
1164
1165void ScTable::SetPageStyle(const OUString& rName)
1166{
1167 if (aPageStyle == rName)
1168 return;
1169
1170 OUString aStrNew = rName;
1172 SfxStyleSheetBase* pNewStyle = pStylePool->Find(aStrNew, SfxStyleFamily::Page);
1173
1174 if (!pNewStyle)
1175 {
1176 aStrNew = ScResId(STR_STYLENAME_STANDARD);
1177 pNewStyle = pStylePool->Find(aStrNew, SfxStyleFamily::Page);
1178 }
1179
1180 if (aPageStyle == aStrNew)
1181 return;
1182
1183 SfxStyleSheetBase* pOldStyle = pStylePool->Find(aPageStyle, SfxStyleFamily::Page);
1184 if (pOldStyle && pNewStyle)
1185 {
1186 SfxItemSet& rOldSet = pOldStyle->GetItemSet();
1187 SfxItemSet& rNewSet = pNewStyle->GetItemSet();
1188 auto getScaleValue = [](const SfxItemSet& rSet, sal_uInt16 nId) {
1189 return static_cast<const SfxUInt16Item&>(rSet.Get(nId)).GetValue();
1190 };
1191
1192 const sal_uInt16 nOldScale = getScaleValue(rOldSet, ATTR_PAGE_SCALE);
1193 const sal_uInt16 nOldScaleToPages = getScaleValue(rOldSet, ATTR_PAGE_SCALETOPAGES);
1194 const sal_uInt16 nNewScale = getScaleValue(rNewSet, ATTR_PAGE_SCALE);
1195 const sal_uInt16 nNewScaleToPages = getScaleValue(rNewSet, ATTR_PAGE_SCALETOPAGES);
1196
1197 if ((nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages))
1198 InvalidateTextWidth(nullptr, nullptr, false, false);
1199 }
1200
1201 if (pNewStyle) // also without the old one (for UpdateStdNames)
1202 aPageStyle = aStrNew;
1203
1204 SetStreamValid(false);
1205}
1206
1207void ScTable::PageStyleModified(const OUString& rNewName)
1208{
1209 aPageStyle = rNewName;
1210 InvalidateTextWidth(nullptr, nullptr, false, false); // don't know what was in the style before
1211}
1212
1213void ScTable::InvalidateTextWidth(const ScAddress* pAdrFrom, const ScAddress* pAdrTo,
1214 bool bNumFormatChanged, bool bBroadcast)
1215{
1216 if (pAdrFrom && !pAdrTo)
1217 {
1218 // Special case: only process the "from" cell.
1219 SCCOL nCol = pAdrFrom->Col();
1220 SCROW nRow = pAdrFrom->Row();
1221 if (nCol >= aCol.size())
1222 return;
1223 ScColumn& rCol = aCol[nCol];
1224 ScRefCellValue aCell = rCol.GetCellValue(nRow);
1225 if (aCell.isEmpty())
1226 return;
1227
1228 rCol.SetTextWidth(nRow, TEXTWIDTH_DIRTY);
1229
1230 if (bNumFormatChanged)
1231 rCol.SetScriptType(nRow, SvtScriptType::UNKNOWN);
1232
1233 if (bBroadcast)
1234 { // Only with CalcAsShown
1235 switch (aCell.getType())
1236 {
1237 case CELLTYPE_VALUE:
1238 rCol.Broadcast(nRow);
1239 break;
1240 case CELLTYPE_FORMULA:
1241 aCell.getFormula()->SetDirty();
1242 break;
1243 default:
1244 {
1245 // added to avoid warnings
1246 }
1247 }
1248 }
1249
1250 return;
1251 }
1252
1253 const SCCOL nCol1 = pAdrFrom ? pAdrFrom->Col() : 0;
1254 const SCROW nRow1 = pAdrFrom ? pAdrFrom->Row() : 0;
1255 const SCCOL nCol2 = pAdrTo ? pAdrTo->Col() : aCol.size() - 1;
1256 const SCROW nRow2 = pAdrTo ? pAdrTo->Row() : rDocument.MaxRow();
1257
1258 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
1259 {
1260 ScColumnTextWidthIterator aIter(GetDoc(), aCol[nCol], nRow1, nRow2);
1261 sc::ColumnBlockPosition blockPos; // cache mdds position
1262 InitColumnBlockPosition(blockPos, nCol);
1263
1264 for (; aIter.hasCell(); aIter.next())
1265 {
1266 SCROW nRow = aIter.getPos();
1268 ScRefCellValue aCell = aCol[nCol].GetCellValue(blockPos, nRow);
1269 if (aCell.isEmpty())
1270 continue;
1271
1272 if (bNumFormatChanged)
1273 aCol[nCol].SetScriptType(nRow, SvtScriptType::UNKNOWN);
1274
1275 if (bBroadcast)
1276 { // Only with CalcAsShown
1277 switch (aCell.getType())
1278 {
1279 case CELLTYPE_VALUE:
1280 aCol[nCol].Broadcast(nRow);
1281 break;
1282 case CELLTYPE_FORMULA:
1283 aCell.getFormula()->SetDirty();
1284 break;
1285 default:
1286 {
1287 // added to avoid warnings
1288 }
1289 }
1290 }
1291 }
1292 }
1293}
1294
1295/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SCROW SCROW_REPEAT_NONE
Definition: address.hxx:94
const SCCOL SCCOL_REPEAT_NONE
Definition: address.hxx:93
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
The data type represents bits, manageable by bitwise operations.
void AndValue(A nPos, const D &rValueToAnd)
void OrValue(A nPos, const D &rValueToOr)
SCCOL size() const
void setValue(sal_uInt16 nVal)
ScRefCellValue GetCellValue(SCROW nRow) const
Definition: column.cxx:638
void Broadcast(SCROW nRow)
Definition: column3.cxx:74
void SetScriptType(SCROW nRow, SvtScriptType nType)
Definition: column2.cxx:2372
void SetTextWidth(SCROW nRow, sal_uInt16 nWidth)
Definition: column2.cxx:2282
void StartListening(SvtListener &rLst, SCROW nRow)
Definition: column2.cxx:3466
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:891
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:892
ScBroadcastAreaSlotMachine * GetBASM() const
Definition: document.hxx:2226
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
Definition: document.hxx:1082
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6175
bool IsImportingXML() const
Definition: document.hxx:2222
static ScDrawObjData * GetObjData(SdrObject *pObj, bool bCreate=false)
Definition: drwlayer.cxx:2603
std::vector< SdrObject * > GetObjectsAnchoredToCols(SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol)
Definition: drwlayer.cxx:2539
std::vector< SdrObject * > GetObjectsAnchoredToRows(SCTAB nTab, SCROW nStartRow, SCROW nEndRow)
Definition: drwlayer.cxx:2471
bool getRangeData(SCCOL nCol, RangeData &rData)
bool getValue(SCROW nPos, bool &rVal)
bool getRangeData(SCROW nRow, RangeData &rData) const
bool getValue(SCROW nPos, sal_uInt16 &rVal)
void SetDirty(bool bDirtyFlag=true)
Contains the "scale to width/height" attribute in page styles.
Definition: attrib.hxx:225
sal_uInt16 GetHeight() const
Definition: attrib.hxx:243
sal_uInt16 GetWidth() const
Definition: attrib.hxx:242
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
sheet protection state container
std::unique_ptr< ScFlatBoolColSegments > mpHiddenCols
Definition: table.hxx:194
Size aPageSizeTwips
Definition: table.hxx:175
OUString aPageStyle
Definition: table.hxx:174
SCCOLROW LastHiddenColRow(SCCOLROW nPos, bool bCol) const
Definition: table5.cxx:817
bool ValidCol(SCCOL nCol) const
Definition: table.hxx:348
SCCOL CountVisibleCols(SCCOL nStartCol, SCCOL nEndCol) const
Definition: table5.cxx:795
void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden)
Definition: table5.cxx:622
std::unique_ptr< ScFlatBoolRowSegments > mpFilteredRows
Definition: table.hxx:197
bool bPageSizeValid
Definition: table.hxx:245
SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow) const
Definition: table5.cxx:728
ScColumnsRange GetColumnsRange(SCCOL begin, SCCOL end) const
Definition: table1.cxx:2720
bool ColFiltered(SCCOL nCol, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: table5.cxx:859
void SetRowFiltered(SCROW nStartRow, SCROW nEndRow, bool bFiltered)
Definition: table5.cxx:921
SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow) const
Definition: table5.cxx:705
void InvalidatePageBreaks()
Definition: table2.cxx:1562
void GetAllRowBreaks(::std::set< SCROW > &rBreaks, bool bPage, bool bManual) const
Definition: table5.cxx:332
void EndListening(const ScAddress &rAddress, SvtListener *pListener)
Definition: table5.cxx:1137
bool RowHiddenLeaf(SCROW nRow, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
Definition: table5.cxx:510
::std::set< SCCOL > maColManualBreaks
Definition: table.hxx:202
void CopyRowFiltered(const ScTable &rTable, SCROW nStartRow, SCROW nEndRow)
Definition: table5.cxx:907
Size GetPageSize() const
Definition: table5.cxx:1108
ScColContainer aCol
Definition: table.hxx:160
void GetAllColBreaks(::std::set< SCCOL > &rBreaks, bool bPage, bool bManual) const
Definition: table5.cxx:344
std::unique_ptr< ScBitMaskCompressedArray< SCROW, CRFlags > > pRowFlags
Definition: table.hxx:193
void PageStyleModified(const OUString &rNewName)
Definition: table5.cxx:1207
ScColumn & CreateColumnIfNotExists(const SCCOL nScCol)
Definition: table.hxx:295
bool mbPageBreaksValid
Definition: table.hxx:254
SCROW nRepeatEndY
Definition: table.hxx:179
::std::set< SCROW > maRowPageBreaks
Definition: table.hxx:199
std::unique_ptr< ScBitMaskCompressedArray< SCCOL, CRFlags > > mpColFlags
Definition: table.hxx:192
void SetStreamValid(bool bSet, bool bIgnoreLock=false)
Definition: table1.cxx:378
void CopyRowHeight(const ScTable &rSrcTable, SCROW nStartRow, SCROW nEndRow, SCROW nSrcOffset)
Definition: table5.cxx:685
bool SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden)
Definition: table5.cxx:572
void SetPageSize(const Size &rSize)
Definition: table5.cxx:1080
std::unique_ptr< ScFlatBoolColSegments > mpFilteredCols
Definition: table.hxx:196
void SyncColRowFlags()
Definition: table5.cxx:1059
SCCOL nRepeatStartX
Definition: table.hxx:176
css::uno::Sequence< css::sheet::TablePageBreakData > GetRowBreakData() const
Definition: table5.cxx:464
void SetColBreak(SCCOL nCol, bool bPage, bool bManual)
Definition: table5.cxx:449
bool HasRowPageBreak(SCROW nRow) const
Definition: table5.cxx:356
SCROW CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow) const
Definition: table5.cxx:983
void RemoveRowPageBreaks(SCROW nStartRow, SCROW nEndRow)
Definition: table5.cxx:394
bool HasColPageBreak(SCCOL nCol) const
Definition: table5.cxx:364
bool mbForceBreaks
Definition: table.hxx:255
bool ColHidden(SCCOL nCol, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: table5.cxx:555
void SetRepeatArea(SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow)
Definition: table5.cxx:1116
tools::Long GetTotalRowHeight(SCROW nStartRow, SCROW nEndRow, bool bHiddenAsZero=true) const
Definition: table5.cxx:772
void StartListening(const ScAddress &rAddress, SvtListener *pListener)
Definition: table5.cxx:1129
sal_uInt16 GetPrintRangeCount() const
Definition: table.hxx:816
SCROW FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow) const
Definition: table5.cxx:937
void InvalidateTextWidth(const ScAddress *pAdrFrom, const ScAddress *pAdrTo, bool bNumFormatChanged, bool bBroadcast)
Definition: table5.cxx:1213
bool IsProtected() const
Definition: table5.cxx:1094
void SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, bool bFiltered)
Definition: table5.cxx:929
bool HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const
Definition: table5.cxx:540
void RemoveRowBreak(SCROW nRow, bool bPage, bool bManual)
Definition: table5.cxx:404
void SetProtection(const ScTableProtection *pProtect)
Definition: table5.cxx:1096
bool HasFilteredRows(SCROW nStartRow, SCROW nEndRow) const
Definition: table5.cxx:877
bool RowHidden(SCROW nRow, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
Definition: table5.cxx:480
bool HasColManualBreak(SCCOL nCol) const
Definition: table5.cxx:380
void SetRowBreak(SCROW nRow, bool bPage, bool bManual)
Definition: table5.cxx:434
void RemoveManualBreaks()
Definition: table5.cxx:304
SCCOL nRepeatEndX
Definition: table.hxx:177
::std::set< SCROW > maRowManualBreaks
Definition: table.hxx:200
SCROW GetNextManualBreak(SCROW nRow) const
Get the row position of the next manual break that occurs at or below specified row.
Definition: table5.cxx:388
SCROW LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow) const
Definition: table5.cxx:960
std::unique_ptr< ScCompressedArray< SCCOL, sal_uInt16 > > mpColWidth
Definition: table.hxx:189
void CopyColFiltered(const ScTable &rTable, SCCOL nStartCol, SCCOL nEndCol)
Definition: table5.cxx:892
SCROW nRepeatStartY
Definition: table.hxx:178
bool InitColumnBlockPosition(sc::ColumnBlockPosition &rBlockPos, SCCOL nCol)
Definition: table2.cxx:712
void UpdatePageBreaks(const ScRange *pUserArea)
Definition: table5.cxx:52
std::unique_ptr< ScFlatBoolRowSegments > mpHiddenRows
Definition: table.hxx:195
SCTAB GetTab() const
Definition: table.hxx:291
bool RowFiltered(SCROW nRow, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
Definition: table5.cxx:841
std::unique_ptr< ScFlatUInt16RowSegments > mpRowHeights
Definition: table.hxx:190
SCROW CountVisibleRows(SCROW nStartRow, SCROW nEndRow) const
Definition: table5.cxx:751
void RemoveColBreak(SCCOL nCol, bool bPage, bool bManual)
Definition: table5.cxx:419
const ScTableProtection * GetProtection() const
Definition: table5.cxx:1106
ScDocument & rDocument
Definition: table.hxx:214
void SetColManualBreaks(::std::set< SCCOL > &&rBreaks)
Definition: table5.cxx:325
void CopyColHidden(const ScTable &rTable, SCCOL nStartCol, SCCOL nEndCol)
Definition: table5.cxx:656
bool HasManualBreaks() const
Definition: table5.cxx:313
bool IsManualRowHeight(SCROW nRow) const
Definition: table5.cxx:1004
ScDocument & GetDoc()
Definition: table.hxx:289
double GetValue(SCCOL nCol, SCROW nRow) const
Definition: table2.cxx:1798
const ScRange * GetPrintRange(sal_uInt16 nPos) const
Definition: table1.cxx:2333
std::unique_ptr< ScTableProtection > pTabProtection
Definition: table.hxx:187
void CopyRowHidden(const ScTable &rTable, SCROW nStartRow, SCROW nEndRow)
Definition: table5.cxx:671
::std::set< SCCOL > maColPageBreaks
Definition: table.hxx:201
bool HasRowManualBreak(SCROW nRow) const
Definition: table5.cxx:372
void SetPageStyle(const OUString &rName)
Definition: table5.cxx:1165
void SetRowManualBreaks(::std::set< SCROW > &&rBreaks)
Definition: table5.cxx:318
bool ValidRow(SCROW nRow) const
Definition: table.hxx:349
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All) const
virtual SfxItemSet & GetItemSet()
bool IsEmpty() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
int nCount
@ CELLTYPE_FORMULA
Definition: global.hxx:275
@ CELLTYPE_VALUE
Definition: global.hxx:273
CRFlags
Definition: global.hxx:125
#define TEXTWIDTH_DIRTY
Definition: globalnames.hxx:19
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
std::unique_ptr< sal_Int32[]> pData
constexpr OUStringLiteral aData
void copy(const fs::path &src, const fs::path &dest)
int i
long Long
sal_Int16 nId
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALE(175)
constexpr TypedWhichId< ScPageScaleToItem > ATTR_PAGE_SCALETO(188)
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALETOPAGES(176)
#define SC_MOD()
Definition: scmod.hxx:249
static SfxItemSet & rSet
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:108
ScFormulaCell * getFormula() const
Definition: cellvalue.hxx:137
bool isEmpty() const
Definition: cellvalue.cxx:667
CellType getType() const
Definition: cellvalue.hxx:133
Store position data for column array storage.
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17