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 
24 package ifc.sheet;
25 
26 import com.sun.star.sheet.XCellRangeFormula;
27 
28 public class _XCellRangeFormula extends lib.MultiMethodTest {
29 
30     public XCellRangeFormula oObj = null;
31 
32     public String[][] orgValue = null;
33 
_getFormulaArray()34     public void _getFormulaArray() {
35         Object noArray = tEnv.getObjRelation("noArray");
36         if (noArray != null) {
37             log.println("Component " + noArray.toString() +
38                 " doesn't really support this Interface");
39             log.println("It doesn't make sense to get an FormulaArray from"
40                 + " the whole sheet");
41             tRes.tested("getFormulaArray()", true);
42             return;
43         }
44         orgValue = oObj.getFormulaArray();
45         String[][] newValue = oObj.getFormulaArray();
46         newValue[0][0] = "inserted";
47         oObj.setFormulaArray(newValue);
48         boolean res = oObj.getFormulaArray()[0][0].equals(newValue[0][0]);
49         tRes.tested("getFormulaArray()",res);
50     }
51 
_setFormulaArray()52     public void _setFormulaArray() {
53         requiredMethod("getFormulaArray()");
54         Object noArray = tEnv.getObjRelation("noArray");
55         if (noArray != null) {
56             log.println("Component " + noArray.toString() +
57                 " doesn't really support this Interface");
58             log.println("It doesn't make sense to set an FormulaArray over"
59                 + " the whole sheet");
60             tRes.tested("setFormulaArray()", true);
61             return;
62         }
63         oObj.setFormulaArray(orgValue);
64         boolean res = oObj.getFormulaArray()[0][0].equals(orgValue[0][0]);
65         tRes.tested("setFormulaArray()",res);
66     }
67 }
68