diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-10-20 21:08:54 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-10-21 15:06:41 +0200 |
commit | ed45c87896de74048708d51c050ecd42c9f4a0a0 (patch) | |
tree | 7cb3ed6523a3dece9ad0f5143c6d74e87cd52f2c /test/source | |
parent | sc: remove duplicate test methods from ScTableSheetsObj (diff) | |
download | core-ed45c87896de74048708d51c050ecd42c9f4a0a0.tar.gz core-ed45c87896de74048708d51c050ecd42c9f4a0a0.zip |
sc: fix temp file leak in ScTableSheetsObj
Change-Id: Iff838c97c1cf633f99e75a169eeb8bb324d4a32a
Diffstat (limited to 'test/source')
-rw-r--r-- | test/source/sheet/xspreadsheets2.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
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 <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/table/CellVertJustify.hpp> +#include <com/sun/star/util/XCloseable.hpp> #include <rtl/ustring.hxx> #include "cppunit/extensions/HelperMacros.h" @@ -48,6 +49,11 @@ XSpreadsheets2::XSpreadsheets2(): XSpreadsheets2::~XSpreadsheets2() { + if (xDestDoc.is()) + { + uno::Reference<util::XCloseable> 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); |