Kaydet (Commit) 6bf50c8d authored tarafından Daniel Bankston's avatar Daniel Bankston Kaydeden (comit) Kohei Yoshida

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
üst 99314cb0
......@@ -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);
}
......
......@@ -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
......
......@@ -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);
......
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