Issue 25408 - api: sw.PageStyles::XStyle
Summary: api: sw.PageStyles::XStyle
Status: ACCEPTED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P4 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-12 14:25 UTC by steffen.grund
Modified: 2013-02-24 21:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description steffen.grund 2004-02-12 14:25:26 UTC
Trying to set a parent style on an own created style (and on an Office style)
throws a RuntimeException.

The following macro reproduces this (with an own created style):

Sub Main
	xNameAccess = ThisComponent.getStyleFamilies()
	xStyleFamily = xNameAccess.getByName("PageStyles")
	xStyle = xStyleFamily.getByName("Default")

	myStyle = ThisComponent.CreateInstance("com.sun.star.style.PageStyle")

	xStyleFamily.insertByName("MyStyle", myStyle)
	myStyle.setParentStyle(xStyle.getName())
End Sub
Comment 1 thomas.lange 2004-03-08 11:45:53 UTC
.
Comment 2 stephan.wunderlich 2004-05-03 13:04:35 UTC
SW: changed Prio
Comment 3 stephan.wunderlich 2004-05-05 16:43:56 UTC
SW: changed target
Comment 4 bmarcelly 2004-10-30 09:50:27 UTC
Developer's Guide 7.4.1 says :
Note that page and numbering styles are not hierarchical and cannot have parent styles. 
The method getParentStyle() always returns an empty string, and the method 
setParentStyle() throws a com.sun.star.uno.RuntimeException when called at a default 
style.

Consequently I think this report should be Invalid.
Comment 5 steffen.grund 2004-11-01 10:13:31 UTC
RuntimeExceptions should "signal an error, which was not covered by the
interface method specification". Since the behaviour of the interface is inside
of the specification, it should throw an exception that makes more sense.

The idl definition of XStyle::setParentStyle suggests a NoSuchElementException.

So the Deveoper's Guide has to be updated, too.

IMHO the bug is fully justified with this target and prio.