[Libreoffice-commits] core.git: formula/source

Eike Rathke erack at redhat.com
Tue Mar 20 13:59:59 UTC 2018


 formula/source/ui/dlg/formula.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 682e2891409ca87ad89e8df43d577dc8d85c48b3
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Mar 20 14:58:43 2018 +0100

    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

diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 9bbc4afd4f0b..eeefd5b625f8 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -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();


More information about the Libreoffice-commits mailing list