summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDaniel Bankston <daniel.e.bankston@gmail.com>2012-07-10 23:54:03 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-07-11 20:37:43 -0400
commit6bf50c8d50a599d820289831ec4175136882b0d4 (patch)
tree8812a0258b5e3c04290284c25823f21018a44233 /sc
parent99314cb07e009279a803799020534dde587ee1a5 (diff)
Always Recalc volatile formula cells in import
-Previous method was flawed. It actually works now. -Thanks to Kohei and Markus for helping me with this. -Thanks to Markus for finally coming up with the actual solution. Change-Id: Iad28da12c548c583df14ab7d71f4cee8ccc3552a
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/cell.cxx4
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx6
-rw-r--r--sc/source/ui/docshell/docsh.cxx2
3 files changed, 8 insertions, 4 deletions
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index c4846c092d25..6ab3d2d1c01a 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1099,6 +1099,10 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress )
// (for macro warning, CompileXML is called at the end of loading XML file)
if ( !pDocument->GetHasMacroFunc() && pCode->HasOpCodeRPN( ocMacro ) )
pDocument->SetHasMacroFunc( true );
+
+ //volatile cells must be added here for import
+ if( pCode->IsRecalcModeAlways() )
+ pDocument->PutInFormulaTree(this);
}
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index c1b7a8516c35..e3ab4167e652 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -749,8 +749,7 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const
pFCell->SetHybridString( *pOUTextValue );
else
pFCell->SetHybridDouble( fValue );
- if( !pFCell->GetCode()->IsRecalcModeAlways() )
- pFCell->ResetDirty();
+ pFCell->ResetDirty();
}
}
@@ -773,8 +772,7 @@ void ScXMLTableRowCellContext::AddTextCellToDoc( const ScAddress& rCurrentPos,
pFCell->SetHybridString( *pOUText );
else
bDoIncrement = false;
- if( !pFCell->GetCode()->IsRecalcModeAlways() )
- pFCell->ResetDirty();
+ pFCell->ResetDirty();
}
}
else
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 752367c2ce3f..5f7b82864006 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -437,6 +437,8 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un
rtl::OUString sGenerator(xDocProps->getGenerator());
if(sGenerator.indexOf(SC_LIBO_PROD_NAME) == -1)
DoHardRecalc(false);
+ else //still need to recalc volatile formula cells
+ DoRecalc(false);
aDocument.SetXMLFromWrapper( false );
AfterXMLLoading(bRet);