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


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('/tmp/log', 'w')
for p in doc.PropertySetInfo.getProperties():
    file.write("•••••••••••\n" + str(p).replace(',','\n') + "\n")
enum = doc.Text.createEnumeration()
while enum.hasMoreElements():
    file.write("•••••••••••\n" +
str(enum.nextElement().PropertySetInfo.getProperties()).replace(',','\n')
+ "\n")
file.close()

I am also replace commas with newlines to make it easier to
differentiate (otherwise there're very long lines). It's 16150 lines
from a simple test document btw ☺

2015-08-20 13:35 GMT+03:00 Andreas Säger <villeroy@t-online.de>:
Quick and dirty Basic routine to copy properties from obj1 to obj2:

Sub cloneProperties(obj1, obj2)
dim a, i, s, v
a() = obj1.PropertySetInfo.getProperties()
on error goto resumeNextErr
for each i in a()
      s = i.Name
      v = obj1.getPropertyValue(s)
      obj2.setPropertyValue(s,v)
next
exit sub
resumeNextErr:
      resume next
End Sub




--
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

-- 
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.