#i105940# When populating the cache table, increase the macro level to ensure that formula cells are interpreted properly.
This commit is contained in:
parent
e696628056
commit
a2a12327bb
1 changed files with 30 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue