Apache OpenOffice (AOO) Bugzilla – Issue 29235
Incorrect code in the IDL Reference (in the SDK 1.1, too)
Last modified: 2013-02-24 21:07:12 UTC
The posted URL contains an example for searching for a string in a Text Document programmatically (Basic/Java). The example states: xSearchDescr = xDocument.createSearchDescriptor() xSearchDescr.SearchString = "to look for" xSearchDescr.SearchCaseSensitive = true xSearchDescr.SearchWholeWords = true xFound = xDocument.findFirst( xSearchDescr ) do while xFound xFound.CharWeight = CharWeight_BOLD xFound = xDocument.findNext( xFound.End, xSearchDescr ) loop First of all there is no Command xSearchDescr.SearchWholeWords, this is probably just misspelled, the correct method is: "SearchWords" not "SearchWholeWords". Secondly this code produces an error when executed in OOo Basic IDE, simply because xFound is not of type boolean, and thus leads to "incorrect PropertyValue" or "Object variable not set". The corrected code must be: xSearchDescr = xDocument.createSearchDescriptor() xSearchDescr.SearchString = "to look for" xSearchDescr.SearchCaseSensitive = true xSearchDescr.SearchWords = true xFound = xDocument.findFirst( xSearchDescr ) do while Not IsNull(xFound) xFound.CharWeight = CharWeight_BOLD xFound = xDocument.findNext( xFound.End, xSearchDescr ) loop Best regards Christian Junker
Hi Christian, could it be that the above mentioned guide was too old? Have you read the DeveloperGuide and does this code occur there also? And have you tried this in a newer version of OOo? And I have seen, that your entry was in May. Could you close this issue then, please?
This should be changed to api project.
changing subcomponent to documentation.
Confirmed. If you look at the URL, as of today, it still reads the same text as the reporter has described.
Reassign issue to owner of selected subcomponent
forwarding to new owner of api project.
accepted
assigning to myself. -> cws cyb1
It turned out when examining the idl file more and more that the second example is also broken, both in syntax and because of using functions that are not part of the preinstalled macros of the office. Assigning to jsc, as discussed in email.
setting to started.
taking it again, as discussed.
fixed.
jsc: i have checked the docu changes on cws cyb1 I have adapted the target to OOo3.0 to bring this minor docu fix in the next release. It would be nice to have it in OOo2.0.2 but the guideliness for product updates doesn't allow this kind of fixes
new target
This Issue is 'Verified' and not updated in 1yr+, so Closing. A Closed Issue is a Happy Issue (TM). Regards, Andrew Cleaning-up and Closing old Issues as part of: ~ The Grand Bug Squash, pre v3 ~