summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2017-03-23 21:29:16 -0400
committerKohei Yoshida <libreoffice@kohei.us>2017-03-24 02:12:16 +0000
commita7ad759726752453856e5bb997ef73d61a56b072 (patch)
treec8199d986d816a3a535d1bb64ce01c1e3192b060 /sc
parent522e9c65faef684a22151ddf009a5a192838b522 (diff)
Remove near-duplicated code.
Change-Id: I46e743ae47c76c4e9c22d092f501636ebab92878 Reviewed-on: https://gerrit.libreoffice.org/35606 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/interpr4.cxx25
1 files changed, 5 insertions, 20 deletions
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 )