| View previous topic :: View next topic |
| Author |
Message |
sandwen1985 General User

Joined: 17 Apr 2012 Posts: 9
|
Posted: Mon May 07, 2012 9:02 pm Post subject: [Solved]determin whether the view cursor is in text table |
|
|
I am new to OOo, these days I am searching for how to determin wheather the view cursor is in text table, but there is no result, can anyone help me?
any help will be great! Thanks!
Moved - floris v, moderator
Last edited by sandwen1985 on Tue May 08, 2012 7:59 pm; edited 1 time in total |
|
| Back to top |
|
 |
probe1 Moderator


Joined: 18 Aug 2004 Posts: 2465 Location: Chonburi Thailand Asia
|
Posted: Mon May 07, 2012 10:52 pm Post subject: |
|
|
Welcome to the forum.
You can test like this:
| Code: | | IF NOT IsEmpty( oViewCursor.TextTable ) then |
Does this help? _________________ Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs |
|
| Back to top |
|
 |
sandwen1985 General User

Joined: 17 Apr 2012 Posts: 9
|
Posted: Tue May 08, 2012 12:10 am Post subject: |
|
|
| thanks probe1, but I am using c++, and don't understand the macros, do you know how to wrtie in c++? thanks so much. |
|
| Back to top |
|
 |
sandwen1985 General User

Joined: 17 Apr 2012 Posts: 9
|
Posted: Tue May 08, 2012 12:29 am Post subject: |
|
|
thanks, i see know. here is the code:
| Code: |
sal_Bool IsCursorInTable()
{
Reference<XPropertySet> xPropertySet(GetTextViewCursor(), UNO_QUERY);
Any aValue = xPropertySet->getPropertyValue(L"TextTable");
Reference<XTextTable> xTextTable(aValue, UNO_QUERY);
return xTextTable.is();
}
|
p.s. How to close this post? |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8979 Location: Lexinton, Kentucky, USA
|
Posted: Tue May 08, 2012 7:20 am Post subject: |
|
|
| Quote: | | p.s. How to close this post? | Edit your 1st post in the thread and add [Solved] to the Subject. |
|
| Back to top |
|
 |
sandwen1985 General User

Joined: 17 Apr 2012 Posts: 9
|
Posted: Tue May 08, 2012 7:58 pm Post subject: |
|
|
| Thanks so much! |
|
| Back to top |
|
 |
|