diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-07 15:56:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-07 19:15:55 +0000 |
commit | c596fd59dc75823002bdfd3676d600a56e3bfb5e (patch) | |
tree | 03a4f761c0e729de27a245bcf3a7701fd5b35781 /formula | |
parent | e096fbc3e06d2c2b55ef8706c954efb6555ca0e6 (diff) |
no need to allocate these separately
they are all one or two words in size
Change-Id: I86611e14a32dda3ae2226bbfa775ad0234513888
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148425
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/ui/dlg/formula.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 139c9ab4795c..038fc2b63cf9 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -124,7 +124,7 @@ public: mutable uno::Reference< sheet::XFormulaOpCodeMapper> m_xOpCodeMapper; uno::Sequence< sheet::FormulaToken > m_aTokenList; ::std::unique_ptr<FormulaTokenArray> m_pTokenArray; - ::std::unique_ptr<FormulaTokenArrayPlainIterator> m_pTokenArrayIterator; + ::std::optional<FormulaTokenArrayPlainIterator> m_oTokenArrayIterator; mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aSpecialOpCodes; mutable uno::Sequence< sheet::FormulaToken > m_aSeparatorsOpCodes; mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aFunctionOpCodes; @@ -522,7 +522,7 @@ void FormulaDlg_Impl::UpdateValues( bool bForceRecalcStruct ) assert( 0 <= nPos && nPos < m_pHelper->getCurrentFormula().getLength()); OUStringBuffer aBuf; const FormulaToken* pToken = nullptr; - for (pToken = m_pTokenArrayIterator->First(); pToken; pToken = m_pTokenArrayIterator->Next()) + for (pToken = m_oTokenArrayIterator->First(); pToken; pToken = m_oTokenArrayIterator->Next()) { pCompiler->CreateStringFromToken( aBuf, pToken); if (nPos < aBuf.getLength()) @@ -637,7 +637,7 @@ void FormulaDlg_Impl::MakeTree(StructPage* _pTree, weld::TreeIter* pParent, cons pEntry = xEntry.get(); } - MakeTree(_pTree, pEntry, _pToken, m_pTokenArrayIterator->PrevRPN(), nParas); + MakeTree(_pTree, pEntry, _pToken, m_oTokenArrayIterator->PrevRPN(), nParas); if (bCalcSubformula) { @@ -663,8 +663,8 @@ void FormulaDlg_Impl::MakeTree(StructPage* _pTree, weld::TreeIter* pParent, cons } --Count; - m_pTokenArrayIterator->NextRPN(); /* TODO: what's this to be? ThisRPN()? */ - MakeTree( _pTree, pParent, _pToken, m_pTokenArrayIterator->PrevRPN(), Count); + m_oTokenArrayIterator->NextRPN(); /* TODO: what's this to be? ThisRPN()? */ + MakeTree( _pTree, pParent, _pToken, m_oTokenArrayIterator->PrevRPN(), Count); } else { @@ -729,7 +729,7 @@ void FormulaDlg_Impl::MakeTree(StructPage* _pTree, weld::TreeIter* pParent, cons _pTree->InsertEntry(aResult, pParent, STRUCT_END, 0, _pToken, *xEntry); } --Count; - MakeTree( _pTree, pParent, _pToken, m_pTokenArrayIterator->PrevRPN(), Count); + MakeTree( _pTree, pParent, _pToken, m_oTokenArrayIterator->PrevRPN(), Count); } } catch (const uno::Exception&) @@ -741,7 +741,7 @@ void FormulaDlg_Impl::MakeTree(StructPage* _pTree, weld::TreeIter* pParent, cons void FormulaDlg_Impl::fillTree(StructPage* _pTree) { InitFormulaOpCodeMapper(); - FormulaToken* pToken = m_pTokenArrayIterator->LastRPN(); + FormulaToken* pToken = m_oTokenArrayIterator->LastRPN(); if ( pToken != nullptr) { @@ -765,7 +765,7 @@ void FormulaDlg_Impl::UpdateTokenArray( const OUString& rStrExp) } InitFormulaOpCodeMapper(); m_pTokenArray = m_pHelper->convertToTokenArray(m_aTokenList); - m_pTokenArrayIterator.reset(new FormulaTokenArrayPlainIterator(*m_pTokenArray)); + m_oTokenArrayIterator.emplace(*m_pTokenArray); const sal_Int32 nLen = static_cast<sal_Int32>(m_pTokenArray->GetLen()); FormulaToken** pTokens = m_pTokenArray->GetArray(); if ( pTokens && nLen == m_aTokenList.getLength() ) |