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

ACCESSING/ CREATING CONDITIONAL STYLES

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


Joined: 16 Sep 2006
Posts: 9

PostPosted: Mon Jan 29, 2007 6:08 am    Post subject: ACCESSING/ CREATING CONDITIONAL STYLES Reply with quote

ACCESSING/ CREATING CONDITIONAL STYLES

Does the property ParaStyleConditions of the service STYLE realy exist?
If I access a conditional style, there is no such property as defined in com.sun.star.style.Style

oConditStyle = ThisComponent.StyleFamilies.getByName("ParagraphStyles").getByName("Text body")
oParaCond = oConditStyle.ParaStyleConditions
'error, there is no such property or method


And the following code without the ParaStyleConditions creates a conditional style. Including the ParaStyleConditions causes an error.

oDoc = thiscomponent
oCondStyle = oDoc.createInstance("com.sun.star.style.ConditionalParagraphStyle")
oFamily = oDoc.StyleFamilies.getByName("ParagraphStyles")
sNameNewCondStyle = "OOoBasic conditional style"


Dim ParaConditions(2) as New com.sun.star.beans.NamedValue

ParaConditions(0).Name = "TableHeader"
ParaConditions(0).Value = "Style name 1"
ParaConditions(1).Name = "Table"
ParaConditions(1).Value = "Style name 2"
ParaConditions(2).Name = "OutlineLevel1"
ParaConditions(2).Value = "Style name 3"

'ERROR on this line: no such property found
oCondStyle.ParaStyleConditions = ParaConditions()

oFamily .insertbyName( sNameNewCondStyle, oCondStyle)
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Mon Jan 29, 2007 4:06 pm    Post subject: Reply with quote

Neither "TableHeader", "Table" nor "OutlineLevel1" are names of properties.
I have no idea how to acomplish your task, but the xray-tool should help:
http://ooomacros.org/dev.php#101416
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
ariel_ar_de
General User
General User


Joined: 16 Sep 2006
Posts: 9

PostPosted: Sat Feb 10, 2007 5:54 pm    Post subject: Reply with quote

Hy and thanks for your your answer. As you say there exist NO such property, but if it IS in the API reference com.sun.star.tyle.Style and in the Dev's Guide. So??!!!
It's just blah blah blah???!!!!!
The API reference to that service is NOT unpublished, so it should in theory be accesible. BUT.........[/b]
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