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 < static_cast<SCTAB>(maTabs.size()) && 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 (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
227 maTabs[nTab]->StartListening( rAddress, pListener );
228}
229
231 SvtListener* pListener )
232{
233 OSL_ENSURE(pListener, "EndListeningCell: pListener Null");
234 SCTAB nTab = rAddress.Tab();
235 if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
236 maTabs[nTab]->EndListening( rAddress, pListener );
237}
238
240 sc::StartListeningContext& rCxt, const ScAddress& rPos, SvtListener& rListener )
241{
242 ScTable* pTab = FetchTable(rPos.Tab());
243 if (!pTab)
244 return;
245
246 pTab->StartListening(rCxt, rPos, rListener);
247}
248
250 sc::EndListeningContext& rCxt, const ScAddress& rPos, SvtListener& rListener )
251{
252 ScTable* pTab = FetchTable(rPos.Tab());
253 if (!pTab)
254 return;
255
256 pTab->EndListening(rCxt, rPos, rListener);
257}
258
259void ScDocument::EndListeningFormulaCells( std::vector<ScFormulaCell*>& rCells )
260{
261 if (rCells.empty())
262 return;
263
264 sc::EndListeningContext aCxt(*this);
265 for (auto& pCell : rCells)
266 pCell->EndListeningTo(aCxt);
267
269}
270
272{
273 OSL_ENSURE( pCell, "PutInFormulaTree: pCell Null" );
274 RemoveFromFormulaTree( pCell );
275 // append
277 if ( pEOFormulaTree )
278 pEOFormulaTree->SetNext( pCell );
279 else
280 pFormulaTree = pCell; // No end, no beginning...
281 pCell->SetPrevious( pEOFormulaTree );
282 pCell->SetNext( nullptr );
283 pEOFormulaTree = pCell;
285}
286
288{
290 OSL_ENSURE( pCell, "RemoveFromFormulaTree: pCell Null" );
291 ScFormulaCell* pPrev = pCell->GetPrevious();
292 assert(pPrev != pCell); // pointing to itself?!?
293 // if the cell is first or somewhere in chain
294 if ( pPrev || pFormulaTree == pCell )
295 {
296 ScFormulaCell* pNext = pCell->GetNext();
297 assert(pNext != pCell); // pointing to itself?!?
298 if ( pPrev )
299 {
300 assert(pFormulaTree != pCell); // if this cell is also head something's wrong
301 pPrev->SetNext( pNext ); // predecessor exists, set successor
302 }
303 else
304 {
305 pFormulaTree = pNext; // this cell was first cell
306 }
307 if ( pNext )
308 {
309 assert(pEOFormulaTree != pCell); // if this cell is also tail something's wrong
310 pNext->SetPrevious( pPrev ); // successor exists, set predecessor
311 }
312 else
313 {
314 pEOFormulaTree = pPrev; // this cell was last cell
315 }
316 pCell->SetPrevious( nullptr );
317 pCell->SetNext( nullptr );
318 sal_uInt16 nRPN = pCell->GetCode()->GetCodeLen();
319 if ( nFormulaCodeInTree >= nRPN )
320 nFormulaCodeInTree -= nRPN;
321 else
322 {
323 OSL_FAIL( "RemoveFromFormulaTree: nFormulaCodeInTree < nRPN" );
325 }
326 }
327 else if ( !pFormulaTree && nFormulaCodeInTree )
328 {
329 OSL_FAIL( "!pFormulaTree && nFormulaCodeInTree != 0" );
331 }
332}
333
334void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSetAllDirty )
335{
336 OSL_ENSURE( !IsCalculatingFormulaTree(), "CalcFormulaTree recursion" );
337 // never ever recurse into this, might end up lost in infinity
339 return ;
340
342 mpFormulaGroupCxt.reset();
344
346 bool bOldIdleEnabled = IsIdleEnabled();
347 EnableIdle(false);
348 bool bOldAutoCalc = GetAutoCalc();
349 //ATTENTION: _not_ SetAutoCalc( true ) because this might call CalcFormulaTree( true )
350 //ATTENTION: if it was disabled before and bHasForcedFormulas is set
351 bAutoCalc = true;
353 CalcAll();
354 else
355 {
356 ::std::vector<ScFormulaCell*> vAlwaysDirty;
358 while ( pCell )
359 {
360 if ( pCell->GetDirty() )
361 ; // nothing to do
362 else if ( pCell->GetCode()->IsRecalcModeAlways() )
363 {
364 // pCell and dependents are to be set dirty again, collect
365 // them first and broadcast afterwards to not break the
366 // FormulaTree chain here.
367 vAlwaysDirty.push_back( pCell);
368 }
369 else if ( bSetAllDirty )
370 {
371 // Force calculating all in tree, without broadcasting.
372 pCell->SetDirtyVar();
373 }
374 pCell = pCell->GetNext();
375 }
376 for (const auto& rpCell : vAlwaysDirty)
377 {
378 pCell = rpCell;
379 if (!pCell->GetDirty())
380 pCell->SetDirty();
381 }
382
383 bool bProgress = !bOnlyForced && nFormulaCodeInTree && bProgressBar;
384 if ( bProgress )
386
387 pCell = pFormulaTree;
388 ScFormulaCell* pLastNoGood = nullptr;
389 while ( pCell )
390 {
391 // Interpret resets bDirty and calls Remove, also the referenced!
392 // the Cell remains when ScRecalcMode::ALWAYS.
393 if ( bOnlyForced )
394 {
395 if ( pCell->GetCode()->IsRecalcModeForced() )
396 pCell->Interpret();
397 }
398 else
399 {
400 pCell->Interpret();
401 }
402 if ( pCell->GetPrevious() || pCell == pFormulaTree )
403 { // (IsInFormulaTree(pCell)) no Remove was called => next
404 pLastNoGood = pCell;
405 pCell = pCell->GetNext();
406 }
407 else
408 {
409 if ( pFormulaTree )
410 {
411 if ( pFormulaTree->GetDirty() && !bOnlyForced )
412 {
413 pCell = pFormulaTree;
414 pLastNoGood = nullptr;
415 }
416 else
417 {
418 // IsInFormulaTree(pLastNoGood)
419 if ( pLastNoGood && (pLastNoGood->GetPrevious() ||
420 pLastNoGood == pFormulaTree) )
421 pCell = pLastNoGood->GetNext();
422 else
423 {
424 pCell = pFormulaTree;
425 while ( pCell && !pCell->GetDirty() )
426 pCell = pCell->GetNext();
427 if ( pCell )
428 pLastNoGood = pCell->GetPrevious();
429 }
430 }
431 }
432 else
433 pCell = nullptr;
434 }
435 }
436 if ( bProgress )
438 }
439 bAutoCalc = bOldAutoCalc;
440 EnableIdle(bOldIdleEnabled);
442
443 mpFormulaGroupCxt.reset();
444}
445
447{
448 ScFormulaCell* pCell;
450 while ( pTree )
451 {
452 pCell = pTree;
453 pTree = pCell->GetNext();
454 if ( !pCell->GetCode()->IsRecalcModeAlways() )
455 RemoveFromFormulaTree( pCell );
456 }
457}
458
460{
461 OSL_ENSURE( pCell, "AppendToFormulaTrack: pCell Null" );
462 // The cell can not be in both lists at the same time
463 RemoveFromFormulaTrack( pCell );
464 RemoveFromFormulaTree( pCell );
465 if ( pEOFormulaTrack )
467 else
468 pFormulaTrack = pCell; // No end, no beginning...
470 pCell->SetNextTrack( nullptr );
471 pEOFormulaTrack = pCell;
473}
474
476{
477 OSL_ENSURE( pCell, "RemoveFromFormulaTrack: pCell Null" );
478 ScFormulaCell* pPrev = pCell->GetPreviousTrack();
479 assert(pPrev != pCell); // pointing to itself?!?
480 // if the cell is first or somewhere in chain
481 if ( !(pPrev || pFormulaTrack == pCell) )
482 return;
483
484 ScFormulaCell* pNext = pCell->GetNextTrack();
485 assert(pNext != pCell); // pointing to itself?!?
486 if ( pPrev )
487 {
488 assert(pFormulaTrack != pCell); // if this cell is also head something's wrong
489 pPrev->SetNextTrack( pNext ); // predecessor exists, set successor
490 }
491 else
492 {
493 pFormulaTrack = pNext; // this cell was first cell
494 }
495 if ( pNext )
496 {
497 assert(pEOFormulaTrack != pCell); // if this cell is also tail something's wrong
498 pNext->SetPreviousTrack( pPrev ); // successor exists, set predecessor
499 }
500 else
501 {
502 pEOFormulaTrack = pPrev; // this cell was last cell
503 }
504 pCell->SetPreviousTrack( nullptr );
505 pCell->SetNextTrack( nullptr );
507}
508
510{
513 {
514 ScBulkBroadcast aBulk( GetBASM(), nHintId);
515 // Collect all pending formula cells in bulk.
516 TrackFormulas( nHintId );
517 }
518 // A final round not in bulk to track all remaining formula cells and their
519 // dependents that were collected during ScBulkBroadcast dtor.
520 TrackFormulas( nHintId );
521 mbFinalTrackFormulas = false;
522}
523
524/*
525 The first is broadcasted,
526 the ones that are created through this are appended to the Track by Notify.
527 The next is broadcasted again, and so on.
528 View initiates Interpret.
529 */
531{
532 if (!pBASM)
533 return;
534
535 if (pBASM->IsInBulkBroadcast() && !IsFinalTrackFormulas() &&
536 (nHintId == SfxHintId::ScDataChanged || nHintId == SfxHintId::ScHiddenRowsChanged))
537 {
539 return;
540 }
541
542 if ( pFormulaTrack )
543 {
544 // outside the loop, check if any sheet has a "calculate" event script
545 bool bCalcEvent = HasAnySheetEventScript( ScSheetEventId::CALCULATE, true );
546 for( ScFormulaCell* pTrack = pFormulaTrack; pTrack != nullptr; pTrack = pTrack->GetNextTrack())
547 {
548 SCROW rowCount = 1;
549 ScAddress address = pTrack->aPos;
550 // Compress to include all adjacent cells in the same column.
551 for(ScFormulaCell* pNext = pTrack->GetNextTrack(); pNext != nullptr; pNext = pNext->GetNextTrack())
552 {
553 if(pNext->aPos != ScAddress(address.Col(), address.Row() + rowCount, address.Tab()))
554 break;
555 ++rowCount;
556 pTrack = pNext;
557 }
558 ScHint aHint( nHintId, address, rowCount );
559 BroadcastHintInternal( aHint );
560 pBASM->AreaBroadcast( aHint );
561 // for "calculate" event, keep track of which sheets are affected by tracked formulas
562 if ( bCalcEvent )
563 SetCalcNotification( address.Tab() );
564 }
565 bool bHaveForced = false;
566 for( ScFormulaCell* pTrack = pFormulaTrack; pTrack != nullptr;)
567 {
568 ScFormulaCell* pNext = pTrack->GetNextTrack();
569 RemoveFromFormulaTrack( pTrack );
570 PutInFormulaTree( pTrack );
571 if ( pTrack->GetCode()->IsRecalcModeForced() )
572 bHaveForced = true;
573 pTrack = pNext;
574 }
575 if ( bHaveForced )
576 {
577 SetForcedFormulas( true );
580 CalcFormulaTree( true );
581 else
583 }
584 }
585 OSL_ENSURE( nFormulaTrackCount==0, "TrackFormulas: nFormulaTrackCount!=0" );
586}
587
589{
590 sc::StartListeningContext aCxt(*this);
591 for ( auto const & i: maTabs )
592 if ( i )
593 i->StartListeners(aCxt, true);
594}
595
597 const ScRange& rRange, SCCOL nDx, SCROW nDy, SCTAB nDz
598 )
599{
600 bool bExpandRefsOld = IsExpandRefs();
601 if ( eUpdateRefMode == URM_INSDEL && (nDx > 0 || nDy > 0 || nDz > 0) )
602 SetExpandRefs( SC_MOD()->GetInputOptions().GetExpandRefs() );
603 if ( pBASM )
604 pBASM->UpdateBroadcastAreas( eUpdateRefMode, rRange, nDx, nDy, nDz );
605 SetExpandRefs( bExpandRefsOld );
606}
607
608void ScDocument::SetAutoCalc( bool bNewAutoCalc )
609{
610 bool bOld = bAutoCalc;
611 bAutoCalc = bNewAutoCalc;
612 if ( !bOld && bNewAutoCalc && bHasForcedFormulas )
613 {
616 else if ( !IsInInterpreter() )
617 CalcFormulaTree( true );
618 }
619}
620
621/* 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:588
void TrackFormulas(SfxHintId nHintId=SfxHintId::ScDataChanged)
Definition: documen7.cxx:530
void FinalTrackFormulas(SfxHintId nHintId)
Definition: documen7.cxx:509
bool IsCalculatingFormulaTree() const
Definition: document.hxx:1419
bool bAutoCalc
Definition: document.hxx:486
void SetTrackFormulasPending()
Definition: document.hxx:2389
bool BroadcastHintInternal(const ScHint &rHint)
Definition: documen7.cxx:137
ScFormulaCell * pFormulaTree
Definition: document.hxx:385
SvtBroadcaster * GetBroadcaster(const ScAddress &rPos)
Definition: document.cxx:2493
ScTable * FetchTable(SCTAB nTab)
Definition: document.cxx:2544
bool IsFinalTrackFormulas() const
Definition: document.hxx:2392
bool IsIdleEnabled() const
Definition: document.hxx:2202
void EndListeningArea(const ScRange &rRange, bool bGroupListening, SvtListener *pListener)
Definition: documen7.cxx:61
bool mbFinalTrackFormulas
Definition: document.hxx:570
void SetExpandRefs(bool bVal)
Definition: documen2.cxx:327
void SetCalcNotification(SCTAB nTab)
Definition: documen3.cxx:730
std::unique_ptr< ScBroadcastAreaSlotMachine > pBASM
Definition: document.hxx:389
void RemoveFromFormulaTree(ScFormulaCell *pCell)
Definition: documen7.cxx:287
void BroadcastCells(const ScRange &rRange, SfxHintId nHint, bool bBroadcastSingleBroadcasters=true)
Definition: documen7.cxx:158
bool bHasForcedFormulas
Definition: document.hxx:512
void PrepareFormulaCalc()
Call this before any operations that might trigger one or more formula cells to get calculated.
Definition: document.cxx:2487
ScFormulaCell * pEOFormulaTree
Definition: document.hxx:386
bool mbTrackFormulasPending
Definition: document.hxx:569
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:1411
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:334
TableContainer maTabs
Definition: document.hxx:377
void DelBroadcastAreasInRange(const ScRange &rRange)
Definition: documen7.cxx:215
ScBroadcastAreaSlotMachine * GetBASM() const
Definition: document.hxx:2226
void RemoveFromFormulaTrack(ScFormulaCell *pCell)
Definition: documen7.cxx:475
HardRecalcState eHardRecalcState
Definition: document.hxx:479
@ 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:259
void EndListeningCell(const ScAddress &rAddress, SvtListener *pListener)
Definition: documen7.cxx:230
void EnableIdle(bool bDo)
Definition: document.hxx:2203
void UpdateBroadcastAreas(UpdateRefMode eUpdateRefMode, const ScRange &rRange, SCCOL nDx, SCROW nDy, SCTAB nDz)
Definition: documen7.cxx:596
bool IsInInterpreter() const
Definition: document.hxx:2405
void AppendToFormulaTrack(ScFormulaCell *pCell)
Definition: documen7.cxx:459
sal_uInt64 nFormulaCodeInTree
Definition: document.hxx:460
sal_uInt16 nFormulaTrackCount
Definition: document.hxx:478
bool IsExpandRefs() const
Definition: document.hxx:2450
bool HasAnySheetEventScript(ScSheetEventId nEvent, bool bWithVbaEvents=false) const
Definition: documen3.cxx:705
void SetForcedFormulas(bool bVal)
Definition: document.hxx:2402
void ClearFormulaTree()
Definition: documen7.cxx:446
SC_DLLPUBLIC void SetAutoCalc(bool bNewAutoCalc)
Definition: documen7.cxx:608
SC_DLLPUBLIC void CalcAll()
Definition: document.cxx:3996
bool bCalculatingFormulaTree
Definition: document.hxx:492
bool IsAutoCalcShellDisabled() const
Definition: document.hxx:1414
ScFormulaCell * pEOFormulaTrack
Definition: document.hxx:388
void PutInFormulaTree(ScFormulaCell *pCell)
Definition: documen7.cxx:271
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:362
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:1416
void BroadcastUno(const SfxHint &rHint)
Definition: documen3.cxx:958
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:316
ScFormulaCell * pFormulaTrack
Definition: document.hxx:387
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:154
static void CreateInterpretProgress(ScDocument *pDoc, bool bWait=true)
Definition: progress.cxx:134
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
void EndListening(const ScAddress &rAddress, SvtListener *pListener)
Definition: table5.cxx:1137
void SetStreamValid(bool bSet, bool bIgnoreLock=false)
Definition: table1.cxx:374
void StartListening(const ScAddress &rAddress, SvtListener *pListener)
Definition: table5.cxx:1129
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:2162
SfxHintId GetId() const
void Broadcast(const SfxHint &rHint)
bool IsRecalcModeAlways() const
bool IsRecalcModeForced() const
sal_uInt16 GetCodeLen() const
@ CORE
Definition: document.hxx:316
UpdateRefMode
Definition: global.hxx:300
@ URM_INSDEL
Definition: global.hxx:301
SfxHintId
uno_Any a
#define SAL_WARN(area, stream)
int i
#define SC_MOD()
Definition: scmod.hxx:249
A pretty assertion that checks that the relevant bits in the @nFlags are not set on the document at e...
Definition: document.hxx:2758
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17