1*ef39d40dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*ef39d40dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*ef39d40dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*ef39d40dSAndrew Rist * distributed with this work for additional information 6*ef39d40dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*ef39d40dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*ef39d40dSAndrew Rist * "License"); you may not use this file except in compliance 9*ef39d40dSAndrew Rist * with the License. You may obtain a copy of the License at 10*ef39d40dSAndrew Rist * 11*ef39d40dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*ef39d40dSAndrew Rist * 13*ef39d40dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*ef39d40dSAndrew Rist * software distributed under the License is distributed on an 15*ef39d40dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*ef39d40dSAndrew Rist * KIND, either express or implied. See the License for the 17*ef39d40dSAndrew Rist * specific language governing permissions and limitations 18*ef39d40dSAndrew Rist * under the License. 19*ef39d40dSAndrew Rist * 20*ef39d40dSAndrew Rist *************************************************************/ 21*ef39d40dSAndrew Rist 22*ef39d40dSAndrew Rist 23cdf0e10cSrcweir package ifc.sheet; 24cdf0e10cSrcweir 25cdf0e10cSrcweir import com.sun.star.sheet.XScenarioEnhanced; 26cdf0e10cSrcweir import com.sun.star.table.CellRangeAddress; 27cdf0e10cSrcweir import com.sun.star.uno.UnoRuntime; 28cdf0e10cSrcweir 29cdf0e10cSrcweir import lib.MultiMethodTest; 30cdf0e10cSrcweir 31cdf0e10cSrcweir 32cdf0e10cSrcweir /** 33cdf0e10cSrcweir * 34cdf0e10cSrcweir * @author sw93809 35cdf0e10cSrcweir */ 36cdf0e10cSrcweir public class _XScenarioEnhanced extends MultiMethodTest { 37cdf0e10cSrcweir public XScenarioEnhanced oObj = null; 38cdf0e10cSrcweir before()39cdf0e10cSrcweir public void before() { 40cdf0e10cSrcweir oObj = (XScenarioEnhanced) UnoRuntime.queryInterface( 41cdf0e10cSrcweir XScenarioEnhanced.class, 42cdf0e10cSrcweir tEnv.getObjRelation("ScenarioSheet")); 43cdf0e10cSrcweir } 44cdf0e10cSrcweir _getRanges()45cdf0e10cSrcweir public void _getRanges() { 46cdf0e10cSrcweir boolean res = true; 47cdf0e10cSrcweir CellRangeAddress[] getting = oObj.getRanges(); 48cdf0e10cSrcweir System.out.println("Count " + getting.length); 49cdf0e10cSrcweir 50cdf0e10cSrcweir CellRangeAddress first = getting[0]; 51cdf0e10cSrcweir 52cdf0e10cSrcweir if (!(first.Sheet == 1)) { 53cdf0e10cSrcweir log.println( 54cdf0e10cSrcweir "wrong RangeAddress is returned, expected Sheet=0 and got " + 55cdf0e10cSrcweir first.Sheet); 56cdf0e10cSrcweir res = false; 57cdf0e10cSrcweir } 58cdf0e10cSrcweir 59cdf0e10cSrcweir if (!(first.StartColumn == 0)) { 60cdf0e10cSrcweir log.println( 61cdf0e10cSrcweir "wrong RangeAddress is returned, expected StartColumn=0 and got " + 62cdf0e10cSrcweir first.StartColumn); 63cdf0e10cSrcweir res = false; 64cdf0e10cSrcweir } 65cdf0e10cSrcweir 66cdf0e10cSrcweir if (!(first.EndColumn == 10)) { 67cdf0e10cSrcweir log.println( 68cdf0e10cSrcweir "wrong RangeAddress is returned, expected EndColumn=10 and got " + 69cdf0e10cSrcweir first.EndColumn); 70cdf0e10cSrcweir res = false; 71cdf0e10cSrcweir } 72cdf0e10cSrcweir 73cdf0e10cSrcweir if (!(first.StartRow == 0)) { 74cdf0e10cSrcweir log.println( 75cdf0e10cSrcweir "wrong RangeAddress is returned, expected StartRow=0 and got " + 76cdf0e10cSrcweir first.StartRow); 77cdf0e10cSrcweir res = false; 78cdf0e10cSrcweir } 79cdf0e10cSrcweir 80cdf0e10cSrcweir if (!(first.EndRow == 10)) { 81cdf0e10cSrcweir log.println( 82cdf0e10cSrcweir "wrong RangeAddress is returned, expected EndRow=10 and got " + 83cdf0e10cSrcweir first.EndRow); 84cdf0e10cSrcweir res = false; 85cdf0e10cSrcweir } 86cdf0e10cSrcweir 87cdf0e10cSrcweir tRes.tested("getRanges()", res); 88cdf0e10cSrcweir } 89cdf0e10cSrcweir }