Bug 140853 - RTF paste meddles with results of next (regular) paste
Summary: RTF paste meddles with results of next (regular) paste
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Paste RTF-Paste
  Show dependency treegraph
 
Reported: 2021-03-07 10:04 UTC by Telesto
Modified: 2023-03-28 09:06 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (136.87 KB, application/vnd.oasis.opendocument.text)
2021-03-07 10:04 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2021-03-07 10:04:33 UTC
Description:
RTF paste meddles with results of next (regular) paste

Steps to Reproduce:
1. Open the attached file
2. CTRL+A
3. CTRL+C
4. CTRL+N
5. CTRL+V (proper_
6. CTRL+Z or CTRL+N
6. CTRL+SHIFT+V RTF
7. CTRL+Z
8. CTRL+V

I speculate this only happening on 'new' documents. Not working pre-existing (speculation)

Actual Results:
On step 8 same paste result as RTF paste

Expected Results:
Regular paste (proper formatting)


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 722ec600e85cca2e94e82e69f8d13773061172b9
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: nl-NL
Calc: CL
Comment 1 Telesto 2021-03-07 10:04:47 UTC
Created attachment 170295 [details]
Example file
Comment 2 Telesto 2021-03-07 10:10:14 UTC
Also in 6.4

and in
Version: 6.2.9.0.0+ (x86)
Build ID: 5f01fe15eb2661f1f9ce12d1d99dc2a705b462ee
CPU threads: 4; OS: Windows 6.3; UI render: GL; VCL: win; 
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: CL


still fine in
Version: 6.0.6.0.0+
Build ID: c30963b8b4bbbe42a24b97aafa161eff9d7ccdd4
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: nl-NL (nl_NL); Calc: CL

crash at undo in 6.1
Comment 3 Telesto 2021-03-08 16:40:56 UTC
The crashing at step 6 stopped (and started to show the current result) with.

author	Caolán McNamara <caolanm@redhat.com>	2018-08-23 17:19:07 +0100
committer	Miklos Vajna <vmiklos@collabora.co.uk>	2018-08-27 09:27:02 +0200
commit 1f1e349bbee1b2bff01a850d9a7fe4d6a77c4f29 (patch)
tree b5a5348fc33590bee0ddd87af744878fb0eb9c72
parent b1d1edff4e81a8299e2a17c7e562d144329549ab (diff)
Resolves: tdf#118382 crash on paste of rtf
into an existing document since....

commit deaa16bd24fba4a3a6b072ab2b94542a7dbd41c6
Author: Serge Krot <Serge.Krot@cib.de>
Date:   Mon Jan 29 12:17:06 2018 +0100

    tdf#72942 Do not overwrite styles from the inserted doc

    During inserting of the text from the external document
    we should not change original default styles in
    currently opened document.

because missing styles aren't created, so there's exceptons
thrown on their use.

I see that the m_bIsNewDoc flag is already checked for since...

commit 5ebe826caf75e8d00656b3333385bf0bbc05cb27
Author: Miklos Vajna <vmiklos@collabora.co.uk>
Date:   Fri Oct 4 11:02:59 2013 +0200

    fdo#69384 fix impress -> writer copy&paste

    Regression from 2ade07126971b79c92f729fae5709f2e2e2b495c (fdo#62044 RTF
    import: don't overwrite existing styles when pasting, 2013-06-04),
    during paste, if existing style was found, then the intention was to
    skip that style, but instead we tried to create one.

in the body of the following loop, which should mean that existing
styles are left alone and only missing styles created if we remove
this hunk of the tdf#72942 commit
Comment 4 Telesto 2021-03-08 16:45:50 UTC
@Caolan
I assume this is started with commit deaa16bd24fba4a3a6b072ab2b94542a7dbd41c6 (Serge Krot). The result can be seen clearly after your commit - the bibisected one - solving the crash. 

So not saying it's your regression.. but I think something missed at the undo side of the whole exercise.
Comment 5 Dieter 2021-03-23 07:15:40 UTC
I confirm it with

Version: 7.1.2.1 (x64) / LibreOffice Community
Build ID: 094b4116e8de6d2085e9b65d26912d6eac4c74a9
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL
Comment 6 QA Administrators 2023-03-25 03:24:09 UTC Comment hidden (obsolete)
Comment 7 Dieter 2023-03-28 09:06:18 UTC
Still present in

Version: 7.5.2.1 (X86_64) / LibreOffice Community
Build ID: e8bf3b441b8370f8440b0339fd9490765a8d57ca
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

Result is something in between regular paste and RT paste