Bug 130741 - Formulas getting broken after switching between visual and code editor.
Summary: Formulas getting broken after switching between visual and code editor.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Formula-Editor
  Show dependency treegraph
 
Reported: 2020-02-17 18:39 UTC by Anton Tsyganenko
Modified: 2020-07-23 16:07 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Tsyganenko 2020-02-17 18:39:45 UTC
Description:
After switching between visual and code editing, formulas are getting broken.

Steps to Reproduce:
1. set the cursor to the visual formula edit area, type "/a+b↓c+d", the code will be `{ { a + b } over { c + d } }`
2. swich to the code editor, make a change (for example, change "d" to "e")
3. switch to the visual area, set the cursor after the fraction and type a space, the code becomes `{ { a + b over c + e } ~ }`, however the formula still looks correctly.
4. switch back the code editor, make a change (for example, remove the tilde).


Actual Results:
The formula is now broken and looks like "a + (b/c) + e".

Expected Results:
The only change that occurs in code on step 3 is adding tilde, and the formula remains to look correctly after step 4, like "(a+b)/(c+e)"


Reproducible: Always


User Profile Reset: No



Additional Info:
Tested on LO 6.4.0.3 on Arch Linux, but I've been noticing this problem for at least a few months, so it may be much older.
Comment 1 Roman Kuznetsov 2020-02-20 10:02:07 UTC
What is a "visual formula edit area" in your description?

I think you just make changes by wrong way

Did you read that guide https://wiki.documentfoundation.org/images/a/aa/MathGuide-5.0-RU-Final.pdf?
Comment 2 Anton Tsyganenko 2020-02-21 14:17:22 UTC
I meant the preview window (окно предварительного просмотра).

Maybe I way trying to edit it in the wrong way, but the way of editing formulas in the instruction (page 22-23) looks strange (maybe out of date): when I click an element in the preview window (single or double click), cursor is being set to the preview window, not to the formula editor, as written in the guide.

Why this happens, if the preview window is not intended to edit formulas?
Comment 3 Buovjaga 2020-05-10 14:44:15 UTC
(In reply to Anton Tsyganenko from comment #0)
> Description:
> After switching between visual and code editing, formulas are getting broken.
> 
> Steps to Reproduce:
> 1. set the cursor to the visual formula edit area, type "/a+b↓c+d", the code

I don't know how to type ↓
I can't copy and paste it either.
Comment 4 Anton Tsyganenko 2020-05-10 14:46:10 UTC
(In reply to Buovjaga from comment #3)
> (In reply to Anton Tsyganenko from comment #0)
> > Description:
> > After switching between visual and code editing, formulas are getting broken.
> > 
> > Steps to Reproduce:
> > 1. set the cursor to the visual formula edit area, type "/a+b↓c+d", the code
> 
> I don't know how to type ↓
> I can't copy and paste it either.

I meant arrows on the keyboard.
Comment 5 Buovjaga 2020-05-10 15:47:46 UTC
Ok, repro on Linux and also version 3.3 on Windows

Arch Linux 64-bit
Version: 7.0.0.0.alpha1+
Build ID: e622420c0aa8116294e85c076ff2d8fc6131595f
CPU threads: 8; OS: Linux 5.6; UI render: default; VCL: kf5; 
Locale: en-US (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 10 May 2020
Comment 6 Mantas Kriaučiūnas 2020-07-23 16:07:13 UTC
Visual formula editor area can be used only if "Experimental features" are enabled in Tools->Options->Advanced
I can confirm this issue on LibreOffice 6.4.4.2, it would be nice to have it fixed and see enabled visual editor by default :)

Btw, I've found visual formula editor TODO:
https://opengrok.libreoffice.org/xref/core/starmath/visual-editor-todo