Ian Laurenson wrote: > oSearchDescriptor = thisComponent.createSearchDescriptor > oSearchDescriptor.setSearchString("the") > oFirstSelection = _ > thisComponent.getcurrentController.getSelection.getByIndex(0) > oFound = thisComponent.findNext(oFirstSelection, oSearchDescriptor) > > As FindNext is only a method of the Writer component and not of a text > range, if the search string is not in the selection the code continues > searching until either the end of the document or the string is found, > where upon you need to check if it is inside the range with something > like: > > bFound = (thisComponent.getText.compareRegionEnds(oFound, _ > oFirstSelection.getEnd) > -1) > > But this is an over simplification as the text ranges may not belong to > the same text range (e.g. in Table), and the end of a text range is > determined by the direction of the selection. > > For a more complete and working example see: IannzFindReplace.sxw > available from: http://homepages.paradise.net.nz/hillview/OOo/
Thanks, I will have a look. I'm always interested in spotting weaknesses of our API. If they turn out to be either *very* annoying or if they concern often used functions we will think about additional solutions. >> > * Having an enumeration for PageLayout that doesn't include an option >> > for "none" when you simply aren't concerned about duplex printing. >> >> Sorry, I don't understand this. Can you show it with a few code lines? >> > I was referring to: > http://www.openoffice.org/issues/show_bug.cgi?id=3910 Thanks, I will also study this. >> > A much higher priority for me is having more in the API such as the >> > ability to easily have docked/floating windows in extensions. >> >> This is a feature we have considered for the next release. The biggest >> obstacle is that we lack a proper GUI toolkit, but at least we should be >> able to offer all controls you can use in a basic dialog also for >> docking/floating windows. >> >> As an example, we could use the xml description of a Basic dialog and >> declare it as a floater or a docking window. >> > Docked/floating windows is quite an important issue for me. > Is there anyway that I can create a component with this functionality > now? No, this is not possible with "components", means: objects created outside the main code base like an Add-On or so. Currently you need to create objects based on classes from our SFX library and you need to adapt the code of an application to use that object. This is usually nothing you want to do as an external developer because even if you took the entrance hurdle you would need to maintain the code in case of future changes of our code base. > Should I look into helping to change the source code for this issue > (this would be my first attempt at writing OOo source code - so I may > need some help)? The necessary code changes are not trivial: we must implement a new splitting window class in VCL, new docking handlers in the Framework Layout Manager and a new base class that implements the basic handling (the current base class in in SFX2). We also must adapt the code of all current dockable windows to use the new base class. To make this new implementation usable for external components we must provide new APIs and registration means and define and implement how you can specify the content of your window, e.g. by utilizing the Basic dialog XML files. The easiest way to help us would be to join the discussion about the new APIs and the XML resource stuff and later on help with creating prototypes and test cases. Of course brave developers can also join us in the development phase when we dig up the VCL, SFX2 and framework modules. If you want to join us in one of these steps I can notify you when we start the specification phase, further discussions then will appear on the dev@framework.openoffice.org mailing list. My gut feeling is that this will be one of the first things we will attack after the OOo2.0 release, so possibly we will start in the late summer this year. > Should I just be patient and wait? Of course that's always an option. :-) Ciao, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]