From ed45c87896de74048708d51c050ecd42c9f4a0a0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 20 Oct 2014 21:08:54 +0200 Subject: sc: fix temp file leak in ScTableSheetsObj Change-Id: Iff838c97c1cf633f99e75a169eeb8bb324d4a32a --- test/source/sheet/xspreadsheets2.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx index aa010d375f59..17c5f01092d7 100644 --- a/test/source/sheet/xspreadsheets2.cxx +++ b/test/source/sheet/xspreadsheets2.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "cppunit/extensions/HelperMacros.h" @@ -48,6 +49,11 @@ XSpreadsheets2::XSpreadsheets2(): XSpreadsheets2::~XSpreadsheets2() { + if (xDestDoc.is()) + { + uno::Reference xCloseable(xDestDoc, UNO_QUERY_THROW); + xCloseable->close(true); + } } void XSpreadsheets2::testImportedSheetNameAndIndex() @@ -302,7 +308,7 @@ void XSpreadsheets2::importSheetToCopy() uno::Reference< container::XNameAccess> xSrcNameAccess(init(),UNO_QUERY_THROW); xSrcSheet = uno::Reference< sheet::XSpreadsheet >( xSrcNameAccess->getByName(aSrcSheetName), UNO_QUERY_THROW); - static uno::Reference< lang::XComponent > xDestComponent; + uno::Reference< lang::XComponent > xDestComponent; if (!xDestComponent.is()) { xDestDoc = getDoc(aDestFileBase, xDestComponent); -- cgit