Issue 29235 - Incorrect code in the IDL Reference (in the SDK 1.1, too)
Summary: Incorrect code in the IDL Reference (in the SDK 1.1, too)
Status: CLOSED FIXED
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: christianjunker
QA Contact: issues@api
URL: http://api.openoffice.org/docs/common...
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2004-05-16 06:54 UTC by christianjunker
Modified: 2013-02-24 21:07 UTC (History)
3 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 christianjunker 2004-05-16 06:54:17 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
Comment 1 thackert 2004-11-21 18:39:41 UTC
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?
Comment 2 diane 2005-01-16 17:02:49 UTC
This should be changed to api project.
Comment 3 diane 2005-01-16 18:46:21 UTC
changing subcomponent to documentation.
Comment 4 haxwell 2005-02-10 22:12:50 UTC
Confirmed. If you look at the URL, as of today, it still reads the same text as
the reporter has described.
Comment 5 stx123 2005-05-10 12:54:56 UTC
Reassign issue to owner of selected subcomponent
Comment 6 christianjunker 2005-07-18 23:05:55 UTC
forwarding to new owner of api project.
Comment 7 jsc 2005-07-19 13:27:48 UTC
accepted
Comment 8 christianjunker 2005-08-02 13:03:27 UTC
assigning to myself. -> cws cyb1
Comment 9 christianjunker 2005-08-07 20:27:53 UTC
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.
Comment 10 christianjunker 2005-08-07 20:28:16 UTC
setting to started.
Comment 11 christianjunker 2005-08-19 15:55:41 UTC
taking it again, as discussed.
Comment 12 christianjunker 2005-08-19 16:30:23 UTC
fixed.
Comment 13 jsc 2005-12-01 13:22:14 UTC
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
Comment 14 jsc 2005-12-02 12:10:16 UTC
new target
Comment 15 ace_dent 2008-05-16 03:33:36 UTC
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 ~