if ( pGlobalProgress || SfxProgress::GetActiveProgress() )
{ if ( lcl_IsHiddenDocument(pObjSh) )
{ // loading a hidden document while a progress is active is possible - no error
pProgress = nullptr;
} else
{
OSL_FAIL( "ScProgress: there can be only one!" );
pProgress = nullptr;
}
} elseif ( SfxGetpApp()->IsDowning() )
{ // This happens. E.g. when saving the clipboard-content as OLE when closing the app. // In this case a SfxProgress would produce dirt in memory. //TODO: Should that be this way ???
pProgress = nullptr;
} elseif ( pObjSh && ( pObjSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ||
pObjSh->GetProgress() ||
lcl_HasControllersLocked(*pObjSh) ) )
{ // no own progress for embedded objects, // no second progress if the document already has one
void ScProgress::CreateInterpretProgress( ScDocument* pDoc, bool bWait )
{ if ( nInterpretProgress )
nInterpretProgress++; elseif ( pDoc->GetAutoCalc() )
{
nInterpretProgress = 1;
bIdleWasEnabled = pDoc->IsIdleEnabled();
pDoc->EnableIdle(false); // Interpreter may be called in many circumstances, also if another // progress bar is active, for example while adapting row heights. // Keep the dummy interpret progress. if ( !pGlobalProgress )
pInterpretProgress = new ScProgress( pDoc->GetDocumentShell(),
ScResId( STR_PROGRESS_CALCULATING ),
pDoc->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE, bWait );
pInterpretDoc = pDoc;
}
}
void ScProgress::DeleteInterpretProgress()
{ if ( !nInterpretProgress ) return;
/* Do not decrement 'nInterpretProgress', before 'pInterpretProgress' isdeleted.Inrarecases,deletionof'pInterpretProgress'causes arefreshofthesheetwindowwhichmaycallCreateInterpretProgress andDeleteInterpretProgressagain(fromOutput::DrawStrings),
resulting in double deletion of 'pInterpretProgress'. */ if ( nInterpretProgress == 1 )
{ if ( pInterpretProgress != &theDummyInterpretProgress )
{ // move pointer to local temporary to avoid double deletion
ScProgress* pTmpProgress = pInterpretProgress;
pInterpretProgress = &theDummyInterpretProgress; delete pTmpProgress;
} if ( pInterpretDoc )
pInterpretDoc->EnableIdle(bIdleWasEnabled);
}
--nInterpretProgress;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.