Bug 93747 - Apply style in a selected table cell leaks to another table cell (when selecting "backwards")
Summary: Apply style in a selected table cell leaks to another table cell (when select...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.7.2 release
Hardware: All All
: medium minor
Assignee: Justin L
URL:
Whiteboard: target:7.3.0 target:7.5.0
Keywords: preBibisect, regression
Depends on:
Blocks: Styles Writer-Tables
  Show dependency treegraph
 
Reported: 2015-08-28 14:23 UTC by Pierre-Luc Rigaux
Modified: 2022-06-29 22:19 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Here a doc that provide a visual example of the bug. (12.27 KB, application/vnd.oasis.opendocument.text)
2015-08-28 14:23 UTC, Pierre-Luc Rigaux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Luc Rigaux 2015-08-28 14:23:56 UTC
Created attachment 118245 [details]
Here a doc that provide a visual example of the bug.

In table in writer
1. Select a table cell (full cell selection, not just the text) in the second column or second row.
2. apply a style (like Header 1 or bullet).

Results

The style in the selected cell changed ... and the styles of a neighbor cell also changed (not wanted).

Expected

Only the style in the selected cell changed.
Comment 1 A (Andy) 2015-08-30 09:00:12 UTC
Reproducible with LO 5.0.1.2, Win 8.1

If I insert a 4x4 table in a new WRITER document and select the whole cell in row 2 / column 2 and change it to numbering style with the icon in the toolbar at the top then the cell in row 2 / column 1 gets also the numbering style.
To reproduce it you need to select the whole cell not only the text (as mentioned in the bug description) and you need to mark the cell from its right border to the left border (going with the mouse from the right border of the cell to the cell to the left while holding the left mouse button, then going back that not both cells are selected).  If you do it the other direction it is not reproducible.
Comment 2 raal 2015-10-29 10:46:01 UTC
Can not reproduce with Version 4.0.0.3 (Build ID: 7545bee9c2a0782548772a21bc84a9dcc583b89, win7 -> regression

I can reproduce with Version: 4.5.0.0.alpha0+
Build ID: 57d6b92b69a31260dea0d84fcd1fc5866ada7adb, win7
Comment 3 raal 2015-11-18 19:15:15 UTC
Reproducible with Version: 4.2.0.0.alpha1+
Build ID: fc8f44e82de4ebdd50ac5fbb9207cd1a59a927e3
bibisect-43max$ git checkout oldest
Comment 4 Robinson Tryon (qubit) 2015-12-14 05:32:39 UTC Comment hidden (obsolete)
Comment 5 Joel Madero 2015-12-14 20:36:04 UTC
Bodhi Moksha

Either I'm not understanding this bug correctly or I'm not able to reproduce.

Version: 5.2.0.0.alpha0+
Build ID: 5df326438fd3a5613a52b4de1935426911ff1301
Comment 6 FutureProject 2016-01-17 19:08:03 UTC
I can reproduce with the following steps:
1. Make 4x4 table in new Writer document
2. Row1 Column1 write "a"
3. Row2 Column1 write "b"
4. Press and hold left mouse button on cell with the "b"
5. Drag mouse cursor up to cell with the "a": both cells are highlighted
6. Drag mouse cursor back to cell with the "b": only cell "b" is highlighted
7. Let go left mouse button
8. On the right-hand side choose "Heading 1" in the Styles menu
9. Both cells' contents are formatted
Comment 7 FutureProject 2016-01-17 19:21:34 UTC
Regarding comment 6:

Was reproduced on:
Windows 10 Pro, Version 1511 (OS Build 10586.36)
Version: 5.0.4.2 Build ID: 2b9802c1994aa0b7dc6079e128979269cf95bc78
Locale: de-DE (de_DE)
Comment 8 Joel Madero 2016-01-17 19:33:04 UTC
Bodhi Moksha (fork of Ubuntu 14.04)
LibreOffice 3.3 - 5.2 dev

Following the instructions in comment 6 as well as a video that Raal sent me - I see the same behavior going all the way back to 3.3 (inherited from OOo). I'm updating the status.

@Raal - if you don't mind checking again to see if you can find a regression here....I followed your steps (and FutureProject's steps) exactly and I see the same behavior throughout (from 3.3 - 5.2).
Comment 9 Joel Madero 2016-01-17 19:34:31 UTC
Dangit sorry for the noise - I lied, I can see the regression....updating now (sorry again!)
Comment 10 Joel Madero 2016-01-17 19:38:47 UTC
Bodhi Moksha
Bibisect 35all package (3.5 - 4.2)

New findings:
I can confirm the problem throughout the bibisect package but 3.3 doesn't show the problem so it is a regression.
Comment 11 Xisco Faulí 2016-09-14 15:28:56 UTC
Adding 'preBibisect' keyword...
Comment 12 Xisco Faulí 2016-09-14 15:48:40 UTC
[This is an automatic message]

Changing version to 3.5.7.2 in order to get rid of 'preBibisect' version as 3.5.7.2 looks to be the last version not covered by bibisect-43all.
Comment 13 Telesto 2017-02-14 19:25:53 UTC
Still repro with:
Version: 5.4.0.0.alpha0+
Build ID: a296a69c984b17cfbcd249cf6bdc191d08dff2a6
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-02-06_00:00:55
Comment 14 Julien Nabet 2017-09-24 07:22:08 UTC
On pc Debian x86-64 with master sources updated 2 days ago or with LO Debian package 5.4.2.1, I don't reproduce this.
I retrieved the attached file and applied style "Heading 1" of the right bottom cell of first array, only the cell was changed.
Did I miss something?
Comment 15 QA Administrators 2018-09-25 02:51:46 UTC Comment hidden (obsolete, spam)
Comment 16 Justin L 2021-03-26 16:02:10 UTC
repro 7.2+

After applying the new paragraph style (I choose Title since it is so visible), undo the change, and you will see that the text of the other cell is included in the selection. That should be a pretty good clue about what is happening here.
Comment 17 Justin L 2021-10-15 09:40:52 UTC
proposed patch at https://gerrit.libreoffice.org/c/core/+/123651
Comment 18 Commit Notification 2021-10-15 15:55:53 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b043a5b953f9da553a725606a1795d5fd0860ca3

tdf#93747 sw IsTableMode setStyle: don't affect unselected cells

It will be available in 7.3.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 19 Xisco Faulí 2021-11-05 11:53:29 UTC
(In reply to Justin L from comment #16)
> repro 7.2+
> 
> After applying the new paragraph style (I choose Title since it is so
> visible), undo the change, and you will see that the text of the other cell
> is included in the selection. That should be a pretty good clue about what
> is happening here.

Hi Justin,
Could you please explain the steps to reproduce this issue ? I can't reproduce it before you fix
Comment 20 Justin L 2021-11-05 12:17:34 UTC
(In reply to Xisco Faulí from comment #19)
> Could you please explain the steps to reproduce this issue ? I can't
> reproduce it before you fix

In table in writer
1. Enter some text ("col1") in cell A1 and "col2" in cell A2.
2. Select A2 (full cell selection, not just the text)
3. apply a paragraph style (Title).

Noticed that "col1" becomes centred/bold as well.
Comment 21 Justin L 2021-11-05 12:35:04 UTC
(In reply to Justin L from comment #20)
> 2. Select A2 (full cell selection, not just the text)
Select backwards (which selects A1 temporarily) and then limit it to cell A2.
Comment 22 Xisco Faulí 2021-11-05 16:04:16 UTC
(In reply to Justin L from comment #21)
> (In reply to Justin L from comment #20)
> > 2. Select A2 (full cell selection, not just the text)
> Select backwards (which selects A1 temporarily) and then limit it to cell A2.

Hi Justin,
Thanks for the clarification!!
Comment 23 Commit Notification 2021-11-05 16:04:38 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/58adc139aa5385a07e28c28cbd9317f4cd8aa4d4

tdf#93747: sw_uiwriter2: Add unittest

It will be available in 7.3.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 24 Commit Notification 2022-06-29 22:19:45 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fcbd1e8363f14fcbdcef9bb2a6bca8a2cb7644ac

tdf#tdf#93747 tdf#145151 sw IsTableMode: revert obsolete one-offs

It will be available in 7.5.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.