Kaydet (Commit) 973406e4 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

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
üst 3dbc46d9
...@@ -81,7 +81,9 @@ uno::Reference<sheet::XCellRangesQuery> ScXCellRangesQuery::init() ...@@ -81,7 +81,9 @@ uno::Reference<sheet::XCellRangesQuery> ScXCellRangesQuery::init()
const rtl::OUString aFileBase(RTL_CONSTASCII_USTRINGPARAM("xcellrangesquery.ods")); const rtl::OUString aFileBase(RTL_CONSTASCII_USTRINGPARAM("xcellrangesquery.ods"));
createFileURL(aFileBase, aFileURL); createFileURL(aFileBase, aFileURL);
std::cout << rtl::OUStringToOString(aFileURL, RTL_TEXTENCODING_UTF8).getStr() << std::endl; 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< sheet::XSpreadsheetDocument> xDoc (xComponent, UNO_QUERY_THROW);
uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW);
uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(0), UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(0), UNO_QUERY_THROW);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment