sc/inc/document.hxx | 4 ++-- sc/inc/formulacell.hxx | 3 +++ sc/source/core/data/documen7.cxx | 10 ---------- sc/source/core/data/formulacell.cxx | 3 ++- 4 files changed, 7 insertions(+), 13 deletions(-)
New commits: commit bf74eb1d1623a51805f91a973bc9f726d14dd7a8 Author: Noel Grandin <n...@peralex.com> AuthorDate: Fri Nov 26 12:40:48 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Nov 26 17:30:33 2021 +0100 tdf#133996 speed up opening of ODS with autofilter + conditional formatting inline some hot methods, and use OUStringLiteral to avoid repeated construction of an OUString, saves about 3% Change-Id: I6d09ade4e08a94ed5dd49a8882e26bb5786409d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125873 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 0ed322c541ab..c6246aec96b1 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -2308,8 +2308,8 @@ public: bool IsTrackFormulasPending() const { return mbTrackFormulasPending; } void FinalTrackFormulas( SfxHintId nHintId ); bool IsFinalTrackFormulas() const { return mbFinalTrackFormulas; } - bool IsInFormulaTree( const ScFormulaCell* pCell ) const; - bool IsInFormulaTrack( const ScFormulaCell* pCell ) const; + inline bool IsInFormulaTree( const ScFormulaCell* pCell ) const; + inline bool IsInFormulaTrack( const ScFormulaCell* pCell ) const; HardRecalcState GetHardRecalcState() const { return eHardRecalcState; } void SetHardRecalcState( HardRecalcState eVal ) { eHardRecalcState = eVal; } void StartAllListeners(); diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index 09e71a1385ca..013a0058ba5d 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -509,4 +509,7 @@ public: #endif }; +inline bool ScDocument::IsInFormulaTree( const ScFormulaCell* pCell ) const { return pCell->GetPrevious() || pFormulaTree == pCell; } +inline bool ScDocument::IsInFormulaTrack( const ScFormulaCell* pCell ) const { return pCell->GetPreviousTrack() || pFormulaTrack == pCell; } + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index eaaaf285c4b8..dbbbbcae7883 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -318,11 +318,6 @@ void ScDocument::RemoveFromFormulaTree( ScFormulaCell* pCell ) } } -bool ScDocument::IsInFormulaTree( const ScFormulaCell* pCell ) const -{ - return pCell->GetPrevious() || pFormulaTree == pCell; -} - void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSetAllDirty ) { OSL_ENSURE( !IsCalculatingFormulaTree(), "CalcFormulaTree recursion" ); @@ -498,11 +493,6 @@ void ScDocument::RemoveFromFormulaTrack( ScFormulaCell* pCell ) --nFormulaTrackCount; } -bool ScDocument::IsInFormulaTrack( const ScFormulaCell* pCell ) const -{ - return pCell->GetPreviousTrack() || pFormulaTrack == pCell; -} - void ScDocument::FinalTrackFormulas( SfxHintId nHintId ) { mbTrackFormulasPending = false; diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 44f0f7acdf2b..195fa15286d0 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -4614,7 +4614,8 @@ bool ScFormulaCell::InterpretFormulaGroup(SCROW nStartOffset, SCROW nEndOffset) if (mxGroup->meCalcState == sc::GroupCalcDisabled) { - aScope.addMessage("group calc disabled"); + static constexpr OUStringLiteral MESSAGE = u"group calc disabled"; + aScope.addMessage(MESSAGE); return false; }