Bug 167023 - Pasting a shape from Writer into draw fails silently
Summary: Pasting a shape from Writer into draw fails silently
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:26.2.0 target:25.8.0.0.beta2
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2025-06-15 10:27 UTC by Telesto
Modified: 2025-07-28 14:29 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2025-06-15 10:27:17 UTC
Description:
Pasting a shape from Writer into draw fails silently  

Steps to Reproduce:
1. Open Writer
2. Draw a shape (say rectangle)
3. Copy it (CTRL+C)
4. Open new draw document
5. Paste (CTRL+V) -> Silently fails

Spin-off from bug 167018 

Bisected to:
$ git bisect bad 108cbccf45f42d96c1284aaabdfcfe86ed9c5923 is the first bad commit
commit 108cbccf45f42d96c1284aaabdfcfe86ed9c5923
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Thu Apr 17 01:24:07 2025 -0700

    source 7dddd449068d69ec2f47bfca2487f01fa7067fd0

    source 7dddd449068d69ec2f47bfca2487f01fa7067fd0


Actual Results:
Paste will fail. Previously crash (bug 167018)

Expected Results:
Pasting the shape


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 220ef19df9de6ee7a99173a514402a9e701748d1
CPU threads: 4; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded
Comment 1 Telesto 2025-06-15 10:27:50 UTC
Setting to NEW: see bug 167018
Comment 2 Regina Henschel 2025-06-15 18:30:53 UTC
When I look at the clipboard with app "Free Clipboard Viewer" and therein type "Drawing Format", I can see that the content of the clipboard is faulty in case of copying from Writer. The content ends unexpected after 2024 bytes. The content should end with </office:document>. That is the case when you copy something from Calc to the clipboard, for example.

Thus not only paste to Draw does not work, but paste to Calc or Impress works neither.
Comment 3 Mike Kaganski 2025-06-15 18:51:37 UTC
https://gerrit.libreoffice.org/c/core/+/186526
Comment 4 Regina Henschel 2025-06-15 19:23:05 UTC
2024 -> 2048
Comment 5 Mike Kaganski 2025-06-15 19:28:54 UTC
(In reply to Regina Henschel from comment #2)

This specific problem seems unrelated, and long-preexisting. There is an exception thrown when exporting draw:background-size - it generates an empty Any, which throws in any2bool. For some reason, it is handled as a bool value, with "true" written as "full", and "false" as "border". This is likely a topic that Michael knows best (who implemented the full background in bug 122508); but as said, this is likely a different problem needing a separate bug report.
Comment 6 Regina Henschel 2025-06-15 20:17:46 UTC
(In reply to Mike Kaganski from comment #5)
> (In reply to Regina Henschel from comment #2)
> 
> This specific problem seems unrelated, and long-preexisting. There is an
> exception thrown when exporting draw:background-size - it generates an empty
> Any, which throws in any2bool. For some reason, it is handled as a bool
> value, with "true" written as "full", and "false" as "border". This is
> likely a topic that Michael knows best (who implemented the full background
> in bug 122508); but as said, this is likely a different problem needing a
> separate bug report.

You are right. The incomplete XML comes in between 7.5.7 and 7.6.4.
=> bug 167035
Comment 7 Commit Notification 2025-06-15 20:20:08 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/de9be6b3520f89f266e14ac1466ca05461b3df4c

tdf#167023: only try PasteSlidesFromSystemClipboard with correct descriptor

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Regina Henschel 2025-06-16 05:48:49 UTC
Draw a shape in Writer.
From its context menu choose "Add Text Box".
Enter some text in the box.
Deselect shape
Copy shape to clipboard.
Start Draw and paste it in Drawing Format.

I get a failing assertion in svx/source/unodraw/unopage.cxx:
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in soffice.bin.
It comes from;
777          default: // unknown inventor
778          {
779              assert(false && "Unknown Inventor in SvxDrawPage::CreateShape()");
780              break;
781          }

tested in Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 10b7f18b9832e9f7761814ea9baeba1e921dca88
CPU threads: 32; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded

Copy & paste with a shape without an attached text box works now.
Comment 9 Mike Kaganski 2025-06-16 05:53:28 UTC
(In reply to Regina Henschel from comment #8)

Please one report for one problem.
Comment 10 Commit Notification 2025-06-16 11:18:03 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f2e8141fdb80611dd2c27924ece8edd56e11a332

tdf#167023, tdf#167018: sw: Add UItest

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2025-06-16 12:47:37 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/44f49131facf53632c6da66eb8ce2fdef734cb1d

tdf#167023: only try PasteSlidesFromSystemClipboard with correct descriptor

It will be available in 25.8.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2025-06-16 14:54:58 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/31d4f5624a7019dbd9a59b6769290db409e8236f

tdf#167023, tdf#167018: sw: Add UItest

It will be available in 25.8.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2025-06-16 16:49:13 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/c4776e71362ded19be28b9c5f6459d988b750c91

tdf#167023, tdf#167018: sw: Add UItest

It will be available in 25.2.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Kamil Landa 2025-07-28 14:19:24 UTC
Hide Page Pane in Draw before CTRL+V (uncheck View > Page Pane) and it will crash


Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7f4868348c14b305fcd75744e1e3544d0d3a5d61
CPU threads: 8; OS: Windows 10 X86_64 (build 17763); UI render: Skia/Raster; VCL: win
Locale: cs-CZ (cs_CZ); UI: en-US
Calc: CL threaded
Comment 15 Mike Kaganski 2025-07-28 14:29:41 UTC
(In reply to Kamil Landa from comment #14)
Create a new bug report (click New in the top bar here) and it will be looked into