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