To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=56574
                  Issue #:|56574
                  Summary:|Numbered sequence not properly imported
                Component:|Word processor
                  Version:|OOo 2.0
                 Platform:|All
                      URL:|
               OS/Version:|All
                   Status:|NEW
        Status whiteboard:|
                 Keywords:|
               Resolution:|
               Issue type:|DEFECT
                 Priority:|P3
             Subcomponent:|open-import
              Assigned to:|mru
              Reported by:|pitonyak





------- Additional comments from [EMAIL PROTECTED] Mon Oct 24 13:47:07 -0700 
2005 -------
I was given a document specifically because OOo is not able to properly import
it. It turns out that the document contains a sequence variable named "(". This
sequence variable does not appear to properly import. I will import a small
document that demonstrates the problem.

I was able to mostly fix this document using the macro shown below... Some of
the references are not correct when this is fnished, and some are just fine.

Sub FixTextFields
  Dim oEnum
  Dim oField
  Dim oNewField
  Dim oMasters
  Dim oDFields()
  Dim sName
  Dim x
  Dim i%
  Dim s$
  Dim sExprName
  Dim sParenName
  Dim sNewName
  Dim oText
  Dim oAnchor

  Dim oParenMField
  Dim oNewMField

  sExprName  = "com.sun.star.text.FieldMaster.SetExpression"
  sParenName = sExprName & ".("
  sName = "Paren"
  sNewName   = sExprName & "." & sName
  oMasters = ThisComponent.getTextFieldMasters()
  If NOT oMasters.hasByName(sParenName) Then
    Print "This document does not contain the '(' SetExpression master field"
    Exit Sub
  End If
  oParenMField = oMasters.getByName(sParenName)

  If oMasters.hasByName(sNewName) Then
    oNewMField = oMasters.getByName(sNewName)
    'Print "Got Existing item"
  Else
    oNewMField = ThisComponent.createInstance(sExprName)
    oNewMField.ChapterNumberingLevel = oParenMField.ChapterNumberingLevel
    oNewMField.Name = sName
    oNewMField.NumberingSeparator = oParenMField.NumberingSeparator
    oNewMField.SubType = oParenMField.SubType
  End If
  oDFields() = oParenMField.DependentTextFields
  For i = LBound(oDFields()) To UBound(oDFields())
    oField = oDFields(i)
    oNewField =
ThisComponent.createInstance("com.sun.star.text.TextField.SetExpression")
    oNewField.Content = sName & "+1"
    'oNewField.AnchorType = oField.AnchorType
    oNewField.Hint = oField.Hint
    oNewField.Input = oField.Input
    oNewField.IsFixedLanguage = oField.IsFixedLanguage
    oNewField.IsShowFormula = oField.IsShowFormula
    oNewField.IsVisible = oField.IsVisible
    oNewField.NumberFormat = oField.NumberFormat
    oNewField.NumberingType = oField.NumberingType
    oNewField.SequenceValue = oField.SequenceValue
    oNewField.SubType = oField.SubType
    oNewField.attachTextFieldMaster(oNewMField)
    oAnchor = oField.getAnchor()
    oText = oAnchor.getText()
    oText.insertTextContent(oAnchor, oNewField, False)
    oField.dispose()
  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