Copy/paste of simple box turns result into a PNG image, can I stop this behaviour?

I know this is a weird question, but here goes.

For a project I’m working on I have been looking at some of the flat XML output and noticed if you copy/paste a box the resulting graphic object is saved as a PNG binary-data in the XML.

It doesn’t always happen. If you click the box once to select it the highlight turn orange and then copy/paste turns it into a PNG. If you click the box twice the highlights turn green and then it copies the box as a shape. This happens with text object too.

I’m wondering if there is anyway to stop this behaviour and get Draw to copy/paste as graphic object not PNGs.

LibreOffice Version 24. 2.7.2

1 Like

What are the exact steps to reproduce? Where do you see the flat XML? Do you have two Draw documents, selecting a “box” from one, pasting to the other, and saving that other as FODG? Or are you checking the clipboard content? Which OS do you use?

To reproduce: open blank Draw doc. Create box with Rectangle tool. Click box once to select. Right click to copy, Left click to paste. The new copy is now a PNG object.

I’m using Arch Linux. There is nothing in the clipboard before or after the copy/paste.

Below is the FODG that I see. It has two graphic objects, first a “custom-shape” for the first box and
draw:image for the second.

    <office:drawing>
   <draw:page draw:name="page1" draw:style-name="dp2" draw:master-page-name="Default">

    <draw:custom-shape draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout" svg:width="3cm" svg:height="2.5cm" svg:x="1.5cm" svg:y="1.5cm">
     <text:p/>
     <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:type="rectangle" draw:enhanced-path="M 0 0 L 21600 0 21600 21600 0 21600 0 0 Z N"/>
    </draw:custom-shape>

    <draw:frame draw:style-name="gr2" draw:text-style-name="P1" draw:layer="layout" svg:width="2.989cm" svg:height="2.513cm" svg:x="1.511cm" svg:y="4.987cm">
     <draw:image loext:mime-type="image/png">
      <office:binary-data>iVBORw0KGgoAAAANSUhEUgAAAHEAAABfCAYAAADf2CiWAAABGklEQVR4nO3RwY3CUBTAwPcR
       1dABBxqiMYpMNtke4ICwZiqw5HV/vo5t+1vDz7ru+7Ee99us5eMvOs5zv3w7gs+ZGGBigIkB
       JgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkB
       JgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkB
       JgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkB
       JgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkBJgaYGGBigIkB15mZc2b/dghvOmf7B1mGEYUS
       JK03AAAAAElFTkSuQmCC
      </office:binary-data>
      <text:p/>
     </draw:image>
    </draw:frame>

   </draw:page>
  </office:drawing>


Have you tested in Safe Mode?

I had never heard of safe mode. But I found out about it and tried it.
I found it I copy/paste a box it becomes a PNG. But if I hold the control and drag a copy it
stays a graphic object.

I’m using a lot more control/drag to copy now. I still don’t understand why Draw is turning graphic
shapes into PNGs. Seems weird to me.

It sounds as if there is a clipboard manager running. There is often a limited number of formats they store so they won’t paste, for example, LibreOffice Draw format.

1 Like

I don’t have a real clipboard manager running. I’m running Arch Linux with xorg and XFCE4 desktop. Perhaps there is something in that pile of software interfering with the copy/paste.

You might like to look at this similar question, Libre Impress - cut and paste text box results in Image not a text box and add to the bug report. Don’t forget to add details of LibreOffice and system. You could also add the urls of the two questions.

Hello Earnest,
Yes, I should do that and will but I was pushed for time having spent so long on this problem and a problem with a display port not working… more forums! :slight_smile: That I had a pile of must do things.
Thanks
Shay

See: LibreOffice copy/paste issue xfce 20.3

I found a solution to this issue. Instead of using right click copy/paste to copy a rectangle object, I selected the box then used the “control” key to copy/drag a new version. Draw would keep the object as a graphic and did not turn it into a PNG.

BTW… I tried an older version of Draw (version 6.4.7.2) and it did not copy/paste graphic object into PNGs.