Kaydet (Commit) de798580 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

a few more fixes for cached value import

Change-Id: I2b6baedc8232811df1e5525bd2884b54db5a8f70
üst 0ffe214c
......@@ -1587,7 +1587,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
}
else
{
if ( eOld == svHybridCell ) // string result from SetFormulaResultString?
if ( eOld == svHybridCell || eOld == svHybridValueCell ) // string result from SetFormulaResultString?
eOld = svString; // ScHybridCellToken has a valid GetString method
// #i106045# use approxEqual to compare with stored value
......@@ -1612,7 +1612,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
if ( bChanged && !bContentChanged && pDocument->IsStreamValid(aPos.Tab()) )
{
if ( ( eOld == svUnknown && ( eNew == svError || ( eNew == svDouble && aNewResult.GetDouble() == 0.0 ) ) ) ||
( eOld == svHybridCell && eNew == svString && aResult.GetString() == aNewResult.GetString() ) ||
( (eOld == svHybridCell || eOld == svHybridValueCell) && eNew == svString && aResult.GetString() == aNewResult.GetString() ) ||
( eOld == svDouble && eNew == svDouble && rtl::math::approxEqual( aResult.GetDouble(), aNewResult.GetDouble() ) ) )
{
// no change, see above
......
......@@ -448,9 +448,16 @@ void ScFormulaResult::SetHybridFormula( const String & rFormula )
void ScFormulaResult::SetHybridValueString( double nVal, const OUString& rStr )
{
if(GetType() == formula::svMatrixCell)
{
SetDouble(nVal);
return;
}
ResetToDefaults();
if (mbToken && mpToken)
mpToken->DecRef();
mpToken = new ScHybridValueCellToken( nVal, rStr );
mpToken->IncRef();
mbToken = true;
......
......@@ -352,7 +352,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr
ScAddress aCellPos = rXMLImport.GetTables().GetCurrentCellPos();
if( ((nCellType == util::NumberFormat::TEXT) || pOUFormula) )
if( ((nCellType == util::NumberFormat::TEXT) || pOUFormula || bFormulaTextResult) )
{
if ( pOUFormula )
{
......
......@@ -470,8 +470,10 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un
if (bHardRecalc)
DoHardRecalc(false);
else
{
// still need to recalc volatile formula cells.
aDocument.CalcFormulaTree(false, true, false);
aDocument.Broadcast( SC_HINT_DATACHANGED, BCA_BRDCST_ALWAYS, NULL );
}
bool bAdjustHeightOld = aDocument.IsAdjustHeightEnabled();
aDocument.EnableAdjustHeight(false);
......
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