summaryrefslogtreecommitdiff
path: root/test/source/sheet
diff options
context:
space:
mode:
Diffstat (limited to 'test/source/sheet')
-rw-r--r--test/source/sheet/xspreadsheets2.cxx29
1 files changed, 10 insertions, 19 deletions
diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx
index cea68e1cfad9..ab3ef3e75688 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -275,13 +275,12 @@ void XSpreadsheets2::testImportCellStyle()
CPPUNIT_ASSERT_EQUAL_MESSAGE("New style: VertJustify not set", table::CellVertJustify_CENTER, static_cast<table::CellVertJustify>(aVertJustify));
}
-uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const OUString& aFileBase, uno::Reference< lang::XComponent >& xComp)
+uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const OUString& aFileBase)
{
OUString aFileURL;
createFileURL(aFileBase, aFileURL);
- if (!xComp.is())
- xComp = loadFromDesktop(aFileURL);
+ uno::Reference< lang::XComponent > xComp = loadFromDesktop(aFileURL);
CPPUNIT_ASSERT(xComp.is());
@@ -301,22 +300,14 @@ void XSpreadsheets2::importSheetToCopy()
uno::Reference< container::XNameAccess> xSrcNameAccess(init(),UNO_QUERY_THROW);
xSrcSheet.set( xSrcNameAccess->getByName(gaSrcSheetName), UNO_QUERY_THROW);
- uno::Reference< lang::XComponent > xDestComponent;
- if (!xDestComponent.is())
- {
- xDestDoc = getDoc(gaDestFileBase, xDestComponent);
- CPPUNIT_ASSERT(xDestDoc.is());
-
- // import sheet
- uno::Reference< sheet::XSpreadsheets2 > xDestSheets (xDestDoc->getSheets(), UNO_QUERY_THROW);
- sal_Int32 nDestPos = 0;
- sal_Int32 nDestPosEffective = xDestSheets->importSheet(xDocument, gaSrcSheetName, nDestPos);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong sheet index", nDestPosEffective, nDestPos);
- }
- else
- {
- xDestDoc.set(xDestComponent,UNO_QUERY_THROW);
- }
+ xDestDoc = getDoc(gaDestFileBase);
+ CPPUNIT_ASSERT(xDestDoc.is());
+
+ // import sheet
+ uno::Reference< sheet::XSpreadsheets2 > xDestSheets (xDestDoc->getSheets(), UNO_QUERY_THROW);
+ sal_Int32 nDestPos = 0;
+ sal_Int32 nDestPosEffective = xDestSheets->importSheet(xDocument, gaSrcSheetName, nDestPos);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong sheet index", nDestPosEffective, nDestPos);
uno::Reference< container::XNameAccess > xDestSheetNameAccess (xDestDoc->getSheets(), UNO_QUERY_THROW);
xDestSheet.set( xDestSheetNameAccess->getByName(gaSrcSheetName), UNO_QUERY_THROW);