| Summary: | Text cell prompting about incorect formula | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Rafallauterbach |
| Component: | Calc | Assignee: | Baole Fang <baole.fang> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | dev, erack, mentoring |
| Priority: | medium | Keywords: | difficultyMedium, easyHack, skillCpp |
| Version: | Inherited From OOo | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://bugs.documentfoundation.org/show_bug.cgi?id=132026 https://bugs.documentfoundation.org/show_bug.cgi?id=129369 https://bugs.documentfoundation.org/show_bug.cgi?id=116261 |
||
| Whiteboard: | target:7.6.0 | ||
| Crash report or crash signature: | Regression By: | ||
|
Description
Rafallauterbach
2020-03-28 08:25:04 UTC
Reproducible with Version: 6.4.2.2 (x64) Build ID: 4e471d8c02c9c90f512f7f9ead8875b57fcb1ec3 CPU threads: 12; OS: Windows 10.0 Build 18363; UI render: default; VCL: win; Locale: ru-RU (ru_RU); UI-Language: en-US Calc: CL and with Version: 7.0.0.0.alpha0+ (x64) Build ID: 5a94ac9eec4a63708262b2389aa2a434aa47112e CPU threads: 12; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win; Locale: ru-RU (ru_RU); UI-Language: en-US Calc: CL So setting Text format to the cell does not prevent interpreting formulas starting with "-", as opposed to formulas starting with "=". In fact, it pre-processes any formula (starting with +, -, or =). The prompt appears on "invalid formulas", despite it's not going to store it as formula eventually. Cf.: "=///2" with "=2": in first case, it would try correct the input before storing the result as string, while in the second case, it will store it as string immediately. A code pointer: see ScViewFunc::EnterData, which processes formula (see "bool bFormula") before processing cell type (see "if (nType == SvNumFormatType::TEXT"). Possibly related: in empty cells formatted as text, typing "=" or "-" or "+" then pressing an arrow key adds respective cell address to the "formula". See https://ask.libreoffice.org/en/question/319620/can-i-turn-off-a-minus-signs-behavior/ The code pointer is in comment 2. Resolution of this easy hack should include a unit test (UITest) [1]. [1] https://wiki.documentfoundation.org/Development/UITests start working on this Baole Fang committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/730e6fa063fccbd12913362dd5d3c74ea14957be tdf#131638: Fix text cell incorrect formula It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. |