summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2009-10-15 19:15:11 -0400
committerKohei Yoshida <kyoshida@novell.com>2009-10-15 19:15:11 -0400
commite9bac9b0f903964a4b307c08aeca12eaf814e953 (patch)
treef7ab06ff7650f44b7cf767f0aef7e1000428b800 /sc/source/core/data
parentd73a13fb31ee3abb61ee737264c7a540f75c7f4f (diff)
#i105940# When populating the cache table, increase the macro level to ensure that formula cells are interpreted properly.
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/dpcachetable.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/sc/source/core/data/dpcachetable.cxx b/sc/source/core/data/dpcachetable.cxx
index fd81c2619..e4fac9ee1 100644
--- a/sc/source/core/data/dpcachetable.cxx
+++ b/sc/source/core/data/dpcachetable.cxx
@@ -210,9 +210,39 @@ sal_Int32 ScDPCacheTable::getColSize() const
return maTable.empty() ? 0 : maTable[0].size();
}
+namespace {
+
+/**
+ * While the macro interpret level is incremented, the formula cells are
+ * (semi-)guaranteed to be interpreted.
+ */
+class MacroInterpretIncrementer
+{
+public:
+ MacroInterpretIncrementer(ScDocument* pDoc) :
+ mpDoc(pDoc)
+ {
+ mpDoc->IncMacroInterpretLevel();
+ }
+ ~MacroInterpretIncrementer()
+ {
+ mpDoc->DecMacroInterpretLevel();
+ }
+private:
+ ScDocument* mpDoc;
+};
+
+}
+
void ScDPCacheTable::fillTable(ScDocument* pDoc, const ScRange& rRange, const ScQueryParam& rQuery, BOOL* pSpecial,
bool bIgnoreEmptyRows)
{
+ // Make sure the formula cells within the data range are interpreted
+ // during this call, for this method may be called from the interpretation
+ // of GETPIVOTDATA, which disables nested formula interpretation without
+ // increasing the macro level.
+ MacroInterpretIncrementer aMacroInc(pDoc);
+
SCTAB nTab = rRange.aStart.Tab();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();