summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-03-20 14:26:35 +0100
committerAndras Timar <andras.timar@collabora.com>2018-03-26 08:31:44 +0200
commite1a6ce470817744344c541cb13b6ac8376e85b3d (patch)
treead3f106a16184a25f80988699dc485cf7ca0e7a5 /formula
parent12ef539d954d4a55a77263e93ce351a2f4a6fcc3 (diff)
Resolves: tdf#116468 do not check array/matrix context for reportdesign
It doesn't have any, and worse, there's no currently active OpCode symbol map that could be used to create strings from tokens. Regression from commit bf1ffc64128f5b96d7c2fcc7adc81cbc25e232fd Date: Sun Jul 16 15:18:09 2017 +0200 FormulaDlg_Impl::UpdateValues: evaluate in force-array context if present Change-Id: I77c2035fdd0926f67fcc85e7090f30485b4e312c (cherry picked from commit 3a3a61bce913b564c7b7a98c56b55cbc11ea273a) Reviewed-on: https://gerrit.libreoffice.org/51642 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> (cherry picked from commit e722779351bb83af4ca368c143ab9561f1864bcf)
Diffstat (limited to 'formula')
-rw-r--r--formula/source/ui/dlg/formula.cxx29
1 files changed, 19 insertions, 10 deletions
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index c98167ea54bc..d6e39b62341b 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -570,19 +570,28 @@ void FormulaDlg_Impl::UpdateValues( bool bForceRecalcStruct )
// Only necessary if it's not a matrix formula anyway.
if (!m_pBtnMatrix->IsChecked())
{
- const sal_Int32 nPos = m_aFuncSel.Min();
- assert( 0 <= nPos && nPos < m_pHelper->getCurrentFormula().getLength());
- OUStringBuffer aBuf;
+ /* TODO: we probably don't even need to ask a compiler instance if
+ * m_pBtnMatrix is hidden. */
std::unique_ptr<FormulaCompiler> pCompiler( m_pHelper->createCompiler( *m_pTokenArray.get()));
- const FormulaToken* pToken = nullptr;
- for (pToken = m_pTokenArrayIterator->First(); pToken; pToken = m_pTokenArrayIterator->Next())
+ // In the case of the reportdesign dialog there is no currently active
+ // OpCode symbol mapping that could be used to create strings from
+ // tokens, it's all dreaded API mapping. However, in that case there's
+ // no array/matrix support anyway.
+ if (pCompiler->GetCurrentOpCodeMap().get())
{
- pCompiler->CreateStringFromToken( aBuf, pToken);
- if (nPos < aBuf.getLength())
- break;
+ const sal_Int32 nPos = m_aFuncSel.Min();
+ assert( 0 <= nPos && nPos < m_pHelper->getCurrentFormula().getLength());
+ OUStringBuffer aBuf;
+ const FormulaToken* pToken = nullptr;
+ for (pToken = m_pTokenArrayIterator->First(); pToken; pToken = m_pTokenArrayIterator->Next())
+ {
+ pCompiler->CreateStringFromToken( aBuf, pToken);
+ if (nPos < aBuf.getLength())
+ break;
+ }
+ if (pToken && nPos < aBuf.getLength())
+ bForceArray = pToken->IsInForceArray();
}
- if (pToken && nPos < aBuf.getLength())
- bForceArray = pToken->IsInForceArray();
}
OUString aStrResult;