Thank you very much,
I will try to translate this into Java. Maybe anybody already got a
solution for Java?
Tobias
Stephan
Wunderlich
<stephan.wunderli An
[EMAIL PROTECTED]> [email protected]
Kopie
18.01.2006 17:42
Thema
Re: [dev] check if a XTextRange
Bitte antworten contains a text table
an
[EMAIL PROTECTED]
g
Hi Tobias,
> I know how to check if a XTextRange is within a Cell of a text table. But
> how do I evaluate if a
> specific XTextRange CONTAINS a text table?
>
> Any help is very appreciated!
the following basic macro checks the current selection in a writer
document for TextTables ...
====================================
Sub Main
Ranges = thiscomponent.currentcontroller.selection
aRange = Ranges(0)
if containsTable(aRange) then
msgbox "selected Range contains a TextTable"
else
msgbox "selected Range doesn't contain a TextTable"
endif
End Sub
function containsTable(aRange) as Boolean
ret = false
aEnum = aRange.createEnumeration
while aEnum.hasMoreElements
aPortion = aEnum.nextElement
if aPortion.supportsService("com.sun.star.text.TextTable") then
ret=true
endif
wend
containsTable=ret
end function
====================================
hope that helps
Regards
Stephan
---------------------------------------------------------------------
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]