From a7ad759726752453856e5bb997ef73d61a56b072 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 23 Mar 2017 21:29:16 -0400 Subject: Remove near-duplicated code. Change-Id: I46e743ae47c76c4e9c22d092f501636ebab92878 Reviewed-on: https://gerrit.libreoffice.org/35606 Tested-by: Jenkins Reviewed-by: Kohei Yoshida --- sc/source/core/tool/interpr4.cxx | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'sc') diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index f527a86e8627..5510b8f9c655 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -940,26 +940,11 @@ void ScInterpreter::SingleRefToVars( const ScSingleRefData & rRef, void ScInterpreter::PopSingleRef(SCCOL& rCol, SCROW &rRow, SCTAB& rTab) { - if( sp ) - { - --sp; - const FormulaToken* p = pStack[ sp ]; - switch (p->GetType()) - { - case svError: - nGlobalError = p->GetError(); - break; - case svSingleRef: - SingleRefToVars( *p->GetSingleRef(), rCol, rRow, rTab); - if (!pDok->m_TableOpList.empty()) - ReplaceCell( rCol, rRow, rTab ); - break; - default: - SetError( FormulaError::IllegalParameter); - } - } - else - SetError( FormulaError::UnknownStackVariable); + ScAddress aAddr(rCol, rRow, rTab); + PopSingleRef(aAddr); + rCol = aAddr.Col(); + rRow = aAddr.Row(); + rTab = aAddr.Tab(); } void ScInterpreter::PopSingleRef( ScAddress& rAdr ) -- cgit