Examples of XSpreadsheets


Examples of com.sun.star.sheet.XSpreadsheets

            e.printStackTrace();
            throw new StatusException( "Couldn't create document", e );
        }

        log.println("Getting a sheet");
        XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
        XSpreadsheet oSheet = null;
        XSpreadsheet oSheet2 = null;
        XIndexAccess oIndexAccess = (XIndexAccess)
            UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
View Full Code Here

Examples of com.sun.star.sheet.XSpreadsheets

    Exception ex = null;
        // get two sheets
        try {
            XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument)
                    UnoRuntime.queryInterface(XSpreadsheetDocument.class, oObj);
            XSpreadsheets oSheets = xSpreadsheetDocument.getSheets();
            XIndexAccess oIndexSheets = (XIndexAccess) UnoRuntime.queryInterface(
                                                XIndexAccess.class, oSheets);
            xSheet = (XSpreadsheet) UnoRuntime.queryInterface(
                                      XSpreadsheet.class, oIndexSheets.getByIndex(1));
        }
View Full Code Here

Examples of com.sun.star.sheet.XSpreadsheets

        try{
            XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument)
                    UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);

            XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets();

            XIndexAccess xSheetsIndexArray = (XIndexAccess)
                        UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);

            try{
View Full Code Here

Examples of com.sun.star.sheet.XSpreadsheets

        // get two sheets
        xSheet = new XSpreadsheet[2];
        try {
            XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument)
                    UnoRuntime.queryInterface(XSpreadsheetDocument.class, oObj);
            XSpreadsheets oSheets = xSpreadsheetDocument.getSheets();
            XIndexAccess oIndexSheets = (XIndexAccess) UnoRuntime.queryInterface(
                                                XIndexAccess.class, oSheets);
            XSpreadsheet oSheet = (XSpreadsheet) UnoRuntime.queryInterface(
                                      XSpreadsheet.class, oIndexSheets.getByIndex(0));
            xSheet[0] = oSheet;
View Full Code Here

Examples of com.sun.star.sheet.XSpreadsheets

    /**
    * Test calls the method and checks returned value. <p>
    * Has <b> OK </b> status if returned value isn't null. <p>
    */
    public void _getSheets() {
        XSpreadsheets sheets = oObj.getSheets();
        tRes.tested("getSheets()", sheets != null);
    }
View Full Code Here

Examples of com.sun.star.sheet.XSpreadsheets

                                                                 PrintWriter log) {
        XInterface oObj = null;

        log.println("getting sheets");

        XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets();

        log.println("getting a sheet");

        XSpreadsheet oSheet = null;
        XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface(
                                            XIndexAccess.class, xSpreadsheets);

        try {
            oSheet = (XSpreadsheet) AnyConverter.toObject(
                             new Type(XSpreadsheet.class),
                             oIndexAccess.getByIndex(0));
        } catch (com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get a spreadsheet", e);
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get a spreadsheet", e);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get a spreadsheet", e);
        }

        log.println("filling some cells");

        try {
            oSheet.getCellByPosition(5, 5).setValue(15);
            oSheet.getCellByPosition(1, 4).setValue(10);
            oSheet.getCellByPosition(2, 0).setValue(-5.15);
            oSheet.getCellByPosition(8, 8).setFormula("= B5 + C1");
            // fill cells for XSheetOtline::autoutline
            oSheet.getCellByPosition(6, 6).setValue(3);
            oSheet.getCellByPosition(7, 6).setValue(3);
            oSheet.getCellByPosition(8, 6).setFormula("= SUM(G7:H7)");
            oSheet.getCellByPosition(9, 6).setFormula("= G7*I7");
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            e.printStackTrace(log);
            throw new StatusException("Exception occurred while filling cells", e);
        }

        oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, oSheet);

        log.println("creating a new environment for object");

        TestEnvironment tEnv = new TestEnvironment(oObj);
       
        // do not execute com::sun::star::sheets::XCellSeries::fillAuto()
        tEnv.addObjRelation("XCELLSERIES_FILLAUTO", new Boolean(false));

        // set the adress ranges of the cells (see values set above): for e.g. XSheetOutline test
        tEnv.addObjRelation("CellRangeAddress",
            new CellRangeAddress((short)0, 6, 6, 8, 8));
        tEnv.addObjRelation("CellRangeSubAddress",
            new CellRangeAddress((short)0, 6, 6, 7, 8));
        // pick a cell with a formula for XSheetAuditing, a dependent cell and a precedent cell
        tEnv.addObjRelation("XSheetAuditing.CellAddress", new CellAddress((short)0, 8, 6));
        tEnv.addObjRelation("XSheetAuditing.PrecedentCellAddress", new CellAddress((short)0, 7, 6));
        tEnv.addObjRelation("XSheetAuditing.DependentCellAddress", new CellAddress((short)0, 9, 6));
       
        // add an existing sheet for linking
        tEnv.addObjRelation("XSheetLinkable.LinkSheet", "ScSheetLinksObj.sdc");
       
        //adding Scenario and with that a ScenarioSheet-Relation for Scenario and XScenarioEnhanced
        XScenariosSupplier scene = (XScenariosSupplier) UnoRuntime.queryInterface(
                                           XScenariosSupplier.class,
                                           tEnv.getTestObject());
        scene.getScenarios()
             .addNewByName("Scenario",
                           new CellRangeAddress[] {
            new CellRangeAddress((short) 0, 0, 0, 10, 10)
        }, "Comment");

        XSpreadsheet sSheet = null;
       
        try {
            sSheet = (XSpreadsheet) UnoRuntime.queryInterface(
                             XSpreadsheet.class,
                             xSpreadsheets.getByName("Scenario"));
        } catch (com.sun.star.container.NoSuchElementException e) {
            log.println("Couldn't get Scenario");
        } catch (com.sun.star.lang.WrappedTargetException e) {
            log.println("Couldn't get Scenario");
        }
View Full Code Here

Examples of com.sun.star.sheet.XSpreadsheets

            aField = (XInterface)
                _oMSF.createInstance("com.sun.star.text.TextField.URL");
            oContent = (XTextContent)
                UnoRuntime.queryInterface(XTextContent.class, aField);

            XSpreadsheets oSheets = xSheetDoc.getSheets() ;
            XIndexAccess oIndexSheets = (XIndexAccess)
                UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
            XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
                    new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
View Full Code Here

Examples of com.sun.star.sheet.XSpreadsheets

        log.println( "Creating a test environment" );

        // create testobject here

        log.println("getting sheets");
        XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();

        log.println("getting a sheet");
        XSpreadsheet oSheet = null;
        XIndexAccess oIndexAccess = (XIndexAccess)
            UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
View Full Code Here

Examples of com.sun.star.sheet.XSpreadsheets

        // creation of the testobject here
        // first we write what we are intend to do to log file
        log.println("craeting a test environment");

        log.println("getting column");
        XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
        XNameAccess oNames = (XNameAccess)
            UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets );
        XSpreadsheet xSpreadsheet = null;
        try {
            xSpreadsheet = (XSpreadsheet) AnyConverter.toObject(
View Full Code Here

Examples of com.sun.star.sheet.XSpreadsheets

        sCellAdress.Column = 7;
        sCellAdress.Row = 8;
       
        log.println ("Getting a sheet");
       
        XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets ();
        XSpreadsheet oSheet = null;
        XSpreadsheet oSheet2 = null;
        XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface (
            XIndexAccess.class, xSpreadsheets);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.