LibreOffice Module sc (master) 1
documen7.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 <sal/log.hxx>
21#include <osl/diagnose.h>
22
23#include <document.hxx>
24#include <brdcst.hxx>
25#include <bcaslot.hxx>
26#include <formulacell.hxx>
27#include <table.hxx>
28#include <progress.hxx>
29#include <scmod.hxx>
30#include <inputopt.hxx>
31#include <sheetevents.hxx>
32#include <tokenarray.hxx>
33#include <listenercontext.hxx>
34
36 const ScRange& rRange, bool bGroupListening, SvtListener* pListener )
37{
38 if (!pBASM)
39 return;
40
41 // Ensure sane ranges for the slots, specifically don't attempt to listen
42 // to more sheets than the document has. The slot machine handles it but
43 // with memory waste. Binary import filters can set out-of-bounds ranges
44 // in formula expressions' references, so all middle layers would have to
45 // check it, rather have this central point here.
46 ScRange aLimitedRange( ScAddress::UNINITIALIZED );
47 bool bEntirelyOut;
48 if (!LimitRangeToAvailableSheets( rRange, aLimitedRange, bEntirelyOut))
49 {
50 pBASM->StartListeningArea(rRange, bGroupListening, pListener);
51 return;
52 }
53
54 // If both sheets are out-of-bounds in the same direction then just bail out.
55 if (bEntirelyOut)
56 return;
57
58 pBASM->StartListeningArea( aLimitedRange, bGroupListening, pListener);
59}
60
61void ScDocument::EndListeningArea( const ScRange& rRange, bool bGroupListening, SvtListener* pListener )
62{
63 if (!pBASM)
64 return;
65
66 // End listening has to limit the range exactly the same as in
67 // StartListeningArea(), otherwise the range would not be found.
68 ScRange aLimitedRange( ScAddress::UNINITIALIZED );
69 bool bEntirelyOut;
70 if (!LimitRangeToAvailableSheets( rRange, aLimitedRange, bEntirelyOut))
71 {
72 pBASM->EndListeningArea(rRange, bGroupListening, pListener);
73 return;
74 }
75
76 // If both sheets are out-of-bounds in the same direction then just bail out.
77 if (bEntirelyOut)
78 return;
79
80 pBASM->EndListeningArea( aLimitedRange, bGroupListening, pListener);
81}
82
84 bool& o_bEntirelyOutOfBounds ) const
85{
86 const SCTAB nMaxTab = GetTableCount() - 1;
87 if (ValidTab( rRange.aStart.Tab(), nMaxTab) && ValidTab( rRange.aEnd.Tab(), nMaxTab))
88 return false;
89
90 // Originally BCA_LISTEN_ALWAYS uses an implicit tab 0 and should had been
91 // valid already, but in case that would change...
92 if (rRange == BCA_LISTEN_ALWAYS)
93 return false;
94
95 SCTAB nTab1 = rRange.aStart.Tab();
96 SCTAB nTab2 = rRange.aEnd.Tab();
97 SAL_WARN("sc.core","ScDocument::LimitRangeToAvailableSheets - bad sheet range: " << nTab1 << ".." << nTab2 <<
98 ", sheets: 0.." << nMaxTab);
99
100 // Both sheets are out-of-bounds in the same direction.
101 if ((nTab1 < 0 && nTab2 < 0) || (nMaxTab < nTab1 && nMaxTab < nTab2))
102 {
103 o_bEntirelyOutOfBounds = true;
104 return true;
105 }
106
107 // Limit the sheet range to bounds.
108 o_bEntirelyOutOfBounds = false;
109 nTab1 = std::clamp<SCTAB>( nTab1, 0, nMaxTab);
110 nTab2 = std::clamp<SCTAB>( nTab2, 0, nMaxTab);
111 o_rRange = rRange;
112 o_rRange.aStart.SetTab(nTab1);
113 o_rRange.aEnd.SetTab(nTab2);
114 return true;
115}
116
117void ScDocument::Broadcast( const ScHint& rHint )
118{
119 if ( !pBASM )
120 return ; // Clipboard or Undo
122 {
123 ScBulkBroadcast aBulkBroadcast( pBASM.get(), rHint.GetId()); // scoped bulk broadcast
124 bool bIsBroadcasted = BroadcastHintInternal(rHint);
125 if ( pBASM->AreaBroadcast( rHint ) || bIsBroadcasted )
126 TrackFormulas( rHint.GetId() );
127 }
128
129 if ( rHint.GetStartAddress() != BCA_BRDCST_ALWAYS )
130 {
131 SCTAB nTab = rHint.GetStartAddress().Tab();
132 if (nTab < GetTableCount() && maTabs[nTab])
133 maTabs[nTab]->SetStreamValid(false);
134 }
135}
136
138{
139 bool bIsBroadcasted = false;
140 const ScAddress address(rHint.GetStartAddress());
141 SvtBroadcaster* pLastBC = nullptr;
142 // Process all broadcasters for the given row range.
143 for( SCROW nRow = 0; nRow < rHint.GetRowCount(); ++nRow )
144 {
145 ScAddress a(address);
146 a.SetRow(address.Row() + nRow);
148 if ( pBC && pBC != pLastBC )
149 {
150 pBC->Broadcast( rHint );
151 bIsBroadcasted = true;
152 pLastBC = pBC;
153 }
154 }
155 return bIsBroadcasted;
156}
157
158void ScDocument::BroadcastCells( const ScRange& rRange, SfxHintId nHint, bool bBroadcastSingleBroadcasters )
159{
161
162 if (!pBASM)
163 return; // Clipboard or Undo
164
165 SCTAB nTab1 = rRange.aStart.Tab();
166 SCTAB nTab2 = rRange.aEnd.Tab();
167 SCROW nRow1 = rRange.aStart.Row();
168 SCROW nRow2 = rRange.aEnd.Row();
169 SCCOL nCol1 = rRange.aStart.Col();
170 SCCOL nCol2 = rRange.aEnd.Col();
171
173 {
174 ScBulkBroadcast aBulkBroadcast( pBASM.get(), nHint); // scoped bulk broadcast
175 bool bIsBroadcasted = false;
176
177 if (bBroadcastSingleBroadcasters)
178 {
179 for (SCTAB nTab = nTab1; nTab <= nTab2; ++nTab)
180 {
181 ScTable* pTab = FetchTable(nTab);
182 if (!pTab)
183 continue;
184
185 bIsBroadcasted |= pTab->BroadcastBroadcasters( nCol1, nRow1, nCol2, nRow2, nHint);
186 }
187 }
188
189 if (pBASM->AreaBroadcast(rRange, nHint) || bIsBroadcasted)
190 TrackFormulas(nHint);
191 }
192
193 for (SCTAB nTab = nTab1; nTab <= nTab2; ++nTab)
194 {
195 ScTable* pTab = FetchTable(nTab);
196 if (pTab)
197 pTab->SetStreamValid(false);
198 }
199
200 BroadcastUno(SfxHint(SfxHintId::ScDataChanged));
201}
202
204{
205 if ( !pBASM )
206 return ; // Clipboard or Undo
208 {
209 ScBulkBroadcast aBulkBroadcast( pBASM.get(), rHint.GetId()); // scoped bulk broadcast
210 if ( pBASM->AreaBroadcast( rHint ) )
211 TrackFormulas( rHint.GetId() );
212 }
213}
214
216{
217 if ( pBASM )
218 pBASM->DelBroadcastAreasInRange( rRange );
219}
220
222 SvtListener* pListener )
223{
224 OSL_ENSURE(pListener, "StartListeningCell: pListener Null");
225 SCTAB nTab = rAddress.Tab();
226 if (ScTable* pTable = FetchTable(nTab))
227 pTable->StartListening(rAddress, pListener);
228}
229
231 SvtListener* pListener )
232{
233 OSL_ENSURE(pListener, "EndListeningCell: pListener Null");
234 SCTAB nTab = rAddress.Tab();
235 if (ScTable* pTable = FetchTable(nTab))
236 pTable->EndListening( rAddress, pListener );
237}
238
240 sc::StartListeningContext& rCxt, const ScAddress& rPos, SvtListener& rListener )
241{
242 if (ScTable* pTable = FetchTable(rPos.Tab()))
243 pTable->StartListening(rCxt, rPos, rListener);
244}
245
247 sc::EndListeningContext& rCxt, const ScAddress& rPos, SvtListener& rListener )
248{
249 if (ScTable* pTable = FetchTable(rPos.Tab()))
250 pTable->EndListening(rCxt, rPos, rListener);
251}
252
253void ScDocument::EndListeningFormulaCells( std::vector<ScFormulaCell*>& rCells )
254{
255 if (rCells.empty())
256 return;
257
258 sc::EndListeningContext aCxt(*this);
259 for (auto& pCell : rCells)
260 pCell->EndListeningTo(aCxt);
261
263}
264
266{
267 OSL_ENSURE( pCell, "PutInFormulaTree: pCell Null" );
268 RemoveFromFormulaTree( pCell );
269 // append
271 if ( pEOFormulaTree )
272 pEOFormulaTree->SetNext( pCell );
273 else
274 pFormulaTree = pCell; // No end, no beginning...
275 pCell->SetPrevious( pEOFormulaTree );
276 pCell->SetNext( nullptr );
277 pEOFormulaTree = pCell;
279}
280
282{
284 OSL_ENSURE( pCell, "RemoveFromFormulaTree: pCell Null" );
285 ScFormulaCell* pPrev = pCell->GetPrevious();
286 assert(pPrev != pCell); // pointing to itself?!?
287 // if the cell is first or somewhere in chain
288 if ( pPrev || pFormulaTree == pCell )
289 {
290 ScFormulaCell* pNext = pCell->GetNext();
291 assert(pNext != pCell); // pointing to itself?!?
292 if ( pPrev )
293 {
294 assert(pFormulaTree != pCell); // if this cell is also head something's wrong
295 pPrev->SetNext( pNext ); // predecessor exists, set successor
296 }
297 else
298 {
299 pFormulaTree = pNext; // this cell was first cell
300 }
301 if ( pNext )
302 {
303 assert(pEOFormulaTree != pCell); // if this cell is also tail something's wrong
304 pNext->SetPrevious( pPrev ); // successor exists, set predecessor
305 }
306 else
307 {
308 pEOFormulaTree = pPrev; // this cell was last cell
309 }
310 pCell->SetPrevious( nullptr );
311 pCell->SetNext( nullptr );
312 sal_uInt16 nRPN = pCell->GetCode()->GetCodeLen();
313 if ( nFormulaCodeInTree >= nRPN )
314 nFormulaCodeInTree -= nRPN;
315 else
316 {
317 OSL_FAIL( "RemoveFromFormulaTree: nFormulaCodeInTree < nRPN" );
319 }
320 }
321 else if ( !pFormulaTree && nFormulaCodeInTree )
322 {
323 OSL_FAIL( "!pFormulaTree && nFormulaCodeInTree != 0" );
325 }
326}
327
328void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSetAllDirty )
329{
330 OSL_ENSURE( !IsCalculatingFormulaTree(), "CalcFormulaTree recursion" );
331 // never ever recurse into this, might end up lost in infinity
333 return ;
334
336 mpFormulaGroupCxt.reset();
338
340 bool bOldIdleEnabled = IsIdleEnabled();
341 EnableIdle(false);
342 bool bOldAutoCalc = GetAutoCalc();
343 //ATTENTION: _not_ SetAutoCalc( true ) because this might call CalcFormulaTree( true )
344 //ATTENTION: if it was disabled before and bHasForcedFormulas is set
345 bAutoCalc = true;
347 CalcAll();
348 else
349 {
350 ::std::vector<ScFormulaCell*> vAlwaysDirty;
352 while ( pCell )
353 {
354 if ( pCell->GetDirty() )
355 ; // nothing to do
356 else if ( pCell->GetCode()->IsRecalcModeAlways() )
357 {
358 // pCell and dependents are to be set dirty again, collect
359 // them first and broadcast afterwards to not break the
360 // FormulaTree chain here.
361 vAlwaysDirty.push_back( pCell);
362 }
363 else if ( bSetAllDirty )
364 {
365 // Force calculating all in tree, without broadcasting.
366 pCell->SetDirtyVar();
367 }
368 pCell = pCell->GetNext();
369 }
370 for (const auto& rpCell : vAlwaysDirty)
371 {
372 pCell = rpCell;
373 if (!pCell->GetDirty())
374 pCell->SetDirty();
375 }
376
377 bool bProgress = !bOnlyForced && nFormulaCodeInTree && bProgressBar;
378 if ( bProgress )
380
381 pCell = pFormulaTree;
382 ScFormulaCell* pLastNoGood = nullptr;
383 while ( pCell )
384 {
385 // Interpret resets bDirty and calls Remove, also the referenced!
386 // the Cell remains when ScRecalcMode::ALWAYS.
387 if ( bOnlyForced )
388 {
389 if ( pCell->GetCode()->IsRecalcModeForced() )
390 pCell->Interpret();
391 }
392 else
393 {
394 pCell->Interpret();
395 }
396 if ( pCell->GetPrevious() || pCell == pFormulaTree )
397 { // (IsInFormulaTree(pCell)) no Remove was called => next
398 pLastNoGood = pCell;
399 pCell = pCell->GetNext();
400 }
401 else
402 {
403 if ( pFormulaTree )
404 {
405 if ( pFormulaTree->GetDirty() && !bOnlyForced )
406 {
407 pCell = pFormulaTree;
408 pLastNoGood = nullptr;
409 }
410 else
411 {
412 // IsInFormulaTree(pLastNoGood)
413 if ( pLastNoGood && (pLastNoGood->GetPrevious() ||
414 pLastNoGood == pFormulaTree) )
415 pCell = pLastNoGood->GetNext();
416 else
417 {
418 pCell = pFormulaTree;
419 while ( pCell && !pCell->GetDirty() )
420 pCell = pCell->GetNext();
421 if ( pCell )
422 pLastNoGood = pCell->GetPrevious();
423 }
424 }
425 }
426 else
427 pCell = nullptr;
428 }
429 }
430 if ( bProgress )
432 }
433 bAutoCalc = bOldAutoCalc;
434 EnableIdle(bOldIdleEnabled);
436
437 mpFormulaGroupCxt.reset();
438}
439
441{
442 ScFormulaCell* pCell;
444 while ( pTree )
445 {
446 pCell = pTree;
447 pTree = pCell->GetNext();
448 if ( !pCell->GetCode()->IsRecalcModeAlways() )
449 RemoveFromFormulaTree( pCell );
450 }
451}
452
454{
455 OSL_ENSURE( pCell, "AppendToFormulaTrack: pCell Null" );
456 // The cell can not be in both lists at the same time
457 RemoveFromFormulaTrack( pCell );
458 RemoveFromFormulaTree( pCell );
459 if ( pEOFormulaTrack )
461 else
462 pFormulaTrack = pCell; // No end, no beginning...
464 pCell->SetNextTrack( nullptr );
465 pEOFormulaTrack = pCell;
467}
468
470{
471 OSL_ENSURE( pCell, "RemoveFromFormulaTrack: pCell Null" );
472 ScFormulaCell* pPrev = pCell->GetPreviousTrack();
473 assert(pPrev != pCell); // pointing to itself?!?
474 // if the cell is first or somewhere in chain
475 if ( !(pPrev || pFormulaTrack == pCell) )
476 return;
477
478 ScFormulaCell* pNext = pCell->GetNextTrack();
479 assert(pNext != pCell); // pointing to itself?!?
480 if ( pPrev )
481 {
482 assert(pFormulaTrack != pCell); // if this cell is also head something's wrong
483 pPrev->SetNextTrack( pNext ); // predecessor exists, set successor
484 }
485 else
486 {
487 pFormulaTrack = pNext; // this cell was first cell
488 }
489 if ( pNext )
490 {
491 assert(pEOFormulaTrack != pCell); // if this cell is also tail something's wrong
492 pNext->SetPreviousTrack( pPrev ); // successor exists, set predecessor
493 }
494 else
495 {
496 pEOFormulaTrack = pPrev; // this cell was last cell
497 }
498 pCell->SetPreviousTrack( nullptr );
499 pCell->SetNextTrack( nullptr );
501}
502
504{
507 {
508 ScBulkBroadcast aBulk( GetBASM(), nHintId);
509 // Collect all pending formula cells in bulk.
510 TrackFormulas( nHintId );
511 }
512 // A final round not in bulk to track all remaining formula cells and their
513 // dependents that were collected during ScBulkBroadcast dtor.
514 TrackFormulas( nHintId );
515 mbFinalTrackFormulas = false;
516}
517
518/*
519 The first is broadcasted,
520 the ones that are created through this are appended to the Track by Notify.
521 The next is broadcasted again, and so on.
522 View initiates Interpret.
523 */
525{
526 if (!pBASM)
527 return;
528
529 if (pBASM->IsInBulkBroadcast() && !IsFinalTrackFormulas() &&
530 (nHintId == SfxHintId::ScDataChanged || nHintId == SfxHintId::ScHiddenRowsChanged))
531 {
533 return;
534 }
535
536 if ( pFormulaTrack )
537 {
538 // outside the loop, check if any sheet has a "calculate" event script
539 bool bCalcEvent = HasAnySheetEventScript( ScSheetEventId::CALCULATE, true );
540 for( ScFormulaCell* pTrack = pFormulaTrack; pTrack != nullptr; pTrack = pTrack->GetNextTrack())
541 {
542 SCROW rowCount = 1;
543 ScAddress address = pTrack->aPos;
544 // Compress to include all adjacent cells in the same column.
545 for(ScFormulaCell* pNext = pTrack->GetNextTrack(); pNext != nullptr; pNext = pNext->GetNextTrack())
546 {
547 if(pNext->aPos != ScAddress(address.Col(), address.Row() + rowCount, address.Tab()))
548 break;
549 ++rowCount;
550 pTrack = pNext;
551 }
552 ScHint aHint( nHintId, address, rowCount );
553 BroadcastHintInternal( aHint );
554 pBASM->AreaBroadcast( aHint );
555 // for "calculate" event, keep track of which sheets are affected by tracked formulas
556 if ( bCalcEvent )
557 SetCalcNotification( address.Tab() );
558 }
559 bool bHaveForced = false;
560 for( ScFormulaCell* pTrack = pFormulaTrack; pTrack != nullptr;)
561 {
562 ScFormulaCell* pNext = pTrack->GetNextTrack();
563 RemoveFromFormulaTrack( pTrack );
564 PutInFormulaTree( pTrack );
565 if ( pTrack->GetCode()->IsRecalcModeForced() )
566 bHaveForced = true;
567 pTrack = pNext;
568 }
569 if ( bHaveForced )
570 {
571 SetForcedFormulas( true );
574 CalcFormulaTree( true );
575 else
577 }
578 }
579 OSL_ENSURE( nFormulaTrackCount==0, "TrackFormulas: nFormulaTrackCount!=0" );
580}
581
583{
584 sc::StartListeningContext aCxt(*this);
585 for ( auto const & i: maTabs )
586 if ( i )
587 i->StartListeners(aCxt, true);
588}
589
591 const ScRange& rRange, SCCOL nDx, SCROW nDy, SCTAB nDz
592 )
593{
594 bool bExpandRefsOld = IsExpandRefs();
595 if ( eUpdateRefMode == URM_INSDEL && (nDx > 0 || nDy > 0 || nDz > 0) )
596 SetExpandRefs( SC_MOD()->GetInputOptions().GetExpandRefs() );
597 if ( pBASM )
598 pBASM->UpdateBroadcastAreas( eUpdateRefMode, rRange, nDx, nDy, nDz );
599 SetExpandRefs( bExpandRefsOld );
600}
601
602void ScDocument::SetAutoCalc( bool bNewAutoCalc )
603{
604 bool bOld = bAutoCalc;
605 bAutoCalc = bNewAutoCalc;
606 if ( !bOld && bNewAutoCalc && bHasForcedFormulas )
607 {
610 else if ( !IsInInterpreter() )
611 CalcFormulaTree( true );
612 }
613}
614
615/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool ValidTab(SCTAB nTab)
Definition: address.hxx:111
#define BCA_LISTEN_ALWAYS
Definition: address.hxx:945
#define BCA_BRDCST_ALWAYS
Definition: address.hxx:944
@ UNINITIALIZED
Definition: address.hxx:220
SCTAB Tab() const
Definition: address.hxx:283
SCROW Row() const
Definition: address.hxx:274
void SetTab(SCTAB nTabP)
Definition: address.hxx:295
SCCOL Col() const
Definition: address.hxx:279
void StartAllListeners()
Definition: documen7.cxx:582
void TrackFormulas(SfxHintId nHintId=SfxHintId::ScDataChanged)
Definition: documen7.cxx:524
void FinalTrackFormulas(SfxHintId nHintId)
Definition: documen7.cxx:503
bool IsCalculatingFormulaTree() const
Definition: document.hxx:1421
bool bAutoCalc
Definition: document.hxx:487
void SetTrackFormulasPending()
Definition: document.hxx:2396
bool BroadcastHintInternal(const ScHint &rHint)
Definition: documen7.cxx:137
ScFormulaCell * pFormulaTree
Definition: document.hxx:386
SvtBroadcaster * GetBroadcaster(const ScAddress &rPos)
Definition: document.cxx:2464
SC_DLLPUBLIC ScTable * FetchTable(SCTAB nTab)
Definition: document.cxx:2509
bool IsFinalTrackFormulas() const
Definition: document.hxx:2399
bool IsIdleEnabled() const
Definition: document.hxx:2207
void EndListeningArea(const ScRange &rRange, bool bGroupListening, SvtListener *pListener)
Definition: documen7.cxx:61
bool mbFinalTrackFormulas
Definition: document.hxx:571
void SetExpandRefs(bool bVal)
Definition: documen2.cxx:327
void SetCalcNotification(SCTAB nTab)
Definition: documen3.cxx:722
std::unique_ptr< ScBroadcastAreaSlotMachine > pBASM
Definition: document.hxx:390
void RemoveFromFormulaTree(ScFormulaCell *pCell)
Definition: documen7.cxx:281
void BroadcastCells(const ScRange &rRange, SfxHintId nHint, bool bBroadcastSingleBroadcasters=true)
Definition: documen7.cxx:158
bool bHasForcedFormulas
Definition: document.hxx:513
void PrepareFormulaCalc()
Call this before any operations that might trigger one or more formula cells to get calculated.
Definition: document.cxx:2458
ScFormulaCell * pEOFormulaTree
Definition: document.hxx:387
bool mbTrackFormulasPending
Definition: document.hxx:570
void Broadcast(const ScHint &rHint)
Broadcast wrapper, calls rHint.GetCell()->Broadcast() and AreaBroadcast() and TrackFormulas() Preferr...
Definition: documen7.cxx:117
SC_DLLPUBLIC bool GetAutoCalc() const
Definition: document.hxx:1413
SC_DLLPUBLIC void CalcFormulaTree(bool bOnlyForced=false, bool bProgressBar=true, bool bSetAllDirty=true)
Calculate formula cells that are on the formula tree either partially, or in full.
Definition: documen7.cxx:328
TableContainer maTabs
Definition: document.hxx:378
void DelBroadcastAreasInRange(const ScRange &rRange)
Definition: documen7.cxx:215
ScBroadcastAreaSlotMachine * GetBASM() const
Definition: document.hxx:2231
void RemoveFromFormulaTrack(ScFormulaCell *pCell)
Definition: documen7.cxx:469
HardRecalcState eHardRecalcState
Definition: document.hxx:480
@ ETERNAL
CalcAll() without broadcast/notify but setting up new listeners.
void StartListeningArea(const ScRange &rRange, bool bGroupListening, SvtListener *pListener)
Definition: documen7.cxx:35
void EndListeningFormulaCells(std::vector< ScFormulaCell * > &rCells)
Definition: documen7.cxx:253
void EndListeningCell(const ScAddress &rAddress, SvtListener *pListener)
Definition: documen7.cxx:230
void EnableIdle(bool bDo)
Definition: document.hxx:2208
void UpdateBroadcastAreas(UpdateRefMode eUpdateRefMode, const ScRange &rRange, SCCOL nDx, SCROW nDy, SCTAB nDz)
Definition: documen7.cxx:590
bool IsInInterpreter() const
Definition: document.hxx:2412
void AppendToFormulaTrack(ScFormulaCell *pCell)
Definition: documen7.cxx:453
sal_uInt64 nFormulaCodeInTree
Definition: document.hxx:461
sal_uInt16 nFormulaTrackCount
Definition: document.hxx:479
bool IsExpandRefs() const
Definition: document.hxx:2457
bool HasAnySheetEventScript(ScSheetEventId nEvent, bool bWithVbaEvents=false) const
Definition: documen3.cxx:697
void SetForcedFormulas(bool bVal)
Definition: document.hxx:2409
void ClearFormulaTree()
Definition: documen7.cxx:440
SC_DLLPUBLIC void SetAutoCalc(bool bNewAutoCalc)
Definition: documen7.cxx:602
SC_DLLPUBLIC void CalcAll()
Definition: document.cxx:3939
bool bCalculatingFormulaTree
Definition: document.hxx:493
bool IsAutoCalcShellDisabled() const
Definition: document.hxx:1416
ScFormulaCell * pEOFormulaTrack
Definition: document.hxx:389
void PutInFormulaTree(ScFormulaCell *pCell)
Definition: documen7.cxx:265
bool LimitRangeToAvailableSheets(const ScRange &rRange, ScRange &o_rRange, bool &o_bEntirelyOutOfBounds) const
Adjust a range to available sheets.
Definition: documen7.cxx:83
std::shared_ptr< sc::FormulaGroupContext > mpFormulaGroupCxt
Definition: document.hxx:363
void AreaBroadcast(const ScHint &rHint)
only area, no cell broadcast
Definition: documen7.cxx:203
void StartListeningCell(const ScAddress &rAddress, SvtListener *pListener)
Definition: documen7.cxx:221
void SetForcedFormulaPending(bool bNew)
Definition: document.hxx:1418
void BroadcastUno(const SfxHint &rHint)
Definition: documen3.cxx:952
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:297
ScFormulaCell * pFormulaTrack
Definition: document.hxx:388
ScFormulaCell * GetNext() const
ScFormulaCell * GetPrevious() const
void SetPreviousTrack(ScFormulaCell *pF)
bool GetDirty() const
void SetNext(ScFormulaCell *pF)
ScFormulaCell * GetNextTrack() const
void SetPrevious(ScFormulaCell *pF)
void SetDirty(bool bDirtyFlag=true)
ScTokenArray * GetCode()
bool Interpret(SCROW nStartOffset=-1, SCROW nEndOffset=-1)
void SetNextTrack(ScFormulaCell *pF)
ScFormulaCell * GetPreviousTrack() const
SCROW GetRowCount() const
Definition: brdcst.hxx:32
const ScAddress & GetStartAddress() const
Definition: brdcst.hxx:31
static void DeleteInterpretProgress()
Definition: progress.cxx:152
static void CreateInterpretProgress(ScDocument *pDoc, bool bWait=true)
Definition: progress.cxx:132
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
void SetStreamValid(bool bSet, bool bIgnoreLock=false)
Definition: table1.cxx:382
bool BroadcastBroadcasters(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SfxHintId nHint)
Broadcast single broadcasters in range, without explicitly setting anything dirty,...
Definition: table2.cxx:2163
SfxHintId GetId() const
void Broadcast(const SfxHint &rHint)
bool IsRecalcModeAlways() const
bool IsRecalcModeForced() const
sal_uInt16 GetCodeLen() const
@ CORE
Definition: document.hxx:317
UpdateRefMode
Definition: global.hxx:301
@ URM_INSDEL
Definition: global.hxx:302
SfxHintId
uno_Any a
#define SAL_WARN(area, stream)
int i
#define SC_MOD()
Definition: scmod.hxx:247
A pretty assertion that checks that the relevant bits in the @nFlags are not set on the document at e...
Definition: document.hxx:2761
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17