| View previous topic :: View next topic |
| Author |
Message |
satabau General User

Joined: 12 Mar 2012 Posts: 34
|
Posted: Mon May 28, 2012 8:01 am Post subject: [Solved] Mistake in the Developer's Guide? |
|
|
I was here http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Conditional_Formats
and I just copied the example
| Code: |
// get the conditional format object of the cell range
com.sun.star.table.XCellRange xCellRange = xSheet.getCellRangeByName("A1:B10");
com.sun.star.beans.XPropertySet xPropSet = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xCellRange);
com.sun.star.sheet.XSheetConditionalEntries xEntries =
(com.sun.star.sheet.XSheetConditionalEntries) xPropSet.getPropertyValue("ConditionalFormat");
|
but I have this
java.lang.ClassCastException: com.sun.star.uno.Any cannot be cast to com.sun.star.sheet.XSheetConditionalEntries
Where's the problem?
Thank you
Last edited by satabau on Thu May 31, 2012 7:55 am; edited 1 time in total |
|
| Back to top |
|
 |
satabau General User

Joined: 12 Mar 2012 Posts: 34
|
Posted: Thu May 31, 2012 7:54 am Post subject: |
|
|
| Code: |
XPropertySet xPropSet = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, xCellRange);
Object obj= xPropSet.getPropertyValue("ConditionalFormat");
XSheetConditionalEntries xEntries = (XSheetConditionalEntries)
UnoRuntime.queryInterface(XSheetConditionalEntries.class, obj);
|
|
|
| Back to top |
|
 |
|