Bugzilla – Attachment 56028 Details for
Bug 45115
BorderLine UNO API broken in LibreOffice 3.4 / 3.5
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
BorderLine Java test code
BorderLineTest.java (text/x-java), 2.52 KB, created by
mail
on 2012-01-23 03:37:06 UTC
(
hide
)
Description:
BorderLine Java test code
Filename:
MIME Type:
Creator:
mail
Created:
2012-01-23 03:37:06 UTC
Size:
2.52 KB
patch
obsolete
> >import com.sun.star.beans.PropertyValue; >import com.sun.star.beans.XPropertySet; >import com.sun.star.comp.helper.Bootstrap; >import com.sun.star.comp.helper.BootstrapException; >import com.sun.star.frame.XComponentLoader; >import com.sun.star.lang.XComponent; >import com.sun.star.lang.XMultiComponentFactory; >import com.sun.star.lang.XMultiServiceFactory; >import com.sun.star.table.BorderLine; >import com.sun.star.table.TableBorder; >import com.sun.star.text.XText; >import com.sun.star.text.XTextDocument; >import com.sun.star.text.XTextTable; >import com.sun.star.uno.Exception; >import com.sun.star.uno.UnoRuntime; >import com.sun.star.uno.XComponentContext; > >public class BorderLineTest { > > public static void main(String[] args) throws BootstrapException, Exception { > XComponentContext xContext = Bootstrap.bootstrap(); > XMultiComponentFactory xMCF = xContext.getServiceManager(); > Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xContext); > XComponentLoader xCLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, oDesktop); > > XComponent document = xCLoader.loadComponentFromURL("private:factory/swriter", "_blank", 0, new PropertyValue[0]); > XTextDocument aTextDocument = (XTextDocument) UnoRuntime.queryInterface(com.sun.star.text.XTextDocument.class, document); > > XText xText = aTextDocument.getText(); > > XMultiServiceFactory xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, document); > XTextTable xTextTable = (XTextTable) UnoRuntime.queryInterface(XTextTable.class, xMSF.createInstance("com.sun.star.text.TextTable")); > xTextTable.initialize(1, 1); > xText.insertTextContent(xText.getEnd(), xTextTable, false); > > BorderLine borderLine = new BorderLine(); > borderLine.Color = 0xFF0000; > borderLine.InnerLineWidth = 1; > borderLine.OuterLineWidth = 1; > borderLine.LineDistance = 50; > > TableBorder tableBorder = new TableBorder(); > tableBorder.TopLine = borderLine; > tableBorder.BottomLine = borderLine; > tableBorder.LeftLine = borderLine; > tableBorder.RightLine = borderLine; > tableBorder.IsTopLineValid = true; > tableBorder.IsBottomLineValid = true; > tableBorder.IsLeftLineValid = true; > tableBorder.IsRightLineValid = true; > > XPropertySet xTableProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextTable); > xTableProps.setPropertyValue("TableBorder", tableBorder); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 45115
: 56028 |
56029
|
56030
|
56031