To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=97880 Issue #|97880 Summary|Crashing on accessing Style in StarBasic API Component|Drawing Version|OOo 3.0 Platform|All URL| OS/Version|All Status|UNCONFIRMED Status whiteboard| Keywords| Resolution| Issue type|DEFECT Priority|P2 Subcomponent|programming Assigned to|graphicsneedsconfirm Reported by|swingkyd
------- Additional comments from swing...@openoffice.org Thu Jan 8 21:52:53 +0000 2009 ------- This is a difficult one to explain: Symptom: 1) OO.org 3.0 crashes on attempting to Xray a style using StarBasic 2) OO.org cannot inspect using the "watch" utility in the Openoffice.org Basic environment as it crashes as well. it appears that programmatically accessing the style is not working. More on the error follows: Using the StyleFamily "graphics" exports the following interfaces: com.sun.star.container.XElementAccess com.sun.star.container.XIndexAccess com.sun.star.container.XNameAccess com.sun.star.container.XNameContainer com.sun.star.container.XNamed com.sun.star.container.XNameReplace However, XNameReplace, XNameContainer methods which attempt to add, modify etc. just DO NOT WORK. One can access the Style using methods: getByName getByIndex but the following methods are not found at runtime: replaceByName( [in] string aName, [in] any aElement ) insertByName( [in] string aName, [in] any aElement ) Here is some sample code which should cause some headaches: oDoc = thisComponent ' open a draw document and run this as a sub oStyleFamilies = oDoc.styleFamilies oShapeStyles = oStyleFamilies.getByName("graphics") oStyle = oShapeStyles.getByIndex(0) '<- larger is fine if you have it ' Xray OStyle '<-- will definitely crash. 'oStyle = oShapeStyles.getByName("cg") '<- use the API to make style cg ' put a stop on the code 2 lines up and watch oStyle. Inspect it... it crashes ' the following code does not work as per section 9.6.1 in Developers Guide says it should and it has apparently worked in the past: oStyle = oDoc.createInstance( "com.sun.star.style.Style" ) '<- does not work Document factor does not have a registered service or something like this. I don't know if this is related but basically it's not working the way it is supposed to as far as I can see and there appears to be no way of accessing, modifying or removing the graphics styles in a Draw Document. --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@graphics.openoffice.org For additional commands, e-mail: issues-h...@graphics.openoffice.org --------------------------------------------------------------------- To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org