diff options
author | Eike Rathke <erack@redhat.com> | 2018-07-13 22:30:24 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-07-14 01:55:16 +0200 |
commit | 771149ac99a57c641caebdfc7dd6fac25c292682 (patch) | |
tree | 04019b80d653d86b8cb953ee94d60a47bd1a88d6 /sc | |
parent | 65b1990687ec261d10a96e58b9d476d4b23e11a0 (diff) |
Resolves: tdf#94925 do not unset dirty if formula cell must be recalculated
Change-Id: If70860b8babf1cce7fda2ae63412659e72dbb4c3
Reviewed-on: https://gerrit.libreoffice.org/57404
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/oox/formulabuffer.cxx | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index 9bec5335a599..53172729ac85 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -159,6 +159,11 @@ void applySharedFormulas( case XML_n: // numeric value. pCell->SetResultDouble(rDesc.maCellValue.toDouble()); + /* TODO: is it on purpose that we never reset dirty here + * and thus recalculate anyway if cell was dirty? Or is it + * never dirty and therefor set dirty below otherwise? This + * is different from the non-shared case in + * applyCellFormulaValues(). */ break; case XML_str: if (bGeneratorKnownGood) @@ -168,8 +173,11 @@ void applySharedFormulas( pCell->SetResultToken(new formula::FormulaStringToken(aSS)); // If we don't reset dirty, then e.g. disabling macros makes all cells // that use macro functions to show #VALUE! - pCell->ResetDirty(); - pCell->SetChanged(false); + if (!pCell->GetCode()->IsRecalcModeMustAfterImport()) + { + pCell->ResetDirty(); + pCell->SetChanged(false); + } break; } SAL_FALLTHROUGH; @@ -270,8 +278,11 @@ void applyCellFormulaValues( case XML_n: { pCell->SetResultDouble(rValueStr.toDouble()); - pCell->ResetDirty(); - pCell->SetChanged(false); + if (!pCell->GetCode()->IsRecalcModeMustAfterImport()) + { + pCell->ResetDirty(); + pCell->SetChanged(false); + } } break; case XML_str: @@ -289,8 +300,11 @@ void applyCellFormulaValues( { svl::SharedString aSS = rStrPool.intern(rValueStr); pCell->SetResultToken(new formula::FormulaStringToken(aSS)); - pCell->ResetDirty(); - pCell->SetChanged(false); + if (!pCell->GetCode()->IsRecalcModeMustAfterImport()) + { + pCell->ResetDirty(); + pCell->SetChanged(false); + } } break; default: |