update dev300-m58
[ooovba.git] / applied_patches / 0180-calc-getpivotdata-force-interpret-formula.diff
blob5464780b4be43c3413051ac3e047760aeda7850d
1 diff --git sc/source/core/data/dpcachetable.cxx sc/source/core/data/dpcachetable.cxx
2 index a27c16d..5cb60ad 100644
3 --- sc/source/core/data/dpcachetable.cxx
4 +++ sc/source/core/data/dpcachetable.cxx
5 @@ -209,9 +209,39 @@ sal_Int32 ScDPCacheTable::getColSize() const
6 return maTable.empty() ? 0 : maTable[0].size();
9 +namespace {
11 +/**
12 + * While the macro interpret level is incremented, the formula cells are
13 + * (semi-)guaranteed to be interpreted.
14 + */
15 +class MacroInterpretIncrementer
17 +public:
18 + MacroInterpretIncrementer(ScDocument* pDoc) :
19 + mpDoc(pDoc)
20 + {
21 + mpDoc->IncMacroInterpretLevel();
22 + }
23 + ~MacroInterpretIncrementer()
24 + {
25 + mpDoc->DecMacroInterpretLevel();
26 + }
27 +private:
28 + ScDocument* mpDoc;
29 +};
33 void ScDPCacheTable::fillTable(ScDocument* pDoc, const ScRange& rRange, const ScQueryParam& rQuery, BOOL* pSpecial,
34 bool bIgnoreEmptyRows)
36 + // Make sure the formula cells within the data range are interpreted
37 + // during this call, for this method may be called from the interpretation
38 + // of GETPIVOTDATA, which disables nested formula interpretation without
39 + // an increased macro level.
40 + MacroInterpretIncrementer aMacroInc(pDoc);
42 SCTAB nTab = rRange.aStart.Tab();
43 SCCOL nStartCol = rRange.aStart.Col();
44 SCROW nStartRow = rRange.aStart.Row();