Bug 156261 - Writer: Discrepancy between frame and graphical object management
Summary: Writer: Discrepancy between frame and graphical object management
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-12 16:28 UTC by ajlittoz
Modified: 2023-09-10 03:20 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Difference between image and drawing viz. frames (87 bytes, text/plain)
2023-07-12 16:28 UTC, ajlittoz
Details
Fixed document showing differences between frame and drawing object (76.16 KB, application/vnd.oasis.opendocument.text)
2023-09-07 08:39 UTC, ajlittoz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ajlittoz 2023-07-12 16:28:30 UTC
Created attachment 188340 [details]
Difference between image and drawing viz. frames

Experiment made with LO 7.5.3.2 under Fedora 32, Linux kernel 6.3.12, KDE Plasma desktop (Qt widgets)

When an image is pasted into a document, Writer encloses it into a frame (or makes the image a frame) which is styled Graphics. Since this is frame, properties can easily be controlled by a frame style and tuning the layout of all images is easy.

Now make a drawing in Draw.Of course, this is not an image. Copy it and paste it into Writer.

All drawing components are _grouped_ even if this was not done by user, so that they appear as a single graphical object. But the object is inserted "as is" at its anchor point. No frame contains it. This means no frame style can be assigned to it and no central management is possible. Every drawing, though supposed to have the same layout properties (such as wrap, spacing and alignment), must be manually adjusted.

However a bounding box can be computed (and this is done to display a selection rectangle with handles). And it could be the basis for a frame.

I have also tried to anchor the drawing inside a (text) frame and use autosize properties to adjust the frame to drawing size. Unfortunately, horizontal autosizing does not work. This may be on purpose because autosizing text would end up with a frame extending from margin to margin (or even worse). Nevertheless, this makes "jailing" a drawing very unfriendly.

The attached shows thre cases:
1 - image (correctly contained in a frame)
2 - drawing (on its own)
3 - attempt to constrain a drawing inside a frame

If this is not a bug, consider the present report as a feature enhancement request to put any external content inside a frame. I don't target any drawing done "internally" with Writer graphical tools. If user does so, he is assumed to be aware of all hazards in the procedure and accept the consequences. My target is whatever illustration prepared outside of Writer to be inserted as an atomic block.
Comment 1 ajlittoz 2023-07-17 08:50:25 UTC
For what it's worth: my present workaround is to anchor the drawing "As character" and play with character and paragraph styles but this is not equivalent to the positioning possibilities.
Comment 2 Regina Henschel 2023-07-17 16:39:25 UTC
Do you request, that a selection of several objects in Draw is automatically grouped when it is inserted in Writer?

Drawing objects like Rectangle, Polygon, Custom-shape or Bezier-curve cannot be in a <draw:frame> element in principle. A <draw:frame> element can have <draw:image>, <draw:text-box> or <draw:object-ole> as child element, for example.

LibreOffice does not support to assign a style to drawing objects in Writer. That is a known limitation, but I don't find the bug report.
Comment 3 ajlittoz 2023-07-19 15:15:05 UTC
(In reply to Regina Henschel from comment #2)
> Do you request, that a selection of several objects in Draw is automatically
> grouped when it is inserted in Writer?
> 
No, this is seemingly done by Writer (or Draw?) presently. I was not aware of it, but it is OK for me.

> Drawing objects like Rectangle, Polygon, Custom-shape or Bezier-curve cannot
> be in a <draw:frame> element in principle. A <draw:frame> element can have
> <draw:image>, <draw:text-box> or <draw:object-ole> as child element, for
> example.
> 
Thanks for the explanation.

> LibreOffice does not support to assign a style to drawing objects in Writer.
> That is a known limitation, but I don't find the bug report.
This is really a really bad limitation. But suppressing it might have serious consequences. So the safest is probably to allow drawing objects inside a frame.

The document I'm working on contains many drawings (relations between DB records, akin to flow charts) and it is a real pain to adjust the objects individually. This is why I switched to "anchor as character", but this is not fully satisfactory.
Comment 4 Regina Henschel 2023-07-19 16:54:59 UTC
The attachment does not work for me. I get a line of text ",parmelan,boutae.21Artificiers,12.07.2023 18:22,file:///home/pat/.config/libreoffice/4;"
Please attach the file again.


(In reply to ajlittoz from comment #3)
> > LibreOffice does not support to assign a style to drawing objects in Writer.
> > That is a known limitation, but I don't find the bug report.
> This is really a really bad limitation. But suppressing it might have
> serious consequences. So the safest is probably to allow drawing objects
> inside a frame.

Only to be clear, that is the file markup view. Of cause you can insert a frame and put the content of the clipboard into the frame. It will then be inside a <draw:text-box> element in the file markup.

The limitation, that Writer does not allow styles for drawing objects is artificial from point of markup in file. It needs "only" a developer to implement it.
Comment 5 ajlittoz 2023-09-07 08:39:25 UTC
Created attachment 189408 [details]
Fixed document showing differences between frame and drawing object

Uploaded the requested document
Comment 6 QA Administrators 2023-09-10 03:20:45 UTC Comment hidden (obsolete)