Bug 95790 - FORMATTING: Copy/paste of text sometimes loses formatting
Summary: FORMATTING: Copy/paste of text sometimes loses formatting
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Paste Formatting-Text-Diverse
  Show dependency treegraph
 
Reported: 2015-11-13 05:28 UTC by Luke Kendall
Modified: 2019-08-31 10:35 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
zip file of 7 screen shots showing an example (82.52 KB, application/zip)
2015-11-13 05:28 UTC, Luke Kendall
Details
Screenshots and files to reproduce the same or related problem (684.56 KB, application/zip)
2016-09-20 09:47 UTC, Luke Kendall
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kendall 2015-11-13 05:28:35 UTC
Created attachment 120518 [details]
zip file of 7 screen shots showing an example

I don't think this is the same bug as 88923.

Sometimes, when I copy text from one document and paste it into another, some of the formatting (italics) is lost.  E.g. when I copied my entire novel from one template into a new template, it lost about 25% of the uses of italics.

On one occasion today (out of roughly one hundred instances), the formatting was lost in two places within one short paragraph.

I took a series of screen shots to illustrtae the problem, as it appears to occur randomly.  The 1st two files show the paragraph in the source (1) and the target (2) documents: only the paragraph styles (including font) differ.

After pasting the paragraph from the src into the target, the paragraph style is wrong for the target document- image 3.  That's not a big deal, but note that all the text became italic.

Image 4 is after setting the paragraph style to the desired style for the taregt doc. Note that all italics are now gone.

Images 5, 6, 7 just show a needed edit (5) and then the italics restored (6, 7).
As I said, this happens in only a small percentage of cases. Copy/past of most blocks of text (parts of or whole paragraphs), the italicisation transfers correctly.
Comment 1 Buovjaga 2015-11-15 16:35:03 UTC
Could not reproduce from scratch. Might be the structure of your particular document.

Maybe you could produce a minimal example document that faithfully reproduces the bug. I know it's a long shot considering, how it occurs "sometimes" for you..

Win 7 Pro 64-bit, Version: 5.0.3.2 (x64)
Build ID: e5f16313668ac592c1bfb310f4390624e3dbfb75
Locale: fi-FI (fi_FI)

Ubuntu 15.10 64-bit 
Version: 5.0.2.2
Build ID: 00m0(Build:2)
Locale: en-US (en_US.UTF-8)
Comment 2 Timur 2016-09-20 08:16:14 UTC
This should've been marked as Needinfo but anyway, left for quite enough without a response with an example.
Comment 3 Luke Kendall 2016-09-20 09:47:14 UTC
Created attachment 127453 [details]
Screenshots and files to reproduce the same or related problem

As you say, it's hard to reproduce: in a 150k word document, it occurred to only a small percentage of the text.

I tried to reproduce it tonight.  I can't make sense of what LO has done, in the example provided: while it hasn't changed the italics, it changed the paragraph style, the font, and the font size, in varying ways that made no sense to me.

I have attached screenshots of what I saw, the source document and target document, and annotated copies of the source doc and the target.

The target document's text is copied from Wikipedia.  
The steps to reproduce are:

1. Place the cursor after "import/export filters.[8][9]" in copy-paste-target.odt
2. Hit Enter
3. Select all and copy from copy-paste.odt
4. Paste into copy-paste-target.odt
5. Observe the result.

It's actually worse than this: when I re-opened the file copy-paste.odt, the fonts did not appear as I recalled (i.e. as you will see displayed in the screenshots provided).  In particular, the text for the references/hyperlinks "[8][9]" is in a larger font, and I'm not even sure it's the same font.

The text for the target document was created by opening a new Text doucment, selecting the text from the 1st four paragraphs of https://en.wikipedia.org/wiki/LibreOffice, and pasting into that new document.

I hope this information is helpful.
Comment 4 Luke Kendall 2016-09-20 09:48:55 UTC
I should have added: tonight's files were prepared using:

Version: 5.1.4.2
Build ID: 1:5.1.4-0ubuntu1
CPU Threads: 4; OS Version: Linux 4.4; UI Render: default; 
Locale: en-AU (en_AU.UTF-8)
Comment 5 Buovjaga 2016-09-29 10:18:32 UTC
In your copy-paste-4.png I presume the "result to be observed" is the paragraph "Leeth paused, looking at the spaces between the people." turning blue, changing font and indentation.
In my test, only the indentation is lost.

I guess I'll set to NEW anyways.

Win 7 Pro 64-bit Version: 5.3.0.0.alpha0+
Build ID: 3d9231dd4945dcd6c3d53ba11152049d382b975f
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-09-28_02:14:14
Locale: fi-FI (fi_FI); Calc: CL
Comment 6 Luke Kendall 2016-09-29 11:01:11 UTC
Yes.  "copy-paste-3-(source).png" shows the text that's being pasted into the target document from the source document.

My guess is that by hitting Enter with the cursor placed immediately to the right of the hypertext link [9], that font size and colour is somehow still attached to the empty line.  And because that line is adjacent to the small-blue font style, for some reason that style is propagated into the whole paragraph that is the text "Leeth paused, looking at the spaces between the people."

It seems very wrong to me, that the style of any of the pasted text should change.  I think there's a big difference in intent between pasting formatted text, and typing in fresh text or pasting in unformatted text.

Please forgive me for asking, but is there any chance you placed the cursor in front of "LibreOffice" on the next line, instead of after "import/export filters.[8][9]" when inserting the newline?  It's interesting that you get a different result to me.  Would you expect that to behave differently between Linux and Windows?
Comment 7 Buovjaga 2016-09-29 12:17:09 UTC
(In reply to Luke Kendall from comment #6)
> Please forgive me for asking, but is there any chance you placed the cursor
> in front of "LibreOffice" on the next line, instead of after "import/export
> filters.[8][9]" when inserting the newline?  It's interesting that you get a
> different result to me.  Would you expect that to behave differently between
> Linux and Windows?

Yes, I am sure and I tried again just now on Linux. Same result.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.3.0.0.alpha0+
Build ID: 7cf444454c0c27e2f6d764164ea880b87163f45a
CPU Threads: 8; OS Version: Linux 4.7; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on September 27th 2016

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 8 Luke Kendall 2016-09-29 14:14:02 UTC
Thanks for re-checking that!
Comment 9 QA Administrators 2018-07-06 02:46:17 UTC Comment hidden (obsolete)
Comment 10 Timur 2018-07-06 10:39:14 UTC
This bug is a mess. Too much talk instead of simple facts. 
Only issue confirmed is indent change. 
And that one is discussed in other bugs. See Bug 68271.
I close as Invalid.