Issue 97291

Summary: Incorrect graphic size and aspect ration on insert.
Product: App Dev Reporter: andrew
Component: apiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Example of the resulting problem, and contains the macro. none

Description andrew 2008-12-16 00:03:05 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).
Comment 1 andrew 2008-12-16 00:04:21 UTC
Created attachment 58837 [details]
Example of the resulting problem, and contains the macro.
Comment 2 andrew 2008-12-16 00:08:58 UTC
I should mention that this problem did NOT exist in OOo 2.4, so this error is a
 regression.
Comment 3 jsc 2008-12-16 11:21:45 UTC
jsc -> os: it's a writer issue, can you take care of it
Comment 4 Marcus 2017-05-20 11:28:11 UTC
Reset assigne to the default "issues@openoffice.apache.org".