diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-09-20 17:08:08 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-09-20 17:12:46 -0400 |
commit | 665d1011950dc41d9a7f8e95596d5e1d5d99ff63 (patch) | |
tree | bf96341b70d2e928d6a8062a52eac03945c9479f /oox | |
parent | 7dff26aa099aa97c7bfc03806ba8160a9d7e945c (diff) |
Get DB range import from xlsx to work once again.
We need to map Excel's database ranges (or in Excel's terminology
"tables") to named db ranges because they may be referenced in formula
expressions. Also, Excel tables are always of the form Table*[] when
used in formulas. Skip the "[]" part then the preceding token is a
valid database range.
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/xls/tablebuffer.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx index d3390204bce7..cc6647ab6e52 100644 --- a/oox/source/xls/tablebuffer.cxx +++ b/oox/source/xls/tablebuffer.cxx @@ -90,11 +90,15 @@ void Table::importTable( SequenceInputStream& rStrm, sal_Int16 nSheet ) void Table::finalizeImport() { - // create database range + // Create database range. Note that Excel 2007 and later names database + // ranges (or tables in their terminology) as Table1, Table2 etc. We need + // to import them as named db ranges because they may be referenced by + // name in formula expressions. if( (maModel.mnId > 0) && (maModel.maDisplayName.getLength() > 0) ) try { maDBRangeName = maModel.maDisplayName; - Reference< XDatabaseRange > xDatabaseRange( createUnnamedDatabaseRangeObject( maModel.maRange ), UNO_SET_THROW ); + Reference< XDatabaseRange > xDatabaseRange( + createDatabaseRangeObject( maDBRangeName, maModel.maRange ), UNO_SET_THROW); maDestRange = xDatabaseRange->getDataArea(); // get formula token index of the database range |