Issue 51060 - Setting a TextTable name fails the second time.
Summary: Setting a TextTable name fails the second time.
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-21 18:41 UTC by andrew
Modified: 2013-02-24 21:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description andrew 2005-06-21 18:41:39 UTC
consider the following macro shown blow, which creates a text table with the
specified name. Run the macro and the TextTable is created with the requested
name. Now, using the GUI, delete the text table. Now, run the macro a second
time on the same document. The created name has an extra character appended to
the name.

Sub Main
  InsertTableAtCursor("woww")
End Sub


Sub InsertTableAtCursor(sName$)
  Dim oText, oTable
  Dim oCurs
  Dim sTabName$

  If (ThisComponent.getTextTables().hasByName(sName)) Then
    Print "The table named " & sName & " already exists"
    Exit Sub
  End If
  
  oText = ThisComponent.getText()
  oTable = ThisComponent.createInstance("com.sun.star.text.TextTable")
  oTable.initialize(3, 3)
  oTable.setName(sname)
  oCurs = ThisComponent.getCurrentController().getViewCursor()
  oText.insertTextContent(oCurs, oTable, False)
  oTable.setDataArray(Array(Array(1, 2, 3), Array(4, 5, 6), Array(7, 8, 9))
  MsgBox oTable.getName()
End Sub

You can verify that the name is not present using the following:

  MsgBox Join(ThisComponent.getTextTables().getElementNames(), CHR$(10))
Comment 1 stephan.wunderlich 2005-06-22 11:45:48 UTC
sw->tl: seems the writer has a better memory than it should have ;-)