On 21/10/2019 12:53, Stephan Bergmann wrote:
On 18/10/2019 20:16, Johnny Rosenberg wrote:
*Private Function ItemFound(sItem As string, _   oRange As
com.sun.star.sheet.XSheetCellRange) As Boolean Dim oDescriptor As
com.sun.star.util.XReplaceDescriptor
oDescriptor=oRange.createSearchDescriptor()*
*⁝*
*⁝*
*End Function*

So the answer to my question seems to be
”com.sun.star.util.XReplaceDescriptor”. Exactly why is a little blurry to
me at the moment.

css.util.XReplaceDescriptor is derived from css.util.XSearchDescriptor. I assume that what dim'ing you need should depend on what you do with oDescriptor in the part you elided:  If you only call XSearchDescriptor-methods on it, then dim as XSearchDescriptor should suffice.  If you call any of the XReplaceDescriptor-only methods (getting/setting the ReplaceString), then you need to dim as XReplaceDescriptor.

Turns out I assumed wrongly there about how LO Basic behaves. In the true spirit of dynamically typed languages, you can apparently call any method actually supported by the object, regardless of the "dim as" type of the variable that holds the object. (Only when assigning the object to the variable are types checked to match---and were checked in an inferior way, see my other mail announcing a fix.)


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Reply via email to