Bug 149539 - Anchor to character changes anchored location (different character) on paste compared to the character it anchored to on cut
Summary: Anchor to character changes anchored location (different character) on paste ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, implementationError
Depends on:
Blocks: Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2022-06-12 22:08 UTC by Telesto
Modified: 2024-08-12 14:55 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (50.56 KB, application/vnd.oasis.opendocument.text)
2022-06-12 22:08 UTC, Telesto
Details
Example file (50.65 KB, application/vnd.oasis.opendocument.text)
2022-06-13 07:37 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2022-06-12 22:08:06 UTC
Description:
Anchor to character anchors to different character on paste compared to the character it anchored to on cut

Steps to Reproduce:
1. Open the attached file
2. Select the image or shape. notice anchor being anchored behind 'ghi' 
3. Double click ghi (in one of both lines)
4. CTRL+X
5. CTRL+V
6. Select the image again

Actual Results:
Anchor has moved

Expected Results:
The image was included in the selection. I would expect the anchor being at the same spot


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.4.0.0.alpha1+ / LibreOffice Community
Build ID: 62531ec1091c7b3f6a3577889a18234790ec716d
CPU threads: 8; OS: Mac OS X 12.3.1; UI render: Skia/Metal; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 1 Telesto 2022-06-12 22:08:22 UTC
Created attachment 180700 [details]
Example file
Comment 2 Telesto 2022-06-13 07:17:46 UTC
Found in
Versie: 6.4.0.2 (x86)
Build ID: 08d19fecdc7a2298d051e19cfdb7c35544855fc3
CPU-threads: 4; Besturingssysteem: Windows 6.3 Build 9600; UI-render: GL; VCL: win; 
Locale: nl-NL (nl_NL); UI-taal: nl-NL
Calc: CL

cut not including image in  6.3.0.4 and Version: 6.2.9.0.0+ (x86) and older
Comment 3 Telesto 2022-06-13 07:37:49 UTC
Created attachment 180715 [details]
Example file

Modified version, with some bigger playground
Comment 4 Telesto 2022-06-13 07:41:52 UTC
Variant
1. Open the attached file
2. select GHI
3. Drag it after 'nop' -> Image is select, text moves, anchor moves backwards (anchoring to abc). 

In older versions it would anchor to 'klm'
Comment 5 Telesto 2022-06-13 07:51:38 UTC Comment hidden (obsolete)
Comment 6 Telesto 2022-06-13 07:53:13 UTC
@Michael Stahl
I guess you're change including the anchor in the selecting having a unexpected consequence. It's bundle on 'cut', but on paste the link between image an anchor breaks. The image is anchoring to different character. So repeat cut/paste of the same characters will exclude the image

In this case here this really unexpected. However there likely more to the 'to anchoring' behaviour.. It is pretty good in avoiding anchoring to certain in an area causing page of the document which are now to cause layout issues (page loops etc). So forcing an paste characters and anchor as a bundle might have unintended consequences.

Next best would some likely try paste text + with anchor at this position, but fail if this will cause problems.
Comment 7 Dieter 2022-06-21 14:14:51 UTC
I confirm behaviour with

Version: 7.3.4.2 (x64) / LibreOffice Community
Build ID: 728fec16bd5f605073805c3c9e7c4212a0120dc5
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Same behaviour with cut & paste and copy & paste. So we should take into account all these situations. I set status to NEW, but I'm not sure about the result of copy & paste.
Comment 8 QA Administrators 2024-06-21 03:17:47 UTC Comment hidden (obsolete)
Comment 9 Buovjaga 2024-08-12 14:55:38 UTC
(In reply to Telesto from comment #4)
> Variant
> 1. Open the attached file
> 2. select GHI
> 3. Drag it after 'nop' -> Image is select, text moves, anchor moves
> backwards (anchoring to abc). 
> 
> In older versions it would anchor to 'klm'

Bibisected this change with linux-64-6.4 to 28b77c89dfcafae82cf2a6d85731b643ff9290e5
tdf#117185 tdf#110442 sw: bring harmony & peace to fly at-char selection