summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2009-09-22 14:32:03 -0400
committerKohei Yoshida <kyoshida@novell.com>2009-09-22 14:37:03 -0400
commit9438312bf6d71dbc078d904f215f0ae20e4c779d (patch)
treef135176e0e305b65182161d5e28abd7bc5576e37
parent31b34ad1577bc89f7b074a04bb40a2ffd1f74007 (diff)
[experimental] Force-interpret formula cell results when filling cache tables.
* patches/dev300/apply: add this new patch. * patches/dev300/calc-getpivotdata-force-interpret-formula.diff: force-interpret formula cell results within the data range when the cache table is being populated as part of a GETPIVOTDATA interpretation, by incrementing the macro interpret level. (n#540563)
-rw-r--r--patches/dev300/apply5
-rw-r--r--patches/dev300/calc-getpivotdata-force-interpret-formula.diff44
2 files changed, 49 insertions, 0 deletions
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 8e3272673..a87cdb21f 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3412,6 +3412,11 @@ calc-html-csv-import-force-text-cell.diff, n#523414, i#103939, kohei
# When finding or replacing cell contents, skip filtered cells.
calc-find-replace-skip-filtered.diff, n#539282, kohei
+# When the cache table is being populated as part of the GETPIVOTDATA call,
+# force-interpret formula cell results.
+calc-getpivotdata-force-interpret-formula.diff, n#540563, kohei
+
+
[ AutoLayout ]
sd-layoutcode.diff, cocofan
offapi-layoutcode.diff, cocofan
diff --git a/patches/dev300/calc-getpivotdata-force-interpret-formula.diff b/patches/dev300/calc-getpivotdata-force-interpret-formula.diff
new file mode 100644
index 000000000..5464780b4
--- /dev/null
+++ b/patches/dev300/calc-getpivotdata-force-interpret-formula.diff
@@ -0,0 +1,44 @@
+diff --git sc/source/core/data/dpcachetable.cxx sc/source/core/data/dpcachetable.cxx
+index a27c16d..5cb60ad 100644
+--- sc/source/core/data/dpcachetable.cxx
++++ sc/source/core/data/dpcachetable.cxx
+@@ -209,9 +209,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
++ // an increased macro level.
++ MacroInterpretIncrementer aMacroInc(pDoc);
++
+ SCTAB nTab = rRange.aStart.Tab();
+ SCCOL nStartCol = rRange.aStart.Col();
+ SCROW nStartRow = rRange.aStart.Row();