Started modifying project structure

This commit is contained in:
Georgy Litvinov 2020-12-13 14:03:25 +01:00
parent 4e16ed01c2
commit 1e4ee37f89
566 changed files with 3340 additions and 176 deletions

View file

@ -0,0 +1,28 @@
package org.libreoffice.example.comp.tests.helper;
import com.sun.star.beans.PropertyValue;
import com.sun.star.frame.FrameSearchFlag;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import org.libreoffice.example.comp.tests.base.UnoSuite;
public class UnoHelper {
public static XTextDocument getWriterDocument() throws Exception {
XMultiComponentFactory xMngr = UnoSuite.getComponentContext().getServiceManager();
Object oDesktop = xMngr.createInstanceWithContext("com.sun.star.frame.Desktop", UnoSuite.getComponentContext());
XComponentLoader xLoader = (XComponentLoader)UnoRuntime.queryInterface(
XComponentLoader.class, oDesktop);
XComponent xDoc = xLoader.loadComponentFromURL("private:factory/swriter", "_default",
FrameSearchFlag.ALL, new PropertyValue[0]);
return (XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, xDoc);
}
}