Issue 59199 - replaceByName in com.sun.star.drawing.BitmapTable seems to be broken
Summary: replaceByName in com.sun.star.drawing.BitmapTable seems to be broken
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows 2000
: P3 Trivial
Target Milestone: ---
Assignee: jsc
QA Contact: issues@api
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2005-12-11 12:22 UTC by mneumann
Modified: 2013-02-24 21:07 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mneumann 2005-12-11 12:22:19 UTC
I have the following function that worked fine in OO 1.1.5, but not anymore in
OO 2.0:

Function LoadGraphicIntoDocument( oDoc As Object, cUrl As String, cInternalName
As String ) As String
   ' Get the BitmapTable from this drawing document.
   ' It is a service that maintains a list of bitmaps that are internal
   '  to the document.
   Dim oBitmaps as Object
   Dim cNewURL as String
   
   oBitmaps = oDoc.createInstance( "com.sun.star.drawing.BitmapTable" )
   
   If oBitmaps.hasByName (cInternalName) Then
         oBitmaps.replaceByName (cInternalName, cUrl)
   Else
         ' Add an external graphic to the BitmapTable of this document.
         oBitmaps.insertByName( cInternalName, cUrl )
   End If
   
   ' Now ask for it back.
   ' What we get back is an different Url that points to a graphic
   '  which is inside this document, and remains with the document.
   cNewUrl = oBitmaps.getByName( cInternalName )
   
   LoadGraphicIntoDocument = cNewUrl
End Function 

It throws a NoSuchElementException when asking back the name with the getbyname
function. And it seems to do that only once it was running the insertbyName
section. Obviously the InsertByName function does not work properly.

The replacebyName does not throw a runtime error, but it does not seem to do
anything either. I did not do thorough tests on that point, but the InsertByName
is definitely not functioning anymore.
Comment 1 mneumann 2005-12-11 14:14:30 UTC
I just tried again, and found out that there was just a mistake in the path
entry I gave, and the only difference in OO 2.0 seems to be the way this error
is handled. Otherwise, everything is running OK. Sorry for the mistake on my part.
Comment 2 lars 2005-12-11 15:17:28 UTC
resolved as reporter stated
Comment 3 lars 2005-12-11 15:17:53 UTC
closed