To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=86024
                 Issue #|86024
                 Summary|Updating TOC results in incorrect page numbers in newl
                        |y loaded document
               Component|Word processor
                 Version|OOo 2.3.1
                Platform|PC
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|formatting
             Assigned to|mru
             Reported by|ratbert





------- Additional comments from [EMAIL PROTECTED] Mon Feb 11 15:27:55 +0000 
2008 -------
I have a document with around 90 OLE OOo draw objects and around 200 pages.
Within the document, one heading_2 with a single line text_body para is in a
locked section. With the document closed I add about 100 pages of auto generated
code documentation, into the locked section by stuffing ODF elements into the
content.xml of the document (Perl script), making about 300 pages in total.

I uses the Basic macro pasted below, to update the TOC and save again, and
export to PDF. The TOC contains incorrect page numbers and the PDF contains
pages that are unexpectedly blank, though they do have headers and footers.

This appears to be releated to the OLE objects and the asynchronous
reflow/repagination of the document after loading which is still in progress
during the TOC update and the PDF export.

I can't send you the actual doc I'm having a problem with, but have created an
exmaple doc with the same issue, which I will attach when I figure out how ;-)
This will contain the "stuffed" document, without the macro having been run. If
you run the macro, hopefully you should find erroneous page number in the TOC
and a PDF with some blank pages in.

Here is the macro which I run from the command line with: soffice.exe -invisible
'macro:///Standard.Export2PDF.SaveAsPDF(u:\example1.odt)'

Thanks,
Ratbert
-----------------------------

Sub SaveAsPDF( cFile )
   cURL = ConvertToURL( cFile )
   ' Open the document. Just blindly assume that the document 
   ' is of a type that OOo will correctly recognize and open 
   ' without specifying an import filter.
   oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, Array(_
            MakePropertyValue( "Hidden", True ),_
            MakePropertyValue("ReadOnly",False),_
           
MakePropertyValue("UpdateDocMode",com.sun.star.document.UpdateDocMode.QUIET_UPDATE
),))

   ' appears to do nothing releted to issue
   oDoc.refresh()

   ' update all indexes
   oIndexes = oDoc.getDocumentIndexes()
   for i = 0 to oIndexes.getCount () - 1
      oIndexes (i).update
   next i
   
   ' save updated file
   oDoc.storeToURL( cURL, Array () )

   ' calculate the PDF file name
   cFile = Left( cFile, Len( cFile ) - 4 ) + ".pdf"
   cURL = ConvertToURL( cFile )
   
   ' Save the document using a filter.   
   oDoc.storeToURL( cURL, Array(_
            MakePropertyValue( "FilterName", "writer_pdf_Export" ),)
   
   oDoc.close( True )
End Sub

Function MakePropertyValue( Optional cName As String, Optional uValue ) _
   As com.sun.star.beans.PropertyValue
   Dim oPropertyValue As New com.sun.star.beans.PropertyValue
   If Not IsMissing( cName ) Then
      oPropertyValue.Name = cName
   EndIf
   If Not IsMissing( uValue ) Then
      oPropertyValue.Value = uValue
   EndIf
   MakePropertyValue() = oPropertyValue
End Function
----------------------

BTW I left the issue as P3, but it is probably more important than that to my
project :-) Please reset priority as you see fit.

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