From 08ad6f55a7bc29b865756fe8f328b61628355519 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 29 Apr 2011 12:26:16 -0400 Subject: 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. --- sc/inc/dpobject.hxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'sc/inc/dpobject.hxx') diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 9972e0c1198f..30ca8406d11e 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -273,6 +273,20 @@ public: void removeCache(const ScRange& rRange); }; + /** + * Data caches for range name based source data. + */ + class NameCaches + { + typedef ::boost::ptr_map 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; }; -- cgit