To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=63211





------- Additional comments from [EMAIL PROTECTED] Wed Mar 15 08:49:28 -0800 
2006 -------
Alrighty here is a better example. For this example you only need a Document
Factory, and an XTextDocument. 

#####################################################


public void toOpenOffice() throws java.lang.Exception
  {
XMultiServiceFactory documentFactory = this.connection.getDocumentFactory();
Object writerShape = documentFactory.createInstance(
"com.sun.star.text.TextFrame" );
XTextContent xTextContentShape = ( XTextContent ) UnoRuntime.queryInterface(
XTextContent.class, writerShape );

XPropertySet xTextContentPropertySet = ( XPropertySet )
UnoRuntime.queryInterface( XPropertySet.class,
   xTextContentShape );

xTextContentPropertySet.setPropertyValue( "FrameWidthAbsolute", new Integer(
5000 ) );
xTextContentPropertySet.setPropertyValue( "AnchorType",
TextContentAnchorType.AT_PAGE );
xTextContentPropertySet.setPropertyValue( "TextWrap", WrapTextMode.NONE );
xTextContentPropertySet.setPropertyValue( "FrameIsAutomaticHeight", new Boolean(
true ) );

XPropertySet xShapeProps = ( XPropertySet ) UnoRuntime.queryInterface(
XPropertySet.class, writerShape );

xShapeProps.setPropertyValue( "VertOrient", new Short( VertOrientation.NONE ) );
xShapeProps.setPropertyValue( "HoriOrient", new Short( HoriOrientation.NONE ) );
xShapeProps.setPropertyValue( "HoriOrientPosition", new Integer( ( 500 ) ) );
xShapeProps.setPropertyValue( "VertOrientPosition", new Integer( ( 500 ) ) );

XText xShapeText = ( XText ) UnoRuntime.queryInterface( XText.class, 
writerShape );
XText mxDocText = this.connection.getTextDocument()
 .getText();

mxDocText.insertTextContent( mxDocText.createTextCursor(), xTextContentShape,
false );

xShapeText.setString( "SOME RANDOM TEXT SOME RANDOM TEXT SOME RANDOM TEXT SOME
RANDOM TEXT SOME RANDOM TEXT SOME RANDOM TEXT SOME RANDOM TEXT SOME RANDOM TEXT
SOME RANDOM TEXT SOME RANDOM TEXT SOME RANDOM TEXT SOME RANDOM TEXT" );

long result = AnyConverter.toLong( xTextContentPropertySet.getPropertyValue(
"FrameHeightAbsolute" ) );

System.out.println( "heightInteger " + result );
  }

###################

thanks.


---------------------------------------------------------------------
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to