Bug 160555 - Pasting text with default style attributes after differently styled text gives unexpected results
Summary: Pasting text with default style attributes after differently styled text give...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.6.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Paste
  Show dependency treegraph
 
Reported: 2024-04-05 23:47 UTC by Ulrich Windl
Modified: 2024-05-24 07:48 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample document showing the effect (10.81 KB, application/vnd.oasis.opendocument.text)
2024-04-05 23:47 UTC, Ulrich Windl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Windl 2024-04-05 23:47:23 UTC
Created attachment 193531 [details]
Sample document showing the effect

I think this is a bug, because it results in poor usability, and it's counter-intuitive:

Consider you have a text document with
(default-styled text)(e.g. bold text)

Now if you mark all text in the line and paste it at the end of the line, what happens?

You do *not* get this:
(default-styled text)(e.g. bold text)(default-styled text)(e.g. bold text)

But instead you get:
(default-styled text)(e.g. bold text)(bold text)(e.g. bold text)

That is the style at the end of the line (at the cursor) is not "canceled" when inserting unstyled text, but the attributes are "continued".

Usually when pasting text, the text is pasted *with* attributes (unless you use special paste), but that's not happening here, or at least not as expected.

In contrast when you start with
(e.g. bold text)(default-styled text)

And repeat the experiment, you get (the expected)
(e.g. bold text)(default-styled text)(e.g. bold text)(default-styled text)

because the style at the cursor (end of line) is *not* "continued".

See the sample document.
Comment 1 Armondo Lopez 2024-04-10 21:22:21 UTC
Thanks for submitting the bug. I can confirm that it is present in

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a2265e8faa099d9652efd12392c2877c2df1d1eb
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

as well as

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 2 Ulrich Windl 2024-05-24 07:48:02 UTC
Today I had another variant of the problem in the recent version:
I had multiple list item formatted like
"<monospace>test</> (<monospace>text</>)" (the XML-like syntax is to show the formatting, so the space and parentheses are formatted with defaulkt (no) style.
When I copied " (<monospace>text</>)" and pasted it at the end of an existing list item (so save time assigning the formats), the final ")" has <monospace> format (actually everything had <monospace> format). This clearly should not be.

Version: 24.2.3.2 (x86) / LibreOffice Community
Build ID: 433d9c2ded56988e8a90e6b2e771ee4e6a5ab2ba
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL threaded