[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - formula/source

Tor Lillqvist tml at collabora.com
Fri May 18 17:48:38 UTC 2018


 formula/source/ui/dlg/formula.cxx |   38 +++++++++++++++-----------------------
 1 file changed, 15 insertions(+), 23 deletions(-)

New commits:
commit 7245c6fdadce1e3b04ccdf839f0f688fcfdcad09
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed May 16 20:14:39 2018 +0300

    tdf#116511: Drop questionable check for more keyboard input
    
    For some reason, on macOS, when this is being invoked through the
    shortcut, Application::AnyInput( VclInputFlags::KEYBOARD ) returns
    true, so the code thinks that there is more keyboard input and won't
    call UpdateTokenArray(), which sets m_pTokenArray.
    
    I think that optmisation is questionable, especially as the exact
    semantics of our event loop API, like Application::AnyInput(), is
    under-defined and probably can and will change in various minor ways
    when people work on improving it on the Mac (and perhaps other
    platforms, too).
    
    (The event loop etc certainly needs improvement on the Mac. Consider
    the "WindowServer grows to tens of gigabytes when running make check"
    issue which is closely related. Unfortunately nobody has come up with
    a simple fix for that yet, exactly because we use our event loop
    related APIs in so imaginative ways all over the code, and fixing one
    thing usually breaks another.)
    
    Change-Id: I865d46e5ee69609ad58bc915ff949e0f3602d8f5
    Reviewed-on: https://gerrit.libreoffice.org/54448
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit 16f784b10695d1d3212463f96f597c665a90a8e2)
    Reviewed-on: https://gerrit.libreoffice.org/54545
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index d6e39b62341b..8273597ceeb2 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -614,40 +614,32 @@ void FormulaDlg_Impl::UpdateValues( bool bForceRecalcStruct )
 
 bool FormulaDlg_Impl::CalcStruct( const OUString& rStrExp, bool bForceRecalcStruct )
 {
-    bool bResult = true;
     sal_Int32 nLength = rStrExp.getLength();
 
     if ( !rStrExp.isEmpty() && (bForceRecalcStruct || m_aOldFormula != rStrExp) && m_bStructUpdate)
     {
-        // Only calculate the value when there isn't any more keyboard input:
+        m_pStructPage->ClearStruct();
 
-        if ( !Application::AnyInput( VclInputFlags::KEYBOARD ) )
+        OUString aString = rStrExp;
+        if (rStrExp[nLength-1] == '(')
         {
-            m_pStructPage->ClearStruct();
-
-            OUString aString = rStrExp;
-            if (rStrExp[nLength-1] == '(')
-            {
-                aString = aString.copy( 0, nLength-1);
-            }
+            aString = aString.copy( 0, nLength-1);
+        }
 
-            aString = aString.replaceAll( "\n", "");
-            OUString aStrResult;
+        aString = aString.replaceAll( "\n", "");
+        OUString aStrResult;
 
-            if ( CalcValue( aString, aStrResult ) )
-                m_pWndFormResult->SetText( aStrResult );
+        if ( CalcValue( aString, aStrResult ) )
+            m_pWndFormResult->SetText( aStrResult );
 
-            UpdateTokenArray(aString);
-            fillTree(m_pStructPage);
+        UpdateTokenArray(aString);
+        fillTree(m_pStructPage);
 
-            m_aOldFormula = rStrExp;
-            if (rStrExp[nLength-1] == '(')
-                UpdateTokenArray(rStrExp);
-        }
-        else
-            bResult = false;
+        m_aOldFormula = rStrExp;
+        if (rStrExp[nLength-1] == '(')
+            UpdateTokenArray(rStrExp);
     }
-    return bResult;
+    return true;
 }
 
 


More information about the Libreoffice-commits mailing list