diff options
author | Stefan Knorr (astron) <heinzlesspam@gmail.com> | 2012-05-30 14:58:27 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-05-31 11:05:27 +0200 |
commit | e43966b29cc36ce36245cfb2c63c3e24a0eb523f (patch) | |
tree | aa296d630672782d2212ba35c96567f838eb18c3 | |
parent | 7e7d0f41a53471caac4cd155642b01aa54a5869d (diff) |
Fix up unit tests that assumed two or more sheets per default
11 files changed, 24 insertions, 3 deletions
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java index 7ef352c94d2a..d43b0209cf04 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java @@ -133,6 +133,8 @@ public class ScDataPilotFieldGroupItemObj extends TestCase XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface ( XIndexAccess.class, xSpreadsheets); + // Make sure there are at least two sheets + xSpreadsheets.insertNewByName("Some Sheet", (short)0); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java index 71a699175c85..d8c06172fe9d 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java @@ -132,6 +132,8 @@ public class ScDataPilotFieldGroupObj extends TestCase XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface ( XIndexAccess.class, xSpreadsheets); + // Make sure there are at least two sheets + xSpreadsheets.insertNewByName("Some Sheet", (short)0); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java index 152c1d82a09a..078414ba17c7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java @@ -132,6 +132,8 @@ public class ScDataPilotFieldGroupsObj extends TestCase XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface ( XIndexAccess.class, xSpreadsheets); + // Make sure there are at least two sheets + xSpreadsheets.insertNewByName("Some Sheet", (short)0); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java index c19e8dab3b36..0498741849b1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java @@ -154,6 +154,8 @@ public class ScDataPilotFieldObj extends TestCase { XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); + // Make sure there are at least two sheets + xSpreadsheets.insertNewByName("Some Sheet", (short)0); try { oSheet = (XSpreadsheet) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java index c50a32775416..bb8f1656ccbb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java @@ -155,6 +155,8 @@ public class ScDataPilotItemObj extends TestCase { XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); + // Make sure there are at least two sheets + xSpreadsheets.insertNewByName("Some Sheet", (short)0); try { oSheet = (XSpreadsheet) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java index ac9971b3c778..a7adb9a43574 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java @@ -155,6 +155,8 @@ public class ScDataPilotItemsObj extends TestCase { XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); + // Make sure there are at least two sheets + xSpreadsheets.insertNewByName("Some Sheet", (short)0); try { oSheet = (XSpreadsheet) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java index 5755966c0ed2..cedac1c45f72 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java @@ -157,6 +157,8 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); + // Make sure there are at least two sheets + xSpreadsheets.insertNewByName("Some Sheet", (short)0); try { oSheet = (XSpreadsheet) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java index b0931e5b973e..4f863bf7af04 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java @@ -142,7 +142,7 @@ public class XMLSettingsExporter extends TestCase { UnoRuntime.queryInterface(XPropertySet.class, xController); xPropSet.setPropertyValue("ShowGrid", "false"); - util.CalcTools.fillCalcSheetWithContent(xSheetDoc,1, 3, 3, 50, 50); + util.CalcTools.fillCalcSheetWithContent(xSheetDoc, 0, 3, 3, 50, 50); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java index 578c188073be..61000bde9d34 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java @@ -156,8 +156,8 @@ public class XMLStylesExporter extends TestCase { UnoRuntime.queryInterface(XStyle.class,SC); StyleFamilyName.insertByName(newName, StyleCell); - log.println("fill sheet 1 with contnet..."); - util.CalcTools.fillCalcSheetWithContent(xSheetDoc, 1, 3, 3, 50, 100); + log.println("fill sheet 1 with content..."); + util.CalcTools.fillCalcSheetWithContent(xSheetDoc, 0, 3, 3, 50, 100); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/sc/qa/complex/dataPilot/CheckDataPilot.java b/sc/qa/complex/dataPilot/CheckDataPilot.java index b042f259072e..45ae37311f78 100644 --- a/sc/qa/complex/dataPilot/CheckDataPilot.java +++ b/sc/qa/complex/dataPilot/CheckDataPilot.java @@ -211,6 +211,9 @@ public class CheckDataPilot { XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + // Per default there's now just one sheet, make sure we have at least two, then + xSpreadsheets.insertNewByName("Some Sheet", (short)0); + try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); diff --git a/sc/qa/complex/sc/CalcRTL.java b/sc/qa/complex/sc/CalcRTL.java index 0abeb8abfca0..389afecf5dd2 100644 --- a/sc/qa/complex/sc/CalcRTL.java +++ b/sc/qa/complex/sc/CalcRTL.java @@ -106,6 +106,10 @@ public class CalcRTL /* extends ComplexTestCase */ XPropertySet set = UnoRuntime.queryInterface( XPropertySet.class, getSpreadsheet()); + + // Make sure there are at least 2 sheets, otherwise hiding a sheet won't work + xSheetDoc.getSheets().insertNewByName("Some Sheet", (short)0); + assertTrue("Problems when setting property 'IsVisible'", changeProperty(set, "IsVisible", Boolean.FALSE)); assertTrue("Problems when setting property 'IsVisible'", |