OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

HELP OO 3.0

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
ernst_org
General User
General User


Joined: 04 Sep 2007
Posts: 38

PostPosted: Tue Nov 25, 2008 2:30 pm    Post subject: HELP OO 3.0 Reply with quote

I have hade no problem to insert images in a table using this code

Code:

      
    oDoc = ThisComponent
   
    TextTables = oDoc.createInstance( "com.sun.star.text.TextTable" )
    oViewCursor = oDoc.getCurrentController().getViewCursor()
    oText = oDoc.getText()
    TextTables = oDoc.getTextTables()
   oTable=TextTables.getByName("TabellLogotyp")
    oImage = oDoc.createInstance( "com.sun.star.text.GraphicObject" )
   oPath=   getIniPath(inifil)

lFil="/Logotyp_Int.jpg"

   
   oImage.GraphicURL = "file:///" & oPath & lFil
   
   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 )



But after updating to 00 3.0 then the with and hight is totaly wrong. Can any one help me.... ???
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Mon Dec 15, 2008 3:15 pm    Post subject: Reply with quote

I spent about an hour looking at this, and I noticed that the behavior appears to be different depending on the size of the image. When I inserted a rather small graphic, everything looked fine. A larger graphic, and things went wrong. I think that this is a bug.
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
ernst_org
General User
General User


Joined: 04 Sep 2007
Posts: 38

PostPosted: Mon Dec 15, 2008 3:29 pm    Post subject: ok Reply with quote

Thanks for the look, than I know that!
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Mon Dec 15, 2008 4:06 pm    Post subject: Reply with quote

I created an issue for the problem

http://www.openoffice.org/issues/show_bug.cgi?id=97291

If you are able to set an appropriate size before assigning the URL, then you can avoid the problem.
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Mon Dec 15, 2008 4:08 pm    Post subject: Reply with quote

Perhaps I should have added, that if absolutely needed, you can do silly things such as:

1. Insert the image
2. Look at the desired size
3. Look at the containing cell
4. If the cell is not sufficiently wide, then remove the image from the document, insert the image again, and set the size before assigning the URL.
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
ernst_org
General User
General User


Joined: 04 Sep 2007
Posts: 38

PostPosted: Tue Dec 16, 2008 1:47 pm    Post subject: Good point Reply with quote

Yea that is a good point of view.
Bugg like this shall they bee reported somewhere?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group