To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=85205





------- Additional comments from [EMAIL PROTECTED] Sun Jan 13 23:24:49 +0000 
2008 -------
... the following macro tries to update all oShape.Bookmark strings to point to 
hard coded Page Numbers instead of Named Objects. Running this before exporting 
to PPT will keep the presentation from breaking in PPTViewer 2003.


REM  *****  BASIC  *****

Sub UpdateBookmarks

        Dim oDPages
        Dim oPage
        Dim oShape
        Dim i%
        Dim j%
        Dim k%
        Dim s$

        Dim tableSize%
        tableSize = 100
        Dim objectNames(tableSize + 1) as String
        Dim objectPages(tableSize + 1) as Integer
        Dim objectCount%
        objectCount = 0

        Dim bookmark$
        Dim found As Boolean
        Dim trace As Boolean
        trace = False
        
        oDPages = ThisComponent.getDrawPages()


REM build a table or all Named Objects and their Page Numbers
        For i = 1 To oDPages.getCount()
                oPage = oDPages.getByIndex(i-1)

                For j = 1 To oPage.getCount()
                        oShape = oPage.getByIndex(j-1)

                        If (oShape.getName <> "") Then
                                
                                If (trace) Then
                                        s = "Named Shape '" & oShape.getName 
& "' Found on Page " & i
                                        Print s
                                End If
                                
                                objectCount = objectCount + 1
                                
                                REM resize table arrays if needed
                                If (objectCount >= tableSize) Then
                                        tableSize = tableSize + 100
                                        ReDim Preserve objectNames(tableSize) 
as String
                                        ReDim Preserve objectPages(tableSize) 
as Integer
                                End If
                                
                                objectNames(objectCount) = oShape.getName
                                objectPages(objectCount) = i
                                
                        End If
                Next
        Next

REM find Shapes with "Goto Page or Object" Interactions and
REM update oShape.Bookmark to point to Page Number of the Named Object
        For i = 1 To oDPages.getCount()
                oPage = oDPages.getByIndex(i-1)

                For j = 1 To oPage.getCount()
                        oShape = oPage.getByIndex(j-1)

                        If (oShape.OnClick = 
com.sun.star.presentation.ClickAction.BOOKMARK) _
                                AND (Left(oShape.Bookmark, 4) <> "page") Then
                                
                                If (trace) Then                         
                                        s = "Page " & i & " : Shape " & j 
                                        s = s & " (" & oShape.getName & ")"
                                        s = s & " : OnClick --> " & 
oShape.Bookmark
                                        Print s
                                End If
                                
                                REM scan through the pre-built tables 
                                bookmark = oShape.Bookmark
                                found = False
                                For k = 1 To objectCount
                                        If (objectNames(k) = bookmark) Then
                
                                                If (trace) Then
                                                        s = "Page " & i & " : 
Shape " & j 
                                                        s = s & " (" & 
oShape.getName & ")"
                                                        s = s & " : Updating 
" & oShape.Bookmark 
                                                        s = s & " --> page" & 
objectPages(k)
                                                        Print s
                                                End If

                                                found = True
                                                oShape.Bookmark = "page" & 
objectPages(k)
                                        End If
                                Next
                                
                                REM trap unknown targets (should not happen)
                                If (found = False) Then
                                        s = "ERROR!!"
                                        s = "Page " & i & " : Shape " & j 
                                        s = s & " (" & oShape.getName & ")"
                                        s = s & " : OnClick --> " & 
oShape.Bookmark
                                        s = s & "BUT NO SUCH NAMED SHAPE 
EXISTS!!"
                                        s = s & "... Continuing Anyhow... Click 
OK."
                                        Print s
                                End If
                                
                        End If
                Next
        Next
                
End Sub         
                                

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to