summaryrefslogtreecommitdiff
path: root/sc/source/filter/ftools/sharedformulagroups.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-09 15:44:59 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-11 12:14:24 -0400
commit0eabc71b59b97e51b8ee9630873dc8db3401f8f3 (patch)
tree7fef70b9262d91b306d91140081c9f6bf39a4a4f /sc/source/filter/ftools/sharedformulagroups.cxx
parent2f39c27be2bd66f149e0a4efdd7fa37daee43fb1 (diff)
Import shared formulas from xlsx without crashing.
The key here is to only use the shared formula ID's and ignore the ref range. The ref ranges are not correct half the time. Change-Id: If65f9b1b44ab6239db37977b6dfe3f822a9cf67e
Diffstat (limited to 'sc/source/filter/ftools/sharedformulagroups.cxx')
-rw-r--r--sc/source/filter/ftools/sharedformulagroups.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/sc/source/filter/ftools/sharedformulagroups.cxx b/sc/source/filter/ftools/sharedformulagroups.cxx
index 77da58782697..b80bdb50eb87 100644
--- a/sc/source/filter/ftools/sharedformulagroups.cxx
+++ b/sc/source/filter/ftools/sharedformulagroups.cxx
@@ -31,17 +31,28 @@ size_t SharedFormulaGroups::KeyHash::operator ()( const Key& rKey ) const
return static_cast<size_t>(nVal);
}
+void SharedFormulaGroups::set( size_t nSharedId, ScTokenArray* pArray )
+{
+ maStore.insert(nSharedId, pArray);
+}
+
void SharedFormulaGroups::set( size_t nSharedId, SCCOL nCol, const ScFormulaCellGroupRef& xGroup )
{
Key aKey(nSharedId, nCol);
- maStore.insert(StoreType::value_type(aKey, xGroup));
+ maColStore.insert(ColStoreType::value_type(aKey, xGroup));
+}
+
+const ScTokenArray* SharedFormulaGroups::get( size_t nSharedId ) const
+{
+ StoreType::const_iterator it = maStore.find(nSharedId);
+ return it == maStore.end() ? NULL : it->second;
}
ScFormulaCellGroupRef SharedFormulaGroups::get( size_t nSharedId, SCCOL nCol ) const
{
Key aKey(nSharedId, nCol);
- StoreType::const_iterator it = maStore.find(aKey);
- return it == maStore.end() ? ScFormulaCellGroupRef() : it->second;
+ ColStoreType::const_iterator it = maColStore.find(aKey);
+ return it == maColStore.end() ? ScFormulaCellGroupRef() : it->second;
}
}