Bernard Marcelly wrote:
Message de Dietmar Hiller date 2008-01-03 19:46 :
I am trying to change the border of a texttable, the cursor is in.
In OOo Basic it worked like this:
What you are trying is not easy, because it depends on what is selected.
In the simplest case, nothing is selected, the cursor is inside a cell
of a text table.
But you have other cases :
- one or more text ranges selected in a cell
- one or more text ranges selected in several cells
- several contiguous cells selected
Each case is a specific selection case.
This is not exhaustive. The user could simultaneously select a range
inside a cell of your text table and another range in another text table
and another range in the main text!
For the simplest case, you get some info with this Basic code:
dim oView As Object, oVCursor As Object
Dim oTable As Object, oCell As Object
oView = ThisComponent.getCurrentController()
oVCursor = oView.getViewCursor()
' caution : oVCursor.TextTable is void if the cursor is not in a text table
oTable = oVCursor.TextTable
' caution : oVCursor.Cell is void if the cursor is not in a text table
oCell = oVCursor.Cell
print oCell.CellName
If you want to investigate oSelection for the different cases you should
use Xray and look at the detailed information it displays. Hopefully it
will help you in translating to Java.
you can also use the Object Inspector
(http://wiki.services.openoffice.org/wiki/Object_Inspector) and can try
to generate the necessary Java snippets ;-)
Juergen
______
Bernard
---------------------------------------------------------------------
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]