Bug 167132 - EDITING: Bracketing selected text deletes equations
Summary: EDITING: Bracketing selected text deletes equations
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.7.2 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:26.2.0 target:25.8.0.0.beta2 t...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-20 16:27 UTC by Quax
Modified: 2025-06-27 13:26 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Minimum working example (12.93 KB, application/vnd.oasis.opendocument.text)
2025-06-20 16:29 UTC, Quax
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Quax 2025-06-20 16:27:45 UTC
Description:
By selecting text, then pressing e.g. shift+9 (equivalent to "("), the selected text is placed in brackets. Similar behaviour occurs for {, [, ", and '.
If the selected text includes an equation, this will be deleted by this action.


Steps to Reproduce:
1. Type some text including an inline equation
2. Select text
3. Type one of ([{"'
4. Observe equation deletion
See attached document for MWE.

Actual Results:
Equation is deleted
For example (equation contained by $):
Before: Newton's second law is $F = m a$.
After: (Newton's second law is .)

Expected Results:
After: (Newton's second law is $F = m a$.)


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.8.7.2 (X86_64) / LibreOffice Community
Build ID: e07d0a63a46349d29051da79b1fde8160bab2a89
CPU threads: 12; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: threaded
Comment 1 Quax 2025-06-20 16:29:00 UTC
Created attachment 201379 [details]
Minimum working example

Select all text, and press shift+9 corresponding to "(". Equation will be deleted.
Comment 2 Xisco Faulí 2025-06-20 16:53:42 UTC
at least in my case, when I do

1. Select all
2. Shift + 8

On the other hand, if I do

1. Type something
2. Select all
3. Shift + 8

Then I can reproduce this issue. I'll report the crash in a different issue

Reproduced in

Version: 25.8.0.0.beta1+ (X86_64) / LibreOffice Community
Build ID: 211c193b1c7391b4f1c1172214a90899de19b06a
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 3 Xisco Faulí 2025-06-20 17:01:07 UTC
This feature was implemented in bug 151710
@Andreas, i thought you might be interested in this issue
Comment 4 Commit Notification 2025-06-27 07:41:59 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/03c9b14b6718b806e3d3e3f2005bd16a73dc1b73

tdf#167132: Reimplement SwWrtShell::InsertEnclosingChars

It will be available in 26.2.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.
Comment 5 Commit Notification 2025-06-27 11:14:10 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/85829c4c33e0f46ab71222732eeba7dc86fc6b38

tdf#167132: Reimplement SwWrtShell::InsertEnclosingChars

It will be available in 25.8.0.0.beta2.

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.
Comment 6 Commit Notification 2025-06-27 13:26:53 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/9bfa61550a62c1f2df8b708c153f7d9c1f17a361

tdf#167132: Reimplement SwWrtShell::InsertEnclosingChars

It will be available in 25.2.6.

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.