Re: [libreoffice-users] Save UNO state?

2015-08-19 Thread Andrew Douglas Pitonyak
Yes, you can certainly compare properties, but it would be a bit arduous 
to write with a bunch of special cases. Part of the problem is 
understanding which properties can be ignored, and which cannot and 
understanding how to write them. I wrote some code (not sure where it 
is) that copies a style. This is done one property at a time. I don't 
remember if I made it recursive or not. I probably did not, and, for 
this case, you would probably need to do that.


You would need to inspect the objects when possible and make comparison 
decisions based on that. It would also require error handling and 
special case code (probably). You would need to recognize when you had 
properties that you should not try to trace into if it is recursive in 
nature, which strikes me as the most difficult part.


On 08/17/2015 12:46 AM, Hi-Angel wrote:

Well, I think at some level that all comes to a simple objects.

Anyway, how do you compare properties? E.g. I was recently needed to
change with UNO the first page style of Writer document. In the end it
turned out to be the property «PageDescName» (a string) of the first
paragraph, and that's just impossible to infer deductively (why
paragraph? I could imagine it would be e.g. TextCursor, but a
paragraph could easily span for multiple pages).

So, could you compare properties for a Writer document before and
after the first page style was manually changed, and find that the
«PageDescName» just did changed?

2015-08-17 4:28 GMT+03:00 Andrew Douglas Pitonyak and...@pitonyak.org:

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.
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 interested in,
next again save the state. And the only thing that's left to do, is
just to peek at the difference between two files with a diff utility
to figure out the properties that were just changed.

Is your interest is in a specific object. For example, what properties
changed on the first table.

I can easily compare properties for an object, but, that only deals with
simple types such as strings and numbers. So, I can inspect an object and
display the values of all the simple types with the attribute names and
values. I can then save this in a text file, make a change to the object,
then check the values again.

First problem is that I am only looking at simple types. Sure, I could
change my inspection code to attempt to expand attributes that are other UNO
services, but, I would need to watch for referential loops (like if a table
refers to the owning document that would then refer to that table).


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems?
http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be
deleted


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


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 hiangel...@gmail.com:
 Well, I think at some level that all comes to a simple objects.

 Anyway, how do you compare properties? E.g. I was recently needed to
 change with UNO the first page style of Writer document. In the end it
 turned out to be the property «PageDescName» (a string) of the first
 paragraph, and that's just impossible to infer deductively (why
 paragraph? I could imagine it would be e.g. TextCursor, but a
 paragraph could easily span for multiple pages).

 So, could you compare properties for a Writer document before and
 after the first page style was manually changed, and find that the
 «PageDescName» just did changed?

 2015-08-17 4:28 GMT+03:00 Andrew Douglas Pitonyak and...@pitonyak.org:
 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.
 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 interested in,
 next again save the state. And the only thing that's left to do, is
 just to peek at the difference between two files with a diff utility
 to figure out the properties that were just changed.

 Is your interest is in a specific object. For example, what properties
 changed on the first table.

 I can easily compare properties for an object, but, that only deals with
 simple types such as strings and numbers. So, I can inspect an object and
 display the values of all the simple types with the attribute names and
 values. I can then save this in a text file, make a change to the object,
 then check the values again.

 First problem is that I am only looking at simple types. Sure, I could
 change my inspection code to attempt to expand attributes that are other UNO
 services, but, I would need to watch for referential loops (like if a table
 refers to the owning document that would then refer to that table).


 --
 Andrew Pitonyak
 My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
 Info:  http://www.pitonyak.org/oo.php


 --
 To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
 Problems?
 http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
 Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
 List archive: http://listarchives.libreoffice.org/global/users/
 All messages sent to this list will be publicly archived and cannot be
 deleted

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] Save UNO state?

2015-08-16 Thread 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 recently needed to
change with UNO the first page style of Writer document. In the end it
turned out to be the property «PageDescName» (a string) of the first
paragraph, and that's just impossible to infer deductively (why
paragraph? I could imagine it would be e.g. TextCursor, but a
paragraph could easily span for multiple pages).

So, could you compare properties for a Writer document before and
after the first page style was manually changed, and find that the
«PageDescName» just did changed?

2015-08-17 4:28 GMT+03:00 Andrew Douglas Pitonyak and...@pitonyak.org:
 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.
 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 interested in,
 next again save the state. And the only thing that's left to do, is
 just to peek at the difference between two files with a diff utility
 to figure out the properties that were just changed.

 Is your interest is in a specific object. For example, what properties
 changed on the first table.

 I can easily compare properties for an object, but, that only deals with
 simple types such as strings and numbers. So, I can inspect an object and
 display the values of all the simple types with the attribute names and
 values. I can then save this in a text file, make a change to the object,
 then check the values again.

 First problem is that I am only looking at simple types. Sure, I could
 change my inspection code to attempt to expand attributes that are other UNO
 services, but, I would need to watch for referential loops (like if a table
 refers to the owning document that would then refer to that table).


 --
 Andrew Pitonyak
 My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
 Info:  http://www.pitonyak.org/oo.php


 --
 To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
 Problems?
 http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
 Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
 List archive: http://listarchives.libreoffice.org/global/users/
 All messages sent to this list will be publicly archived and cannot be
 deleted

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted