Hello Rory, On Sun, May 11, 2025 at 09:06:56AM +0100, Rory O'Farrell wrote:
> On Sun, 11 May 2025 09:46:20 +0200 > Arrigo Marchiori <ard...@apache.org> wrote: > > > Hello Rory, > > > > On Fri, May 09, 2025 at 01:46:33PM +0100, Rory O'Farrell wrote: > > > > > In Navigator, when Comments (Annotations) are listed, are they > > > retrieved in order from the file in use, or are they sorted by the > > > Navigator code before display? > > > > > > A macro using an enumeration to retrieve Comments returns them in > > > complicated order; from my experience the first Comment, then the > > > most recent, then mostly in reverse order (i.e., from end of file). > > > > From a quick look at the code, the navigator should use "indexed > > containers", that enforce element ordering. > > > > Could you please share the part of the macro that retrieves the > > comments? > > > > Best regards, > > -- > > Arrigo > > > Below is code for a macro to report content of annotations in a > Writer file. Make a small text file, and insert comments randomly > at any points within the file, not merely sequentially beginning to > end. You will observe that the enumeration process does not report > the comments sequentially. > > Sub ReportAnnotes [...] Thank you for this very good example. It's true: the elements are not returned in the expected order. I spent some time looking at the code but unfortunately I could not find the code where the tree is built. A possible workaround could be treating the oField's as instances of com.sun.star.text.XTextContent, and then using their getAnchor() method to obtaining the sort key. I am sorry I cannot be any more specific than this. Best regards, -- Arrigo --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org For additional commands, e-mail: dev-h...@openoffice.apache.org