[libreoffice-users] How to work with PyUNO documentation?

2015-08-08 Thread Hi-Angel
Hello, I'm having a problem with the docs. E.g. there's a method "gotoRange" that takes "XTextRange" type. So, I need to find a method in the class of opened document that returns that type. Well, easy: >>> type(file) And… there isn't documentation for the class "pyuno". That's just the

Re: [libreoffice-users] Re: How to work with PyUNO documentation?

2015-08-09 Thread Hi-Angel
Hm, that's interesting. However I couldn't figure out how to get properties of the object under the cursor. I'm feel there's a misunderstanding. E.g. for a test I placed cursor to a simple text, called MRI, and copied all the properties. Next I placed cursor to the "Table Of Contents", and did the

[libreoffice-users] UNO: iterate through headings?

2015-08-09 Thread Hi-Angel
In python I have an opened document, and I need to change styles of some «Heading 1»'s. (actually I need to do the thing like here http://ask.libreoffice.org/en/question/53521/how-to-exclude-some-chapters-from-automatic-numbering-of-headings/ , but in script) I couldn't figure out, what is a funct

Re: [libreoffice-users] Re: UNO: iterate through headings?

2015-08-09 Thread Hi-Angel
ver. 2015-08-09 23:34 GMT+03:00 Andreas Säger : > Am 09.08.2015 um 16:52 schrieb Hi-Angel: >> In python I have an opened document, and I need to change styles of >> some «Heading 1»'s. (actually I need to do the thing like here >> http://ask.libreoffice.org/en/question/535

Re: [libreoffice-users] Re: UNO: iterate through headings?

2015-08-09 Thread Hi-Angel
idea for how to iterate through headings. I do understand that the only thing I need is just change style of particular paragraphs, and here I'm stuck. 2015-08-10 3:07 GMT+03:00 Hi-Angel : > Thank you for suggestion. Unfortunately I didn't managed to understand > how to work with M

Re: [libreoffice-users] Re: UNO: iterate through headings?

2015-08-12 Thread Hi-Angel
GMT+03:00 Hi-Angel : > Okay, to point what is confuses me with MRI — I tried to copy > properties list when cursor is in the table of contents and somewhere > in text. The *diff* utility then shows no difference. > > But supposing that there is indeed no difference, I still coul

Re: [libreoffice-users] Re: UNO: iterate through headings?

2015-08-15 Thread Hi-Angel
rned to be the «Text.createEnumeration()». I guess it enumerates not only paragraphs, so one need to check that it actually is — in above the code I'm doing this with the «if ( par.supportsService("com.sun.star.text.Paragraph")» 2015-08-12 23:09 GMT+03:00 Hi-Angel : > I found

Re: [libreoffice-users] Re: How to work with PyUNO documentation?

2015-08-15 Thread Hi-Angel
GMT+03:00 Andreas Säger : > Am 09.08.2015 um 09:14 schrieb Hi-Angel: >> Hm, that's interesting. However I couldn't figure out how to get >> properties of the object under the cursor. I'm feel there's a > > Double-Click > > > > -- > To unsubscr

Re: [libreoffice-users] Re: UNO: iterate through headings?

2015-08-16 Thread Hi-Angel
Thank you, that is interesting! 2015-08-16 13:34 GMT+03:00 Andreas Säger : > I know next to nothing about Writer because I rarely use any word > processors and my mind can not sync Writer's API with what I see on the > screen. Let's try anyway: > > The enumeration of the document text seems to ref

[libreoffice-users] Save UNO state?

2015-08-16 Thread Hi-Angel
Often it is really hard to figure out for how to do something in UNO unless someone already did it, and left a description on the Internet. Even in the presence of MRI. So I'm wondering: perhaps is there a way to save UNO state? So that one could just save the state, change something they're inter

Re: [libreoffice-users] Save UNO state?

2015-08-16 Thread Hi-Angel
cName» just did changed? 2015-08-17 4:28 GMT+03:00 Andrew Douglas Pitonyak : > On 08/16/2015 03:53 PM, Hi-Angel wrote: >> >> Often it is really hard to figure out for how to do something in UNO >> unless someone already did it, and left a description on the Internet. >

Re: [libreoffice-users] Save UNO state?

2015-08-18 Thread Hi-Angel
Okay, I reported an enhancement request; let's if it could be done https://bugs.documentfoundation.org/show_bug.cgi?id=93516 2015-08-17 7:46 GMT+03:00 Hi-Angel : > Well, I think at some level that all comes to a simple objects. > > Anyway, how do you compare properties? E.g. I was r

Re: [libreoffice-users] Re: Save UNO state?

2015-08-20 Thread Hi-Angel
Yay, that's actually cool :з So, I modified the code a bit to make it Pythonish. It doesn't print all existing properties though, but I modified it to print also at least every paragraph property. It is: doc = desktop.loadComponentFromURL("file:///tmp/output.odt" ,"_blank", 0, ()) file = open('/tm

Re: [libreoffice-users] Re: Save UNO state?

2015-08-20 Thread Hi-Angel
>What is the purpose of comma separated machine data in a word processor >document? That is to save in file. The more newlines, the easier differ the text with vimdiff. Because if'd left these thousands symbols lines as is, it would be really hard to see what just changed. >Why don't you save th

Re: [libreoffice-users] Re: Save UNO state?

2015-08-22 Thread Hi-Angel
ument it produced 1gb of output. I think the problem is that most elements still appears in output many times — the check that in backtrace wasn't the current element is ensures only that it wouldn't fall in an infinite cycle. 2015-08-21 7:28 GMT+03:00 Hi-Angel : >>What is the pur

Re: [libreoffice-users] Re: Save UNO state?

2015-08-22 Thread Hi-Angel
ey not in d2", "\n" > else: > if type(d1[k]) is dict: > if path == "": > path = k > else: > path = path + "->" + k > findDiff(d1[k],d2[k]