2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 import lib
.MultiMethodTest
;
23 import com
.sun
.star
.sheet
.XViewPane
;
24 import com
.sun
.star
.table
.CellRangeAddress
;
27 * Testing <code>com.sun.star.sheet.XViewPane</code>
30 * <li><code> getFirstVisibleColumn()</code></li>
31 * <li><code> setFirstVisibleColumn()</code></li>
32 * <li><code> getFirstVisibleRow()</code></li>
33 * <li><code> setFirstVisibleRow()</code></li>
34 * <li><code> getVisibleRange()</code></li>
36 * @see com.sun.star.sheet.XViewPane
38 public class _XViewPane
extends MultiMethodTest
{
40 public XViewPane oObj
= null;
45 * Test calls the method and checks returned value. <p>
46 * Has <b> OK </b> status if returned value is equal to value that was set
47 * by method <code>setFirstVisibleColumn()</code>. <p>
48 * The following method tests are to be completed successfully before :
50 * <li> <code> setFirstVisibleColumn() </code> : to set specific value
51 * of the first column that is visible in the pane </li>
54 public void _getFirstVisibleColumn() {
55 requiredMethod("setFirstVisibleColumn()");
56 boolean result
= col
== oObj
.getFirstVisibleColumn();
57 tRes
.tested("getFirstVisibleColumn()", result
);
61 * Test calls the method and checks returned value. <p>
62 * Has <b> OK </b> status if returned value is equal to value that was set
63 * by method <code>setFirstVisibleRow()</code>. <p>
64 * The following method tests are to be completed successfully before :
66 * <li> <code> setFirstVisibleRow() </code> : to set specific value of
67 * the first row that is visible in the pane </li>
70 public void _getFirstVisibleRow() {
71 requiredMethod("setFirstVisibleRow()");
72 boolean result
= row
== oObj
.getFirstVisibleRow();
73 tRes
.tested("getFirstVisibleRow()", result
);
77 * Test just calls the method. <p>
78 * Has <b> OK </b> status if the method successfully returns. <p>
80 public void _setFirstVisibleColumn() {
81 oObj
.setFirstVisibleColumn(col
);
82 tRes
.tested("setFirstVisibleColumn()", true);
86 * Test just calls the method. <p>
87 * Has <b> OK </b> status if the method successfully returns. <p>
89 public void _setFirstVisibleRow() {
90 oObj
.setFirstVisibleRow(row
);
91 tRes
.tested("setFirstVisibleRow()", true);
95 * Test calls the method, checks returned value and adds object relation
96 * 'DATAAREA' to test environment. <p>
97 * Has <b> OK </b> status if returned value isn't null and if start row and
98 * start column are equal to values that was set by methods
99 * <code>setFirstVisibleRow</code> and <code>setFirstVisibleColumn</code>.<p>
100 * The following method tests are to be completed successfully before :
102 * <li> <code> setFirstVisibleRow() </code> : to set specific value of
103 * the first row that is visible in the pane </li>
104 * <li> <code> setFirstVisibleColumn() </code> : to set specific value of
105 * the first column that is visible in the pane </li>
108 public void _getVisibleRange() {
109 requiredMethod("setFirstVisibleRow()");
110 requiredMethod("setFirstVisibleColumn()");
112 CellRangeAddress RA
= oObj
.getVisibleRange();
113 boolean result
= RA
!= null;
115 result
&= RA
.Sheet
== 0;
116 result
&= RA
.StartRow
== row
;
117 result
&= RA
.StartColumn
== col
;
118 tEnv
.addObjRelation("DATAAREA", RA
);
121 tRes
.tested("getVisibleRange()", result
);