https://bugs.documentfoundation.org/show_bug.cgi?id=167809

Igor Támara <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #2 from Igor Támara <[email protected]> ---
To avoid this problem, instead of using
`com.sun.star.presentation.GraphicObjectShape`, better use
`com.sun.star.drawing.GraphicObjectShape`

As in

```
def __insert_image_as_draw__():
            """
            Inserts the image with width*height from the path in the document
adding
            the accessibility data from sh_client in a draw document centered
            and above all other elements in the current page.
            """

            size = Size(width, height)
            #
https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1drawing_1_1GraphicObjectShape.html
            image =
self.doc.createInstance("com.sun.star.drawing.GraphicObjectShape")
            image.GraphicURL = uno.systemPathToFileUrl(img_path)

            ctrllr = self.model.CurrentController
            draw_page = ctrllr.CurrentPage

            draw_page.addTop(image)
            added_image = draw_page[-1]
            added_image.setPropertyValue("ZOrder", draw_page.Count)

            added_image.Title = sh_client.get_title()
            added_image.Name = sh_client.get_imagename()
            added_image.Description = sh_client.get_full_description()
            added_image.Visible = True
            self.model.Modified = True
            os.unlink(img_path)

            if self.inside == "calc":
                return

            added_image.setSize(size)
            position = Point(
                ((added_image.Parent.Width - width) / 2),
                ((added_image.Parent.Height - height) / 2),
            )
            added_image.setPosition(position)
```

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to