Package com.sun.star.sheet

Examples of com.sun.star.sheet.XSheetCellRanges


     * Tested method returns each cell of each column that is different to the
     * cell in a given row
     */
    public void _queryColumnDifferences() {
        boolean res = true;
        XSheetCellRanges ranges = oObj.queryColumnDifferences(
                                          new CellAddress((short) 0, 1, 1));
        getting = ranges.getRangeAddressesAsString();
        expected = mExpectedResults[QUERYCOLUMNDIFFERENCES];

        if (!getting.startsWith(expected)) {
            log.println("Getting: " + getting);
            log.println("Should have started with: " + expected);
View Full Code Here


     * CellFlags
     * @see com.sun.star.sheet.CellFlags
     */
    public void _queryContentCells() {
        boolean res = true;
        XSheetCellRanges ranges = oObj.queryContentCells(
                                          (short) CellFlags.VALUE);
        getting = ranges.getRangeAddressesAsString();
        expected = mExpectedResults[QUERYCONTENTCELLS];

        if (!getting.startsWith(expected)) {
            log.println("Getting: " + getting);
            log.println("Should have started with: " + expected);
View Full Code Here

            oSheet.getCellByPosition(2, 0).setValue(1);
            oSheet.getCellByPosition(3, 0).setValue(1);
           
            log.println(
                    "calling oObj.queryDependents(false)");
            XSheetCellRanges getting = oObj.queryDependents(false);          
            CellRangeAddress[] range = getting.getRangeAddresses();
           
            res = ((range[miQueryThisDependentRange].StartColumn==miExpectedDependentValues[0]) &&
                    (range[miQueryThisDependentRange].EndColumn==miExpectedDependentValues[1]) &&
                   (range[miQueryThisDependentRange].StartRow==miExpectedDependentValues[2]) &&
                   (range[miQueryThisDependentRange].EndRow==miExpectedDependentValues[3]));
View Full Code Here

            oSheet.getCellByPosition(3, 0).setValue(1);
            oSheet.getCellByPosition(1, 2).setFormula("=A16*2");
           
            log.println(
                    "calling oObj.queryPrecedents(false)");
            XSheetCellRanges getting = oObj.queryPrecedents(false);
            CellRangeAddress[] range = getting.getRangeAddresses();
           
            res = ((range[miQueryThisPrecedentRange].StartColumn==miExpectedPrecedentValues[0]) &&
                    (range[miQueryThisPrecedentRange].EndColumn==miExpectedPrecedentValues[1]) &&
                   (range[miQueryThisPrecedentRange].StartRow==miExpectedPrecedentValues[2]) &&
                   (range[miQueryThisPrecedentRange].EndRow==miExpectedPrecedentValues[3]));
View Full Code Here

            // *********************************************************
            // example for use of XEnumerationAccess
            XCellRangesQuery xCellQuery = (XCellRangesQuery)UnoRuntime.queryInterface(
                XCellRangesQuery.class, sheet);
            XSheetCellRanges xFormulaCells = xCellQuery.queryContentCells(
                (short)com.sun.star.sheet.CellFlags.FORMULA);
            XEnumerationAccess xFormulas = xFormulaCells.getCells();
            XEnumeration xFormulaEnum = xFormulas.createEnumeration();
           
            while (xFormulaEnum.hasMoreElements()) {
                Object formulaCell = xFormulaEnum.nextElement();
                xCell = (XCell)UnoRuntime.queryInterface(XCell.class, formulaCell);
View Full Code Here

                    xCellProp.setPropertyValue( "NumberFormat", new Integer( iNewNumberFormat ) );
                   
                    // interate over all cells from the cellrange with an content and use the DM/EUR factor
                    XCellRangesQuery xCellRangesQuery = (XCellRangesQuery) UnoRuntime.queryInterface(
                        com.sun.star.sheet.XCellRangesQuery.class, xCellRange );
                    XSheetCellRanges xSheetCellRanges = xCellRangesQuery.queryContentCells(
                        (short) com.sun.star.sheet.CellFlags.VALUE );
                   
                    if( xSheetCellRanges.getCount() > 0 ) {
                        XEnumerationAccess xCellEnumerationAccess = xSheetCellRanges.getCells();
                        XEnumeration xCellEnumeration = xCellEnumerationAccess.createEnumeration();
                       
                        while( xCellEnumeration.hasMoreElements() ) {
                            XCell xCell = (XCell) UnoRuntime.queryInterface(
                                XCell.class, xCellEnumeration.nextElement());
View Full Code Here

    }

    public void setErrorList() {
        try {
            XCellRangesQuery xCellQuery = (XCellRangesQuery)UnoRuntime.queryInterface( XCellRangesQuery.class, getActiveSheet() );
            XSheetCellRanges xFormulaCells = xCellQuery.queryContentCells( (short)com.sun.star.sheet.CellFlags.FORMULA );
            XEnumerationAccess xFormulas = xFormulaCells.getCells();
            XEnumeration xFormulaEnum = xFormulas.createEnumeration();
            Object formulaCell = null;

            //  observ all formula cells
            while ( xFormulaEnum.hasMoreElements() ) {
View Full Code Here

    public void setError3List() {
        try {
            HashSet<String> allPrecedentNames = getPrecedentOfAllFormulas();
            XCellRangesQuery xCellQuery = (XCellRangesQuery)UnoRuntime.queryInterface(XCellRangesQuery.class, getActiveSheet());
            XSheetCellRanges xValueCells = xCellQuery.queryContentCells( (short)com.sun.star.sheet.CellFlags.VALUE );
            XEnumerationAccess xValues = xValueCells.getCells();
            XEnumeration xValueEnum = xValues.createEnumeration();
            Object valueCell = null;
            boolean isContain; // true (valid) if at least a formula contains the cell
            // observ all valueCells
            while ( xValueEnum.hasMoreElements() ) {
View Full Code Here

    public HashSet<String> getPrecedentOfAllFormulas(){

        HashSet<String> precedentNames = new HashSet<String>();

        XCellRangesQuery xCellQuery = (XCellRangesQuery)UnoRuntime.queryInterface( XCellRangesQuery.class, getActiveSheet() );
        XSheetCellRanges xFormulaCells = xCellQuery.queryContentCells( (short)com.sun.star.sheet.CellFlags.FORMULA );
        XEnumerationAccess xFormulas = xFormulaCells.getCells();
        XEnumeration xFormulaEnum = xFormulas.createEnumeration();
        Object formulaCell = null;

        while ( xFormulaEnum.hasMoreElements() ) {
            try {
View Full Code Here

               
            // *********************************************************
            // example for use of XEnumerationAccess
            XCellRangesQuery xCellQuery = (XCellRangesQuery)
                UnoRuntime.queryInterface(XCellRangesQuery.class, sheet);
            XSheetCellRanges xFormulaCells = xCellQuery.queryContentCells(
                (short)com.sun.star.sheet.CellFlags.FORMULA);
            XEnumerationAccess xFormulas = xFormulaCells.getCells();
            XEnumeration xFormulaEnum = xFormulas.createEnumeration();
           
            while (xFormulaEnum.hasMoreElements()) {
                Object formulaCell = xFormulaEnum.nextElement();
                xCell = (XCell)UnoRuntime.queryInterface(XCell.class, formulaCell);
View Full Code Here

TOP

Related Classes of com.sun.star.sheet.XSheetCellRanges

Copyright © 2018 www.massapicom. 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.