[Libreoffice-bugs] [Bug 119609] Macro for Writer: Cannot read property of ParaBackGraphicURL

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Aug 30 17:13:15 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=119609

--- Comment #4 from Kamil Landa <kamlan at post.cz> ---
Macro with example for some working properties:


Sub mistake2 'example with some working properties
        dim oVCur, a
        oVCur=thisComponent.currentcontroller.getViewCursor() 'view cursor

        a=oVCur.getPropertyValue("CharFontFamily") 'it works
        a=oVCur.getPropertyValue("CharColor") 'it works
        a=oVCur.getPropertyValue("CharWeight") 'it works
        a=oVCur.getPropertyValue("ParaVertAlignment") 'it works
        a=oVCur.getPropertyValue("ReferenceMark") 'it works
        a=oVCur.getPropertyValue("ParaTopMargin") 'it works
        a=oVCur.getPropertyValue("TextParagraph") 'it works

        a=oVCur.getPropertyValue("ParaBackGraphicURL") 'for other proprerties
it is OK
End Sub




And testing macro for Writer: 

For "Standard" page styles is also affected FooterBackGraphicURL, for others
BackGraphicURL. 


OPTION EXPLICIT

Sub TesPageStylePropsForWriter() 'test for Writer

        On Local Error Goto ErrorHandler
        Dim oDoc as Object, osheet as Object, oPStyles as Object, oPStyle as
Object, aProps as Object, vTmp, sProp as String, i as Integer, j as Integer,
elems

        oDoc = ThisComponent
        oPStyles = oDoc.StyleFamilies.getByName("PageStyles")
        elems=oPStyles.ElementNames()
        For j=lbound(elems) to ubound(elems)
                oPStyle = oPStyles.getByName(elems(j))

                aProps = oPStyle.PropertySetInfo.Properties
                For i = LBound(aProps) to UBound(aProps)
                        sProp = aProps(i).Name
                        vTmp = oPStyle.getPropertyValue(sProp)
                Next i
        Next j
Exit Sub
ErrorHandler:
        MsgBox elems(j) & ":" & chr(10) & sProp
        Resume Next
End Sub

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180830/d1387c31/attachment.html>


More information about the Libreoffice-bugs mailing list