summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-01-12 15:22:32 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-01-12 21:51:52 -0500
commite6392d2a17c0bee792cfd0060d177e5c6a71f346 (patch)
tree165500a9aaeccde156400f00132df912af93d75e /sc/inc
parent29cfe42f6473fa2e7351f98d5f3480ffbd9904fe (diff)
fdo#43077: Now, refreshing a table should refresh all linked tables.
For efficiency reasons. Otherwise, refreshing n tables individually would require reloading the same data cache n times.
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/dpobject.hxx11
-rw-r--r--sc/inc/dptablecache.hxx3
2 files changed, 12 insertions, 2 deletions
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 769e0ac234e4..5010e69c1b26 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -37,6 +37,8 @@
#include "pivot.hxx"
#include <com/sun/star/sheet/XDimensionsSupplier.hpp>
+#include <set>
+
#include <boost/ptr_container/ptr_list.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/ptr_container/ptr_map.hpp>
@@ -273,6 +275,7 @@ public:
UpdateRefMode eMode, const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz);
private:
+ void updateCache(const ScRange& rRange, std::set<ScDPObject*>& rRefs);
void removeCache(const ScRange& rRange);
};
@@ -290,6 +293,7 @@ public:
bool hasCache(const rtl::OUString& rName) const;
const ScDPCache* getCache(const ::rtl::OUString& rName, const ScRange& rRange);
private:
+ void updateCache(const rtl::OUString& rName, const ScRange& rRange, std::set<ScDPObject*>& rRefs);
void removeCache(const ::rtl::OUString& rName);
};
@@ -323,6 +327,11 @@ public:
DBCaches(ScDocument* pDoc);
const ScDPCache* getCache(sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const ::rtl::OUString& rCommand);
private:
+ com::sun::star::uno::Reference<com::sun::star::sdbc::XRowSet> createRowSet(
+ sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const ::rtl::OUString& rCommand);
+
+ void updateCache(sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const ::rtl::OUString& rCommand,
+ std::set<ScDPObject*>& rRefs);
void removeCache(sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const ::rtl::OUString& rCommand);
};
@@ -330,7 +339,7 @@ public:
ScDPCollection(const ScDPCollection& r);
~ScDPCollection();
- sal_uLong ClearCache(ScDPObject* pDPObj);
+ sal_uLong ReloadCache(ScDPObject* pDPObj, std::set<ScDPObject*>& rRefs);
SC_DLLPUBLIC size_t GetCount() const;
SC_DLLPUBLIC ScDPObject* operator[](size_t nIndex);
diff --git a/sc/inc/dptablecache.hxx b/sc/inc/dptablecache.hxx
index a67103d0f788..882f42293064 100644
--- a/sc/inc/dptablecache.hxx
+++ b/sc/inc/dptablecache.hxx
@@ -50,10 +50,10 @@ class SC_DLLPUBLIC ScDPCache
{
public:
typedef ::boost::ptr_vector<ScDPItemData> DataListType;
+ typedef std::set<ScDPObject*> ObjectSetType;
private:
typedef ::boost::ptr_vector<DataListType> DataGridType;
typedef ::boost::ptr_vector< ::std::vector<SCROW> > RowGridType;
- typedef std::set<ScDPObject*> ObjectSetType;
ScDocument* mpDoc;
long mnColumnCount;
@@ -96,6 +96,7 @@ private:
public:
void AddReference(ScDPObject* pObj) const;
void RemoveReference(ScDPObject* pObj) const;
+ const ObjectSetType& GetAllReferences() const;
SCROW GetIdByItemData( long nDim, const String& sItemData ) const;
SCROW GetIdByItemData( long nDim, const ScDPItemData& rData ) const;