diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-01-24 20:24:46 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-01-25 13:19:20 +0100 |
commit | de7985809f5e01f274e5d7a946e431ae475ea1e7 (patch) | |
tree | 84ec2c95c3814c2b1854cc8633ed04cb000357b0 /sc | |
parent | 0ffe214cd51705f3e7ab464bb9f10ab173efa45a (diff) |
a few more fixes for cached value import
Change-Id: I2b6baedc8232811df1e5525bd2884b54db5a8f70
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/cell.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/formularesult.cxx | 7 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 4 |
4 files changed, 13 insertions, 4 deletions
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index 8df14f1d6353..0967e811ab46 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -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 diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx index 9602c44d05f7..791dbadcea86 100644 --- a/sc/source/core/tool/formularesult.cxx +++ b/sc/source/core/tool/formularesult.cxx @@ -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; diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index e93f33df2112..f3265cab55c8 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -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 ) { diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 84b5364112f4..79e7dd09fb0a 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -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); |