summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-03-06 17:28:27 +0100
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2017-06-22 10:34:44 +0200
commitd9726a692024e202f0b28a8b6955463f1d90d1e4 (patch)
tree5749580ff7aa0a55183f726ee4511b37eb58b824 /sc
parent9ec1ccb23af0de56f141d906f2eb60bab40aefb8 (diff)
formula: remove indirection and use unique_ptr
Change-Id: Ib0c083803024d223f62b91ec54850b84eb68a758 Reviewed-on: https://gerrit.libreoffice.org/39033 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/calcconfig.cxx6
-rw-r--r--sc/source/core/tool/compiler.cxx16
-rw-r--r--sc/source/core/tool/token.cxx2
3 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 07da3b4f2924..e80ec3fbceb0 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -178,7 +178,7 @@ ScCalcConfig::OpCodeSet ScStringToOpCodeSet(const OUString& rOpCodes)
formula::FormulaCompiler aCompiler;
formula::FormulaCompiler::OpCodeMapPtr pOpCodeMap(aCompiler.GetOpCodeMap(css::sheet::FormulaLanguage::ENGLISH));
- const formula::OpCodeHashMap *pHashMap(pOpCodeMap->getHashMap());
+ const formula::OpCodeHashMap& rHashMap(pOpCodeMap->getHashMap());
sal_Int32 fromIndex(0);
sal_Int32 semicolon;
@@ -194,8 +194,8 @@ ScCalcConfig::OpCodeSet ScStringToOpCodeSet(const OUString& rOpCodes)
result->insert(static_cast<OpCode>(n));
else
{
- auto opcode(pHashMap->find(element));
- if (opcode != pHashMap->end())
+ auto opcode(rHashMap.find(element));
+ if (opcode != rHashMap.end())
result->insert(opcode->second);
else
SAL_WARN("sc.opencl", "Unrecognized OpCode " << element << " in OpCode set string");
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 50775af00b57..d373516899fd 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2706,8 +2706,8 @@ Label_MaskStateMachine:
bool ScCompiler::IsOpCode( const OUString& rName, bool bInArray )
{
- OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap()->find( rName));
- bool bFound = (iLook != mxSymbols->getHashMap()->end());
+ OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap().find( rName));
+ bool bFound = (iLook != mxSymbols->getHashMap().end());
if (bFound)
{
OpCode eOp = iLook->second;
@@ -2846,8 +2846,8 @@ bool ScCompiler::IsOpCode( const OUString& rName, bool bInArray )
{
// If symbols are set by filters get mapping to exact name.
ExternalHashMap::const_iterator iExt(
- mxSymbols->getExternalHashMap()->find( rName));
- if (iExt != mxSymbols->getExternalHashMap()->end())
+ mxSymbols->getExternalHashMap().find( rName));
+ if (iExt != mxSymbols->getExternalHashMap().end())
{
if (ScGlobal::GetAddInCollection()->GetFuncData( (*iExt).second))
aIntName = (*iExt).second;
@@ -3706,8 +3706,8 @@ bool ScCompiler::IsColRowName( const OUString& rName )
bool ScCompiler::IsBoolean( const OUString& rName )
{
- OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap()->find( rName ) );
- if( iLook != mxSymbols->getHashMap()->end() &&
+ OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap().find( rName ) );
+ if( iLook != mxSymbols->getHashMap().end() &&
((*iLook).second == ocTrue ||
(*iLook).second == ocFalse) )
{
@@ -3733,8 +3733,8 @@ bool ScCompiler::IsErrorConstant( const OUString& rName ) const
bool ScCompiler::IsTableRefItem( const OUString& rName ) const
{
bool bItem = false;
- OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap()->find( rName));
- if (iLook != mxSymbols->getHashMap()->end())
+ OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap().find( rName));
+ if (iLook != mxSymbols->getHashMap().end())
{
// Only called when there actually is a current TableRef, hence
// accessing maTableRefs.back() is safe.
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 3cbbc966a3e9..8349a781dd5c 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -4990,7 +4990,7 @@ void appendTokenByType( sc::TokenStringContext& rCxt, OUStringBuffer& rBuf, cons
bool bMapped = rCxt.mxOpCodeMap->isPODF(); // ODF 1.1 directly uses programmatical name
if (!bMapped && rCxt.mxOpCodeMap->hasExternals())
{
- const ExternalHashMap& rExtMap = *rCxt.mxOpCodeMap->getReverseExternalHashMap();
+ const ExternalHashMap& rExtMap = rCxt.mxOpCodeMap->getReverseExternalHashMap();
ExternalHashMap::const_iterator it = rExtMap.find(aAddIn);
if (it != rExtMap.end())
{