XNameAccess oTSSuppName = oTSSupp.getTextSections();
oTS = (XInterface) oDocMSF.createInstance(
"com.sun.star.text.TextSection");
XTextContent oTSC = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class, oTS);
oText.insertTextContent(oCursor, oTSC, false);
XWordCursor oWordC = (XWordCursor) UnoRuntime.queryInterface(
XWordCursor.class, oCursor);
oCursor.setString("End of TextSection");
oCursor.gotoStart(false);
oCursor.setString("Start of TextSection ");
oWordC.gotoEndOfWord(false);
XInterface oTS2 = (XInterface) oDocMSF.createInstance(
"com.sun.star.text.TextSection");
oTSC = (XTextContent) UnoRuntime.queryInterface(XTextContent.class,
oTS2);
oText.insertTextContent(oCursor, oTSC, false);
XIndexAccess oTSSuppIndex = (XIndexAccess) UnoRuntime.queryInterface(
XIndexAccess.class,
oTSSuppName);
log.println(
"getting a TextSection with the XTextSectionSupplier()");
xTS = (XTextSection) UnoRuntime.queryInterface(XTextSection.class,
oTSSuppIndex.getByIndex(0));
XNamed xTSName = (XNamed) UnoRuntime.queryInterface(XNamed.class,
xTS);
xTSName.setName("SwXTextSection");
log.println(" adding TextTable");
the_table = SOfficeFactory.createTextTable(xTextDoc, 6, 4);
XNamed the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class,
the_table);
the_name.setName("SwXTextDocument");
SOfficeFactory.insertTextContent(xTextDoc,
(XTextContent) the_table);
log.println(" adding ReferenceMark");
XInterface aMark = (XInterface) oDocMSF.createInstance(
"com.sun.star.text.ReferenceMark");
the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class, aMark);
the_name.setName("SwXTextDocument");
XTextContent oTC = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class, aMark);
SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC);
log.println(" adding TextGraphic");
WriterTools.insertTextGraphic(xTextDoc, oDocMSF, 5200, 4200, 4400,