On Fri, 2008-04-04 at 11:01 +0300, ashok _ wrote: > On Thu, Apr 3, 2008 at 9:54 PM, Caolan McNamara wrote: > > Am I right in that it is not possible to simply generically query any > > given xModel's getCurrentSelection() result to answer the question "is > > something selected". > > > > C. > > No, you can ... > > - queryInterface the selection object for selection ranges > (com.sun.star.text.TextRanges) > - get the first selected range > - get a cursor over the range > - if the cursor is collapsed (cursor.isCollapsed() ) it means no text > was selected, otherwise it means text was select
Hmm, I suspect that wouldn't give a correct answer to "is something selected?" in the case of a spreadsheet or drawing XModel instead of a text document, nor in the case of a text document if e.g. only a graphic is selected. C. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
