Hello,
I'm trying to insert different types of Indexes available in LibreOffice through the API but only the TOC (through css::text::ContentIndex service) has been successfully done. For the others, like DocumentIndex (alphabetical index), Bibliography, etc. I'm not able to figure out how to enable them to create an index using outlines (Heading styles like for TOC).
Second of all, there is a property called SortAlgorithm which holds a string describing the sorting algorithm in these indexes. Where can I find a list of the available parameters for this property? Can not find it anywhere in the API reference!
Using Bibliography (Index)
Using Bibliography (Index)
OpenOffice 3.1 on Windows Vista
(Libreoffice 4.0.0 on Windows 7)
(Libreoffice 4.0.0 on Windows 7)
Re: Using Bibliography (Index)
There is not difference to insert these contents index from inserting the TOC. The services of them inherits css.text.BaseIndex service, so you can find the list of services inherits it: http://www.openoffice.org/api/docs/comm ... -xref.html
Instantiate one of them through service manager of the document and insert the instance to your document with css.text.XText interface.
Instantiate one of them through service manager of the document and insert the instance to your document with css.text.XText interface.
The office uses collators defined in css.i18n module for each language to sort elements and they knows algorithms that they provide.SNM90 wrote:Second of all, there is a property called SortAlgorithm which holds a string describing the sorting algorithm in these indexes. Where can I find a list of the available parameters for this property? Can not find it anywhere in the API reference!
Code: Select all
Sub GetCollatorAlgorithms
aLocale = CreateUnoStruct("com.sun.star.lang.Locale")
aLocale.Language = "en"
aLocale.Country = "US"
collator = CreateUnoService("com.sun.star.i18n.Collator")
names = collator.listCollatorAlgorithms(aLocale)
s = "Algorithms: " & chr(10)
for i = 0 To ubound(names) step 1
s = s & names(i) & chr(10)
next
msgbox s
End Sub
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04
Re: Using Bibliography (Index)
Thank you for your reply...
The thing is, I have already tried what you said. It still doesn't work with the assigning headings (tried a lot of them). I think the problem is that a method similar to 'createFromOutlines()' of css:text::ContentIndex is missing from the rest of the services like css::text::DocumentIndex or css::text::Bibliography or others which inherit from service BaseIndex. So, the headings don't come through that way.
I will try your solution for my second problem.
EDIT: I tried your solution to my second problem, and it worked. Thanks for that! Can you please look into the first one again though?
The thing is, I have already tried what you said. It still doesn't work with the assigning headings (tried a lot of them). I think the problem is that a method similar to 'createFromOutlines()' of css:text::ContentIndex is missing from the rest of the services like css::text::DocumentIndex or css::text::Bibliography or others which inherit from service BaseIndex. So, the headings don't come through that way.
I will try your solution for my second problem.
EDIT: I tried your solution to my second problem, and it worked. Thanks for that! Can you please look into the first one again though?
OpenOffice 3.1 on Windows Vista
(Libreoffice 4.0.0 on Windows 7)
(Libreoffice 4.0.0 on Windows 7)
Re: Using Bibliography (Index)
Wonder that function is provided by these indexes? Can you use such function through the UI?It still doesn't work with the assigning headings
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04
Re: Using Bibliography (Index)
Hmm... I guess you can't. I reckon one can only build these indexes through entries. The problem is that the index marks are not given the capability to hyperlink to their position in text by the API. Anyway, I'll see what I can do.
Also, is there any way to insert text INSIDE the index mark? If so, how? I see that through the UI it is possible.
Also, is there any way to insert text INSIDE the index mark? If so, how? I see that through the UI it is possible.
OpenOffice 3.1 on Windows Vista
(Libreoffice 4.0.0 on Windows 7)
(Libreoffice 4.0.0 on Windows 7)