Kaydet (Commit) 99e46c63 authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

CWS-TOOLING: integrate CWS calcautocrash

...@@ -183,39 +183,9 @@ sal_Int32 ScDPCacheTable::getColSize() const ...@@ -183,39 +183,9 @@ sal_Int32 ScDPCacheTable::getColSize() const
return GetCache()->GetColumnCount(); return GetCache()->GetColumnCount();
} }
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( const ScQueryParam& rQuery, BOOL* pSpecial, void ScDPCacheTable::fillTable( const ScQueryParam& rQuery, BOOL* pSpecial,
bool bIgnoreEmptyRows, bool bRepeatIfEmpty ) bool bIgnoreEmptyRows, bool bRepeatIfEmpty )
{ {
// 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(GetCache()->GetDoc());
if ( mpCache == NULL ) if ( mpCache == NULL )
InitNoneCache( NULL ); InitNoneCache( NULL );
//check cache //check cache
......
...@@ -304,7 +304,7 @@ void ScDPItemData::dump() const ...@@ -304,7 +304,7 @@ void ScDPItemData::dump() const
DBG_TRACE1( "Numberformat= %o", nNumFormat ); DBG_TRACE1( "Numberformat= %o", nNumFormat );
DBG_TRACESTR(aString ); DBG_TRACESTR(aString );
DBG_TRACE1( "fValue= %f", fValue ); DBG_TRACE1( "fValue= %f", fValue );
DBG_TRACE1( "bHasValue= %d", bHasValue ? 1:0); DBG_TRACE1( "mbFlag= %d", mbFlag);
} }
#endif #endif
//End //End
...@@ -488,9 +488,41 @@ bool ScDPTableDataCache::IsValid() const ...@@ -488,9 +488,41 @@ bool ScDPTableDataCache::IsValid() const
return mpTableDataValues!=NULL && mpSourceData!= NULL && mnColumnCount>0; return mpTableDataValues!=NULL && mpSourceData!= NULL && mnColumnCount>0;
} }
// -----------------------------------------------------------------------
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;
};
}
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
bool ScDPTableDataCache::InitFromDoc( ScDocument* pDoc, const ScRange& rRange ) bool ScDPTableDataCache::InitFromDoc( ScDocument* pDoc, const ScRange& rRange )
{ {
// 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);
// //
SCROW nStartRow = rRange.aStart.Row(); // start of data SCROW nStartRow = rRange.aStart.Row(); // start of data
SCROW nEndRow = rRange.aEnd.Row(); SCROW nEndRow = rRange.aEnd.Row();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment