Issue 51848 - HoriOrientPosition is Long in documentation, but it's Integer in the code
Summary: HoriOrientPosition is Long in documentation, but it's Integer in the code
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: stephan.wunderlich
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-12 17:07 UTC by ataraxis
Modified: 2013-02-24 21:07 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 ataraxis 2005-07-12 17:07:05 UTC
HoriOrientPosition is supposed to be long, if you look here:
http://api.openoffice.org/docs/common/ref/com/sun/star/text/Shape.html#HoriOrientPosition
Type[long] HoriOrientPosition  (via .getPropertySetInfo())

But actually it's an Integer:
System.out.println(xFrameProps.getPropertyValue("HoriOrientPosition").getClass());
=> Integer

xFrameProps.setPropertyValue("HoriOrientPosition", new Integer(420));
=> works
xFrameProps.setPropertyValue("HoriOrientPosition", new Long(420));
=> com.sun.star.lang.IllegalArgumentException


Here is the code snippet:
XTextFrame xFrame = (XTextFrame) UnoRuntime.queryInterface (
           XTextFrame.class, xMSFDoc.createInstance (
                      "com.sun.star.text.TextFrame" ) );
XShape xShape = (XShape) UnoRuntime.queryInterface(XShape.class, xFrame);
XPropertySet xFrameProps = (XPropertySet)UnoRuntime.queryInterface(
                    XPropertySet.class, xFrame );
xFrameProps.setPropertyValue( "AnchorType", TextContentAnchorType.AT_PAGE );
xFrameProps.setPropertyValue( "HoriOrient", new Short(HoriOrientation.NONE));
System.out.println(xFrameProps.getPropertyValue("HoriOrientPosition").getClass());
xFrameProps.setPropertyValue("HoriOrientPosition", new Integer(420));
Comment 1 stephan.wunderlich 2005-07-14 13:02:01 UTC
The c++ type "Long" is mapped to the java type "Integer", since the java Integer
has the same range as a c++ Long ... in c++ you'd have to use a long tho.
Comment 2 stephan.wunderlich 2005-07-25 11:04:56 UTC
closing