diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-04-29 12:26:16 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-04-29 12:28:08 -0400 |
commit | 0d0fe4085479d0425f7402a3cf478d7f5f9e3aab (patch) | |
tree | 9da82fe6ded7a371edabb5d65b52619433e39ead /sc/inc | |
parent | fb2ffa4384c138acfb44e73b4bfa2c4ee81992c9 (diff) |
Manage data caches for named range data source separately.
Without this, updating the named range and refreshing would fail to
remove the old cache, which is no longer referenced. Very bad for
memory footprint.
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/dpobject.hxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index b796221cd..5769303aa 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -274,6 +274,20 @@ public: }; /** + * Data caches for range name based source data. + */ + class NameCaches + { + typedef ::boost::ptr_map<rtl::OUString, ScDPCache> CachesType; + CachesType maCaches; + ScDocument* mpDoc; + public: + NameCaches(ScDocument* pDoc); + const ScDPCache* getCache(const ::rtl::OUString& rName, const ScRange& rRange); + void removeCache(const ::rtl::OUString& rName); + }; + + /** * Defines connection type to external data source. Used as a key to look * up database cache. */ @@ -333,6 +347,7 @@ public: bool HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const; SheetCaches& GetSheetCaches(); + NameCaches& GetNameCaches(); DBCaches& GetDBCaches(); private: @@ -341,6 +356,7 @@ private: ScDocument* pDoc; TablesType maTables; SheetCaches maSheetCaches; + NameCaches maNameCaches; DBCaches maDBCaches; }; |