Patrick,
you need here a Tablecursor or use viewcursor.cell.string
' Get The view cursor
oViewCursor = thisComponent.getCurrentController().getViewCursor()
' Get Table and the Cell where the View cursor is
oTable = oViewCursor.TextTable
oCurrentCell = oViewCursor.Cell
' create a table cursor in the cell where the view cursor is
sFirstColCell = "A" + Mid(oCurCell.CellName, 2)
oTableCursor = oTable.createCursorByCellName(sFirstColCell)
' create a simple text cursor with the contents of the current cell
oText = oCurCell.Text
oCursor = oText.createTextCursor()
Greetz
fernand
OOo (version 3.2.1 on Ubuntu 9.10 64 bit) behaves in a strange way. Here are a
few examples.
1) The String property of the view cursor doesn't seem to work when text is
selected in a table cell.
The following macro displays the selected text. When the selected text is
inside a table cell, nothing is displayed.
Option Explicit
Sub Main
dim viewCursor : viewCursor = ThisComponent.CurrentController.ViewCursor
MsgBox viewCursor.string
End Sub
2) The GotoNextWord function has a strange behavior: when there is no next
word in the current paragraph, it moves the cursor to the next paragraph,
even if the paragraph is empty and is followed by a non empty paragraph.
Furthermore, when the current paragraph is followed by a table instead of an
empty paragraph, the function skips the table completely.
Option Explicit
Sub Main
dim viewCursor : viewCursor = ThisComponent.CurrentController.ViewCursor
dim textCursor : textCursor = _
viewCursor.Text.CreateTextCursorByRange(viewCursor.Start)
textCursor.GotoNextWord(False)
ThisComponent.CurrentController.Select(textCursor)
End Sub
3) The GotoEndOfWord function doesn't work when the word ends with a @.
Option Explicit
Sub Main
dim viewCursor : viewCursor = ThisComponent.CurrentController.ViewCursor
dim textCursor : textCursor = _
viewCursor.Text.CreateTextCursorByRange(viewCursor.Start)
textCursor.GotoEndOfWord(True)
MsgBox textCursor.String
end sub
On the contrary, the function GotoStartOfWord works as expected when the view
cursor is after the @.
4) The GotoEndOfWord function works when the view cursor is at the beginning a
field, while the GotoStartOfWord function doesn't work when the view cursor
is at the end of the field (same macro as above).
Could someone please tell me whether or not this behavior is normal?
Regards,
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org