| View previous topic :: View next topic |
| Author |
Message |
Chriz Newbie

Joined: 08 Sep 2009 Posts: 4
|
Posted: Tue Sep 08, 2009 1:52 am Post subject: How to hide/show paragraphs programmatically? |
|
|
Hi all,
I am a newbie to OO and now I am working on a project in Java. I want to use the UNO API to hide the specific paragraphs in the editor view. I've already got the paras' enumeration, but dont know what to do next.
I've found a thread http://api.openoffice.org/servlets/ReadMsg?listName=dev&msgNo=8993 talking about this question. However I cannot create a TextSection instance. Below is my code snippet:
XMultiServiceFactory factory = (XMultiServiceFactory) UnoRuntime
.queryInterface(XMultiServiceFactory.class, xTDoc);
XTextSection section = factory.createInstance("com.sun.star.text.TextSection");//interrupt at this line, the factory is not null in the debug view.
So is there anything wrong with the creation of TextSection? Or is there any way to hide/show the paragraphs?
Thanks. _________________ Chris |
|
| Back to top |
|
 |
Chriz Newbie

Joined: 08 Sep 2009 Posts: 4
|
Posted: Tue Sep 08, 2009 5:33 pm Post subject: |
|
|
I know the problem. It is because of the casting method in OO, the below code works:
XTextSection textSection = (XTextSection) UnoRuntime.queryInterface(XTextSection.class,factory.createInstance("com.sun.star.text.TextSection"));
However this method seems not perfect, because when I set the IsVisible property true, there comes out a border round each textsection. This is different from the original view of those paragraphs. So back to my question, is there any good way to programmatically hide/show paragraphs?
Thank you all. _________________ Chris |
|
| Back to top |
|
 |
|
|
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
|