Apache OpenOffice (AOO) Bugzilla – Issue 97291
Incorrect graphic size and aspect ration on insert.
Last modified: 2017-05-20 11:28:11 UTC
Insert an image into a table cell using the API. If the image size is too wide for the table cell, then the image sizes incorrectly. This process works just fine when using the GUI. I saw this behavior after inserting the image into a table cell using the following code: oDoc = ThisComponent oText = oDoc.getText() oTable=oDoc.getTextTables().getByName("Table1") oImage = oDoc.createInstance( "com.sun.star.text.GraphicObject" ) oImage.GraphicURL = "file:///andrew0/home/andy/Pelosi.jpg" oImage.AnchorType = com.sun.star.text.TextContentAnchorType.AS_CHARACTER oCell = oTable.getCellByPosition( 0, 0 ) oText = oCell.getText() oCursor = oText.createTextCursor() oText.insertTextContent( oCursor, oImage, False ) When the image is inserted into the table, a height and width are assigned. The assigned height and width have the correct aspect ration.Unfortunately, the width is wider than the table cell. After inserting the image, look at the actual height and width from the graphic dialog. The values are completely wrong. Of course, you can't check the actual size of the image (see http://www.openoffice.org/issues/show_bug.cgi?id=85105).
Created attachment 58837 [details] Example of the resulting problem, and contains the macro.
I should mention that this problem did NOT exist in OOo 2.4, so this error is a regression.
jsc -> os: it's a writer issue, can you take care of it
Reset assigne to the default "issues@openoffice.apache.org".