Changing the object created by imported docx

Miklos Vajna vmiklos at
Tue Oct 15 10:11:36 CEST 2013

Hi Jacobo,

On Tue, Oct 15, 2013 at 09:44:48AM +0200, Jacobo Aragunde Pérez <jaragunde at> wrote:
> I've been thinking on potential solutions to #70457 [1]. It's related
> with rotation information lost when importing a docx that contains some
> bitmap.
> Writer bitmaps are only allowed to be rotated in 90º steps, but in Word
> they can be rotated to any angle. When importing a document containing a
> 45º bitmap the rotation is lost, and it keeps lost when the document is
> saved back.
> I wonder if importing embedded bitmaps coming from docx as Draw objects
> would be an acceptable solution for this bug (Draw objects allow to be
> rotated to any arbitrary position).
> Such a change should be discussed first, imho. What do you think?

The problem is that if you change the shape import in docx to always
produce drawinglayer shapes (as opposed to Writer ones), then you'll
introduce regressions, like you'll loose image cropping.

Here is a comparision:

An idea out of that trap is to define a set of corner cases when
drawinglayer picture import happens (e.g. start with "if special
rotation angle"); and hope that that's rare enough, e.g. if a shape has
a special rotation, then probably it doesn't have cropping as well.
That won't be perfect, either, but much easier than implementing proper
Writer picture rotation in sw core.

We do something similar for textboxes already: if it's a normal textbox,
then it's imported as a writer textframe, but if it's inside a group
shape, then it's imported as a drawinglayer rectangle (since writer
textframes can't be part of group shapes).

Hope this helps,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <>

More information about the LibreOffice mailing list