Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3625
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/25/3625/1
show formula results of new formulas even if auto calc is disabled
This change might cost us a bit of performance in large sheets but
finally makes it possible to effectively work in sheets where auto calc
is disabled as we now don't only show an empty cell for new cells with
formulas.
It also fixes a problem with errors in matrix formulas during cached
value import where we were calling ScFormulaCell::Interpret while the
cell still was not compiled and therefore resetting the dirty flag.
Change-Id: I10abb477d2384a4a3b83a58f3a81b6de582b435f
---
M sc/source/core/data/formulacell.cxx
M sc/source/ui/docshell/docsh4.cxx
M sc/source/ui/unoobj/confuno.cxx
M sc/source/ui/unoobj/docuno.cxx
4 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index ab70344..4485073 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1569,7 +1569,8 @@
void ScFormulaCell::SetDirtyVar()
{
- bDirty = true;
+ if(pDocument->GetAutoCalc())
+ bDirty = true;
// mark the sheet of this cell to be calculated
//#FIXME do we need to revert this remnant of old fake vba events?
pDocument->AddCalculateTable( aPos.Tab() );
}
@@ -1689,11 +1690,10 @@
void ScFormulaCell::MaybeInterpret()
{
- if (!IsDirtyOrInTableOpDirty())
+ if (!IsDirtyOrInTableOpDirty() || pDocument->IsImportingXML())
return;
- if (pDocument->GetAutoCalc() || (cMatrixFlag != MM_NONE))
- Interpret();
+ Interpret();
}
bool ScFormulaCell::IsHyperLinkCell() const
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 9bc4a40..7eb66cb 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -393,7 +393,10 @@
bNewVal = ((const SfxBoolItem*)pItem)->GetValue();
else
bNewVal = !aDocument.GetAutoCalc(); // Toggle fuer Menue
+ bool bOldVal = aDocument.GetAutoCalc();
aDocument.SetAutoCalc( bNewVal );
+ if( !bOldVal && bNewVal)
+ DoHardRecalc(false);
SetDocumentModified();
if (pBindings)
{
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index d72a9c3..c025f0e 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -168,7 +168,12 @@
else if ( aPropertyName.compareToAscii( SC_UNO_OUTLSYMB ) == 0 )
aViewOpt.SetOption(VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
else if ( aPropertyName.compareToAscii( SC_UNO_AUTOCALC ) == 0 )
+ {
+ bool bOldAutoCalc = pDoc->GetAutoCalc();
pDoc->SetAutoCalc( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ if(!bOldAutoCalc && ScUnoHelpFunctions::GetBoolFromAny( aValue ))
+ pDocShell->DoHardRecalc(true);
+ }
else if ( aPropertyName.compareToAscii( SC_UNO_PRINTERNAME ) == 0 )
{
OUString sPrinterName;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 4f66cca..1c21bcb 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1403,6 +1403,8 @@
if ( pDoc->GetAutoCalc() != bEnabled )
{
pDoc->SetAutoCalc( bEnabled );
+ if(bEnabled)
+ pDocShell->DoHardRecalc(true);
pDocShell->SetDocumentModified();
}
}
--
To view, visit https://gerrit.libreoffice.org/3625
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I10abb477d2384a4a3b83a58f3a81b6de582b435f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Markus Mohrhard <markus.mohrhard@googlemail.com>
Context
- [PATCH] show formula results of new formulas even if auto calc is di... · Markus Mohrhard (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.