diff options
author | Oliver Bolte <obo@openoffice.org> | 2006-01-19 13:25:51 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2006-01-19 13:25:51 +0000 |
commit | 1356191ea0d1e161d6c80f08cd4d7435aef0180f (patch) | |
tree | d69ff14f39755444cfb0fd94dc78eecb6cb1885e /qadevOOo/tests | |
parent | 90a89b7d2eb1f8de4a5ab36fdba99142a0b9c7b4 (diff) |
INTEGRATION: CWS qadev25 (1.5.6); FILE MERGED
2005/11/21 14:42:11 sw 1.5.6.1: #114501# special for ScCellRanges
Diffstat (limited to 'qadevOOo/tests')
-rw-r--r-- | qadevOOo/tests/java/ifc/container/_XNameReplace.java | 63 |
1 files changed, 59 insertions, 4 deletions
diff --git a/qadevOOo/tests/java/ifc/container/_XNameReplace.java b/qadevOOo/tests/java/ifc/container/_XNameReplace.java index 960f8eda8f4d..79ede8c9c5aa 100644 --- a/qadevOOo/tests/java/ifc/container/_XNameReplace.java +++ b/qadevOOo/tests/java/ifc/container/_XNameReplace.java @@ -4,9 +4,9 @@ * * $RCSfile: _XNameReplace.java,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: rt $ $Date: 2005-09-08 23:23:13 $ + * last change: $Author: obo $ $Date: 2006-01-19 14:25:51 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -35,6 +35,7 @@ package ifc.container; +import com.sun.star.sheet.XCellRangeAddressable; import lib.MultiMethodTest; import util.ValueComparer; @@ -143,13 +144,24 @@ public class _XNameReplace extends MultiMethodTest { log.println("replace object '" + oNames[0] + "' with another instance"); oObj.replaceByName(oNames[0],oInstance); Object newEl = oObj.getByName(oNames[0]) ; - ok = ! ValueComparer.equalValue(old, newEl); + + if (tEnv.getTestCase().getObjectName().equals("ScCellRangesObj")) { + ok = compareRanges(old, newEl); + } else { + ok = ! ValueComparer.equalValue(old, newEl); + } result &= ok; log.println("result of replace: " + ok); log.println("replace back the old object"); oObj.replaceByName(oNames[0],old); Object origEl = oObj.getByName(oNames[0]) ; - ok = ValueComparer.equalValue(old, origEl); + + if (tEnv.getTestCase().getObjectName().equals("ScCellRangesObj")) { + ok = ! compareRanges(old, origEl); + } else { + ok = ValueComparer.equalValue(old, origEl); + } + result &= ok; log.println("result of replace back: " + ok); } catch (com.sun.star.lang.IllegalArgumentException e ) { @@ -174,6 +186,49 @@ public class _XNameReplace extends MultiMethodTest { disposeEnvironment() ; } + // method returns false if the ranges are equal and true otherwise + + private boolean compareRanges(Object old, Object newEl) { + XCellRangeAddressable xCRA = (XCellRangeAddressable) + UnoRuntime.queryInterface(XCellRangeAddressable.class,old); + + XCellRangeAddressable xCRA2 = (XCellRangeAddressable) + UnoRuntime.queryInterface(XCellRangeAddressable.class,newEl); + + int orgStartCol = xCRA.getRangeAddress().StartColumn; + int orgEndCol = xCRA.getRangeAddress().EndColumn; + int orgStartRow = xCRA.getRangeAddress().StartRow; + int orgEndRow = xCRA.getRangeAddress().EndRow; + + int newStartCol = xCRA2.getRangeAddress().StartColumn; + int newEndCol = xCRA2.getRangeAddress().EndColumn; + int newStartRow = xCRA2.getRangeAddress().StartRow; + int newEndRow = xCRA2.getRangeAddress().EndRow; + + boolean ret = true; + + if (orgStartCol == newStartCol) { + log.println("\t StartColumn is the same"); + ret = false; + } + + if (orgEndCol == newEndCol) { + log.println("\t EndColumn is the same"); + ret = false; + } + if (orgStartRow == newStartRow) { + log.println("\t StartRow is the same"); + ret = false; + } + + if (orgEndRow == newEndRow) { + log.println("\t EndRow is the same"); + ret = false; + } + + return ret; + } + } |