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

            Bug ID: 103934
           Summary: bookmarks macro error
           Product: LibreOffice
           Version: 5.2.3.3 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

Description:
I'm using a bookmarks function in my macro on odt writer documents. However, if
I open an ods spreadsheet then I get an error. Even if bookmarks are
unavailable in spreadsheets, how can I avoid the error? Shouldn't "On Error
Resume Next" have skipped the error in the code below?

function BookmarkValues as string
        On Error Resume Next
        Doc = ThisComponent
        PageStyles = Doc.StyleFamilies.getByName("PageStyles")
        StdPage = PageStyles("Default")
        DocText = Doc.getText()

        Bookmarks = Doc.getBookmarks()
        BMnames = Bookmarks.getElementNames()
        Result = ""
        For BMn = 0 To UBound(BMnames) step 1
        BookMark = Bookmarks.getByName(BMnames(BMn))
                BookMarkText = BookMark.getAnchor().getText()
                newName = "_" & getRightOfPrefix(BookMark.getName, "t_", True)
                If newName = "_" Then newName = "_" &
getRightOfPrefix(BookMark.getName, "tD_", True)
                If newName = "_" Then newName = BookMark.getName
                Result = Result & newName & "="
                If BookMark.getAnchor().getString = "<" & BookMark.getName &
">" Then
                        Result = Result & "null&"
                Else
                        Result = Result & BookMark.getAnchor().getString & "&"
                End If
        Next BMn
        BookmarkValues = Result
End Function


Actual Results:  
I get the following error on the "Next BMn" line in my macro above:

unknown.
Internal error $(ARG1).


Expected Results:
The function should just return without errors because of "resume next".


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to