summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/cell.cxx4
-rw-r--r--sc/source/core/tool/formularesult.cxx7
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx4
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);