Bug 430417 - Formula parser blocks processing of input fields after returning error on an incorrect formula
Summary: Formula parser blocks processing of input fields after returning error on an ...
Status: RESOLVED DUPLICATE of bug 427190
Alias: None
Product: LabPlot2
Classification: Applications
Component: frontend (show other bugs)
Version: 2.8.1
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Gerlach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-15 11:59 UTC by Yuriy Volkov
Modified: 2020-12-15 13:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Blocked input field with a correct formula in it (199.52 KB, image/png)
2020-12-15 11:59 UTC, Yuriy Volkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuriy Volkov 2020-12-15 11:59:17 UTC
Created attachment 134090 [details]
Blocked input field with a correct formula in it

SUMMARY
If the formula parser for custom fitting or generating column data by-function detects incorrect syntax in the formula string, it disables the formula processing and generation even if the subsequent corrections fix the syntax. Blocking then persists in any invoked fields for custom formulas (independently of their target), until the Labplot session is restarted anew.

STEPS TO REPRODUCE
1. Create a spreadsheet with at least two columns
2. Fill the first column with arbitrary data
3. Apply "Generate data -> Function values" to the other column
4. Start to type any formula string in the formula window

OBSERVED RESULT
Input field for the formula is marked as "incorrect" (highlighted red), and "Generate" button is disabled permanently across the session until the restart of Labplot.

EXPECTED RESULT
Input field should be un-marked and "Generate" button should be available again when formula syntax has been corrected.

SOFTWARE/OS VERSIONS
Linux distro: Debian unstable (bullseye/sid)
Qt Version: 5.15.2
LabPlot version: 2.8.1

ADDITIONAL INFORMATION
Console output throws "PARSER ERROR: syntax error @ position %NUM of string %STR" when wrong syntax is detected in the formula expression, after this the subsequent invokes of ExpressionParser::isValid seem to have no practical effect.

The problem can be sort-of circumvented by typing the whole formula in any plain text editor beforehand then copy-pasting it in the formula field, so that the parser doesn't detect any errors firsthand.
Comment 1 Stefan Gerlach 2020-12-15 13:24:40 UTC

*** This bug has been marked as a duplicate of bug 427190 ***