Issue 97291 - Incorrect graphic size and aspect ration on insert.
Summary: Incorrect graphic size and aspect ration on insert.
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-16 00:03 UTC by andrew
Modified: 2017-05-20 11:28 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Example of the resulting problem, and contains the macro. (61.66 KB, application/vnd.sun.xml.writer)
2008-12-16 00:04 UTC, andrew
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
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".