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