summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-30 21:46:21 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-30 23:48:14 +0100
commit973406e43989005c6ccd4f803a48ce344bb06d19 (patch)
tree4cbc7df182ee7d536e540a5f3fcbf863f4ff04c9 /sc/qa
parent3dbc46d99a14b56f27371d45736b11904a1f3dc8 (diff)
only load the testfile once and after that reuse the already loaded file
this is not perfect but better than loading the file several times while we should only call read-only methods
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/extras/xcellrangesquery.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/qa/extras/xcellrangesquery.cxx b/sc/qa/extras/xcellrangesquery.cxx
index 3d395d60ebf2..9fc9139d03ad 100644
--- a/sc/qa/extras/xcellrangesquery.cxx
+++ b/sc/qa/extras/xcellrangesquery.cxx
@@ -81,7 +81,9 @@ uno::Reference<sheet::XCellRangesQuery> ScXCellRangesQuery::init()
const rtl::OUString aFileBase(RTL_CONSTASCII_USTRINGPARAM("xcellrangesquery.ods"));
createFileURL(aFileBase, aFileURL);
std::cout << rtl::OUStringToOString(aFileURL, RTL_TEXTENCODING_UTF8).getStr() << std::endl;
- uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileURL);
+ static uno::Reference< lang::XComponent > xComponent;
+ if( !xComponent.is())
+ xComponent = loadFromDesktop(aFileURL);
uno::Reference< sheet::XSpreadsheetDocument> xDoc (xComponent, UNO_QUERY_THROW);
uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW);
uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(0), UNO_QUERY_THROW);