Kaydet (Commit) 7245c6fd authored tarafından Tor Lillqvist's avatar Tor Lillqvist Kaydeden (comit) Eike Rathke

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/54448Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
(cherry picked from commit 16f784b1)
Reviewed-on: https://gerrit.libreoffice.org/54545Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst efd59fd1
...@@ -614,40 +614,32 @@ void FormulaDlg_Impl::UpdateValues( bool bForceRecalcStruct ) ...@@ -614,40 +614,32 @@ void FormulaDlg_Impl::UpdateValues( bool bForceRecalcStruct )
bool FormulaDlg_Impl::CalcStruct( const OUString& rStrExp, bool bForceRecalcStruct ) bool FormulaDlg_Impl::CalcStruct( const OUString& rStrExp, bool bForceRecalcStruct )
{ {
bool bResult = true;
sal_Int32 nLength = rStrExp.getLength(); sal_Int32 nLength = rStrExp.getLength();
if ( !rStrExp.isEmpty() && (bForceRecalcStruct || m_aOldFormula != rStrExp) && m_bStructUpdate) 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(); aString = aString.copy( 0, nLength-1);
}
OUString aString = rStrExp;
if (rStrExp[nLength-1] == '(')
{
aString = aString.copy( 0, nLength-1);
}
aString = aString.replaceAll( "\n", ""); aString = aString.replaceAll( "\n", "");
OUString aStrResult; OUString aStrResult;
if ( CalcValue( aString, aStrResult ) ) if ( CalcValue( aString, aStrResult ) )
m_pWndFormResult->SetText( aStrResult ); m_pWndFormResult->SetText( aStrResult );
UpdateTokenArray(aString); UpdateTokenArray(aString);
fillTree(m_pStructPage); fillTree(m_pStructPage);
m_aOldFormula = rStrExp; m_aOldFormula = rStrExp;
if (rStrExp[nLength-1] == '(') if (rStrExp[nLength-1] == '(')
UpdateTokenArray(rStrExp); UpdateTokenArray(rStrExp);
}
else
bResult = false;
} }
return bResult; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment