diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-02-26 20:44:33 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-02-27 08:59:58 +0000 |
commit | 9a930ef9ea45277109c9acd6e7e1ccfe47fe136c (patch) | |
tree | 188be5548891d5b472f513da6b7d70ad40415ff4 /formula | |
parent | 7677e16217349a0a0e94edb6a90b00089432c6ce (diff) |
can use a reference instead of a pointer
Change-Id: I770983c2a46c2181db80243efa7c926e356d5e6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147745
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/ui/dlg/FormulaHelper.cxx | 12 | ||||
-rw-r--r-- | formula/source/ui/dlg/formula.cxx | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 58d474de8015..764cdba9d8f5 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -61,14 +61,14 @@ namespace formula #define FUNC_NOTFOUND -1 FormulaHelper::FormulaHelper(const IFunctionManager* _pFunctionManager) - :m_pFunctionManager(_pFunctionManager) + :m_rCharClass(m_aSysLocale.GetCharClass()) + ,m_pFunctionManager(_pFunctionManager) ,open(_pFunctionManager->getSingleToken(IFunctionManager::eOk)) ,close(_pFunctionManager->getSingleToken(IFunctionManager::eClose)) ,sep(_pFunctionManager->getSingleToken(IFunctionManager::eSep)) ,arrayOpen(_pFunctionManager->getSingleToken(IFunctionManager::eArrayOpen)) ,arrayClose(_pFunctionManager->getSingleToken(IFunctionManager::eArrayClose)) { - m_pCharClass = &m_aSysLocale.GetCharClass(); } sal_Int32 FormulaHelper::GetCategoryCount() const @@ -184,9 +184,9 @@ void FormulaHelper::GetArgStrings( ::std::vector< OUString >& _rArgs, } -static bool IsFormulaText( const CharClass* _pCharClass,const OUString& rStr, sal_Int32 nPos ) +static bool IsFormulaText(const CharClass& rCharClass, const OUString& rStr, sal_Int32 nPos) { - if( _pCharClass->isLetterNumeric( rStr, nPos ) ) + if( rCharClass.isLetterNumeric( rStr, nPos ) ) return true; else { // In internationalized versions function names may contain a dot @@ -260,7 +260,7 @@ sal_Int32 FormulaHelper::GetFunctionStart( const OUString& rFormula, { nFStart = nParPos-1; - while ( (nFStart > 0) && IsFormulaText(m_pCharClass, rFormula, nFStart )) + while ( (nFStart > 0) && IsFormulaText(m_rCharClass, rFormula, nFStart )) nFStart--; } @@ -268,7 +268,7 @@ sal_Int32 FormulaHelper::GetFunctionStart( const OUString& rFormula, if ( bFound ) { - if ( IsFormulaText( m_pCharClass,rFormula, nFStart ) ) + if ( IsFormulaText( m_rCharClass, rFormula, nFStart ) ) { // Function found if ( pFuncName ) diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index c73543603158..139c9ab4795c 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -375,7 +375,7 @@ sal_Int32 FormulaDlg_Impl::GetFunctionPos(sal_Int32 nPos) const sal_Unicode sep = m_pHelper->getFunctionManager()->getSingleToken(IFunctionManager::eSep); sal_Int32 nFuncPos = SAL_MAX_INT32; - OUString aFormString = m_aFormulaHelper.GetCharClass()->uppercase(m_xMEdit->get_text()); + OUString aFormString = m_aFormulaHelper.GetCharClass().uppercase(m_xMEdit->get_text()); const uno::Reference< sheet::XFormulaParser > xParser(m_pHelper->getFormulaParser()); const table::CellAddress aRefPos(m_pHelper->getReferencePosition()); |