Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


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 <andrew@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+unsubscribe@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+unsubscribe@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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.