Description: When deselecting a math formula that is the first element of a line in a table cell, the keyboard is unresponsive and the cursor cannot be moved using the arrow keys, unless I use the mouse to reposition it. Steps to Reproduce: 1. Create a new table with the Default Style. 2. Insert a math formula at the start of any line, whether on the first line of the cell, after an explicit line break or a line break caused by word wrapping. 3. Press "Escape" once to exit the math formula editor. The math formula is now selected. 4. Press "Escape" once more. Actual Results: The cursor is now positioned at the start of a line, before the formula, and cannot be moved using the keybord (using the arrow keys). Pressing "Enter" puts you back into the formula editor. Pressing "Delete" puts you at the start of the document. Other keyboard keys seem to have no effect. Expected Results: The cursor should be positioned after the formula, and be responsive to keyboard inputs. Reproducible: Always User Profile Reset: Yes Additional Info: More generally, the cursor shows very erratic behaviour. Normally, after deselecting a math formula by pressing "Escape", the cursor should be placed *after* the math formula, and the cursor should be responsive to keyboard inputs. Outside tables, the expected behaviour sometimes happens. Other times however, unrelated to whether the formula is the first element of a line and depending on the formula’s content or position, the cursor is placed before the formula after deselecting the formula, but the cursor is still responsive to keyboard inputs, and the "Enter" and "Delete" keys behave normally (as opposed to the behaviour described here in "Actual Results"). Inside any table, after deselecting a formula that is *not* positioned at the start of a line, the cursor will be placed before the formula, whereas it should be placed after. The cursor remains responsive to keyboard inputs however, and the "Enter" and "Delete" keys behave normally (as opposed to the behaviour described here in "Actual Results"). Inside tables with style "None", after deselecting a math formula that is at the start of a line, the cursor is repositioned at the end of the previous table cell. The keyboard behaves normally. Inside tables with style "Default", after deselecting a math formula that is at the start of a line, the problem described here happens. Version: 7.6.1.2 (X86_64) / LibreOffice Community Build ID: f5defcebd022c5bc36bbb79be232cb6926d8f674 CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: fr-FR (fr_FR); UI: fr-FR Calc: CL threaded
Please attach a sample file.
Created attachment 189916 [details] Provides an example of the bug described here Done.
Reproducible with: Version: 7.6.1.2 (X86_64) / LibreOffice Community Build ID: f5defcebd022c5bc36bbb79be232cb6926d8f674 CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win Locale: es-ES (es_ES); UI: en-US Calc: CL threaded and Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 5e9c8d21874eea8cb5adf2ecab1905295af2308f CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win Locale: es-ES (es_ES); UI: en-US Calc: CL threaded Jumbo
László Németh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/3e0650fb166cac116a43f6ce5d03bd69830e37b8 tdf#157533 sw: fix cursor position deselecting formula in table It will be available in 24.8.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.
Fixed all the test cases of the report. @internet657-84eddea134@yahoo.com and m_a_riosv: thanks for the report and handling the issue!
Note: it seems, deselecting neighbouring objects has still the same problem. I suggest to file it in a new bug.
Commit description: tdf#157533 sw: fix cursor position deselecting formula in table Fix lost cursor by deselecting formula object anchored as character as single content of table cells. In this case, the cursor was positioned inside the frame of the formula, disappeared in a flash. Fix also bad cursor position by deselecting formula object anchored as character at beginning of text lines in table content. Follow-up to commit 014e5f559a9acf319af24c721dbe6b0bc3bc5882 "tdf#161360 sw: fix cursor position deselecting image in table".
László Németh committed a patch related to this issue. It has been pushed to "libreoffice-24-2": https://git.libreoffice.org/core/commit/a6c7a66d862dad2c78378b9da4febf184b052368 tdf#157533 sw: fix cursor position deselecting formula in table It will be available in 24.2.5. 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.