Bug 158297 - Pasting unformatted text over existing values - an empty line will not handle the last column value (STR comment 8 and comment 10)
Summary: Pasting unformatted text over existing values - an empty line will not handle...
Status: RESOLVED DUPLICATE of bug 129701
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest
Depends on:
Blocks: CSV-Dialog
  Show dependency treegraph
 
Reported: 2023-11-21 10:39 UTC by MBS
Modified: 2023-12-05 19:48 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
1st used libreoffice version (39.58 KB, image/png)
2023-11-22 13:38 UTC, MBS
Details
2nd used libreoffice version (175.74 KB, image/png)
2023-11-22 13:40 UTC, MBS
Details
This is the libreoffice menu I see Alt-Ctrl-V (38.75 KB, image/png)
2023-11-22 13:44 UTC, MBS
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MBS 2023-11-21 10:39:28 UTC
[Description]
When I paste (Ctrl+Alt+Shift+V) over existing values, and the pasted values have an empty line, the line is cleared, but not the last value of the line.

[How to test]
TabA below is the original table. TabB is a new changed version to be copied over TabA (line a gone, line e added), TabC is the result after TabB was pasted as unformatted Text over TabA. You can see in the empty line the last value (b-3) is still present in the line that was supposed to be empty.

[Test sample "tables"]
TabA
Legend;1;2;3
a;a-1;a-2;a-3
b;b-1;b-2;b-3
empty;;;
d;d-1;d-2;d-3

TabB
Legend;1;2;3
b;b-1;b-2;b-3
empty;;;
d;d-1;d-2;d-3
e;e-1;e-2;e-3

TabC
Legend;1;2;3
b;b-1;b-2;b-3
empty;;;b-3
d;d-1;d-2;d-3
e;e-1;e-2;e-3

To test, paste TabA in a sheet, then paste TabB as unformatted text over it. The empty line is not empty.

[Reproducible]
Always
Comment 1 ady 2023-11-21 13:42:37 UTC Comment hidden (obsolete)
Comment 2 MBS 2023-11-21 17:47:31 UTC Comment hidden (obsolete)
Comment 3 ady 2023-11-21 20:34:36 UTC Comment hidden (obsolete)
Comment 4 ady 2023-11-21 20:41:45 UTC Comment hidden (obsolete)
Comment 5 MBS 2023-11-22 13:38:52 UTC Comment hidden (obsolete)
Comment 6 MBS 2023-11-22 13:40:36 UTC Comment hidden (obsolete)
Comment 7 MBS 2023-11-22 13:44:13 UTC
Created attachment 190967 [details]
This is the libreoffice menu I see Alt-Ctrl-V

This is the menu I see, when I paste it using the right mouse button or Alt-Ctrl-V
Comment 8 ady 2023-11-22 18:28:09 UTC
Repro since LO 5.3. Not repro on 5.2.0.4 and older.

I'm not sure whether this is an implementation error, or a regression.

STR:

1. Select the following text and copy it to the clipboard ([CTRL]+[C]):

Legend;1;2;3
a;a-1;a-2;a-3
b;b-1;b-2;b-3
empty;;;
d;d-1;d-2;d-3

2. Open new Calc.
3. In Calc, menu Edit > Paste Special > Unformatted text (OK).
4. In the "text Import" dialogue, select _only_ the check box separated by semicolon; *ALL* the other options/settings/check boxes shall/must be OFF. OK.

5. Select the following text and copy it to the clipboard ([CTRL]+[C]):

Legend;1;2;3
b;b-1;b-2;b-3
empty;;;
d;d-1;d-2;d-3
e;e-1;e-2;e-3

6. In Calc, menu Edit > Paste Special > Unformatted text (OK).
7. In the "text Import" dialogue, select _only_ the check box separated by semicolon; *ALL* the other options/settings/check boxes shall/must be OFF. OK.


Until LO 5.2.0.4, the result is (as expected):

Legend;1;2;3
b;b-1;b-2;b-3
empty;b-1;b-2;b-3
d;d-1;d-2;d-3
e;e-1;e-2;e-3

Since LO 5.3, the result is inconsistent in the last column for empty/blank new fields (3rd row):

Legend;1;2;3
b;b-1;b-2;b-3
empty;;;b-3
d;d-1;d-2;d-3
e;e-1;e-2;e-3


With these settings in the import dialogue, IMO the result should had been as it was before, in LO 5.2.0.4 and older. Having said that, it is not entirely clear what should be the expected result when the "skip empty cells" option is used in the import dialogue.

At any rate, a differential replacement should be possible with some combination of settings (as opposed to a complete replacement, with some other combination of settings in the import dialogue).


@MBS,
Please next time follow the questions/instructions; the version information can be copied as text in new comments and there is no need to add screenshots just for that.

@MBS, Are you really assigning this report to yourself, in order to work on it?
Comment 9 MBS 2023-11-23 09:43:39 UTC Comment hidden (obsolete)
Comment 10 ady 2023-11-23 17:21:40 UTC
(In reply to MBS from comment #9)
> Concerning your description:
> 
> > Until LO 5.2.0.4, the result is (as expected):
> > 
> > Legend;1;2;3
> > b;b-1;b-2;b-3
> > empty;b-1;b-2;b-3
> > d;d-1;d-2;d-3
> > e;e-1;e-2;e-3
> 
> IMHO this is NOT what was to expect (unless "skip empty cells" was ticked),

In older LO versions, there was no "skip empty cells" option in the import text dialogue. That was the expected result at that time, because that was the way it worked back then.

For similar reasons, the STR in comment 8 do not include shortcuts or descriptions of dialogues, but rather a hint of steps that are relatively easy to follow in whichever version of LO – there are differences in shortcuts, UI and available options, depending on LO version.


> The "skip empty cells" option allows to fix a target table with new values
> (changed or extending the table) and leave the "good" values in the target
> by pasting empty fields over it, then the former values remain in the target.
> 
> > With these settings in the import dialogue, IMO the result should had been as it was before, in LO 5.2.0.4 and older.
> I disagree with that.
> 
> It should result in this:
> 
> Legend;1;2;3
> b;b-1;b-2;b-3
> empty;;;
> d;d-1;d-2;d-3
> e;e-1;e-2;e-3
> 
> [skip empty cells]
> btw when the "skip empty cells" option was ticked the result from comment 8
> would be:
> 
> Legend;1;2;3
> b;b-1;b-2;b-3
> empty;b-1;b-2;b-3
> d;d-1;d-2;d-3
> e;e-1;e-2;e-3
> 
> all source cells with values overwrite existing target cells (updating them)
> and empty ones from source will remain untouched in the target.
> Maybe this is the differential replacement you were looking for?

Right.

The tool tip on the "skip empty cells" option says:
  "If enabled, blank cells in source will not override the target."

(For this bug report, I would add an emphasis on the "source" term, and the fact that the source in this case is not really "cells" until the Text Import dialogue treats it in such way.)

So, with LO 7.6, the result of the STR from comment 8 should be:

Legend;1;2;3
b;b-1;b-2;b-3
empty;;;
d;d-1;d-2;d-3
e;e-1;e-2;e-3


whereas with the "skip empty cells" option set ON, the result should be:

Legend;1;2;3
b;b-1;b-2;b-3
empty;b-1;b-2;b-3
d;d-1;d-2;d-3
e;e-1;e-2;e-3


Either way, the reported bug is indeed present, and now we are clear about the _current_ (as of LO 7.6) expected results.

I am still not sure whether this is an "implementation error" or a "regression".
Comment 11 Laurent Balland 2023-12-05 19:48:57 UTC
If "Skip empty cells" is NOT checked, there is a bug in the last column

*** This bug has been marked as a duplicate of bug 129701 ***