Avoid creating a compiler for matrix check if there is no matrix support

... as indicated by m_pBtnMatrix hidden for reportdesign.
tdf#116468 cleansing.

Change-Id: I1727dcc9875f0728805bac63cc6c1f1533394c6c
This commit is contained in:
Eike Rathke
2018-03-20 14:58:43 +01:00
parent 4abe539180
commit 682e289140

View File

@@ -567,16 +567,15 @@ void FormulaDlg_Impl::UpdateValues( bool bForceRecalcStruct )
// Take a force-array context into account. RPN creation propagated those
// to tokens that are ref-counted so also available in the token array.
bool bForceArray = false;
// Only necessary if it's not a matrix formula anyway.
if (!m_pBtnMatrix->IsChecked())
// Only necessary if it's not a matrix formula anyway and matrix evaluation
// is supported, i.e. the button is visible.
if (m_pBtnMatrix->IsVisible() && !m_pBtnMatrix->IsChecked())
{
/* 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()));
// 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.
// no array/matrix support anyway, but ensure checking.
if (pCompiler->GetCurrentOpCodeMap().get())
{
const sal_Int32 nPos = m_aFuncSel.Min();