[Libreoffice] Properties not accessible

Michael Stahl mstahl at redhat.com
Wed Oct 19 09:32:26 PDT 2011


hi Knut,

On 13/10/11 12:09, Knut Olav Bøhmer wrote:
> Hi,
>
> Why is it that some properties on some objects/services are not settable
> from BASIC?
> Like for example
> "ThisComponent.getTextSections().getByName("sectionName").IsAutomaticUpdate
> = True" has no effect
> Is it some way to "fix" it?

it looks like this property only has an effect with DDE links, not file 
links: see lcl_UpdateLinkType in sw/source/core/unocore/unosect.cxx

are you using DDE? IIRC this works only on Windows?

> I'm also trying to set
> oDoc.getTextSections().getByName("sectionName").FileLink.FileURL, but
> it's also not possible.
>
> Am i doing it the wrong way?

seems the FileLink is some UNO struct.

the following seems to work:

dim l as new com.sun.star.text.SectionFileLink
l.FileURL = "file:///tmp/foo.odt"
ThisComponent.getTextSections().getByName("Section1").setPropertyValue("FileLink",l)


this then seems to remove the link again:

l.FileURL = ""
ThisComponent.getTextSections().getByName("Section1").setPropertyValue("FileLink",l)


> I remember I've had this problem before, long time ago. I think I was
> trying to set some properties on a hyperlink.
> Can we take some action to fix this kind of issues?

well, basic has a horrible syntax that i find impossible to remember.
perhaps you have the same problem :)

> Would it help to write my addons in C++? Or would that not make a
> difference?

hmm... C++ also has a horrible syntax... choose your poison :)

regards,
  michael



More information about the LibreOffice mailing list