OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Solved]determin whether the view cursor is in text table

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
sandwen1985
General User
General User


Joined: 17 Apr 2012
Posts: 9

PostPosted: Mon May 07, 2012 9:02 pm    Post subject: [Solved]determin whether the view cursor is in text table Reply with quote

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
View user's profile Send private message
probe1
Moderator
Moderator


Joined: 18 Aug 2004
Posts: 2560
Location: Chonburi Thailand Asia

PostPosted: Mon May 07, 2012 10:52 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sandwen1985
General User
General User


Joined: 17 Apr 2012
Posts: 9

PostPosted: Tue May 08, 2012 12:10 am    Post subject: Reply with quote

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
View user's profile Send private message
sandwen1985
General User
General User


Joined: 17 Apr 2012
Posts: 9

PostPosted: Tue May 08, 2012 12:29 am    Post subject: Reply with quote

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
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Tue May 08, 2012 7:20 am    Post subject: Reply with quote

Quote:
p.s. How to close this post?
Edit your 1st post in the thread and add [Solved] to the Subject.
Back to top
View user's profile Send private message
sandwen1985
General User
General User


Joined: 17 Apr 2012
Posts: 9

PostPosted: Tue May 08, 2012 7:58 pm    Post subject: Reply with quote

Thanks so much!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group