[Libreoffice-commits] .: Branch 'libreoffice-4-0' - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 20 11:50:25 PST 2012


 sc/source/filter/oox/workbookfragment.cxx |    4 ++--
 sc/source/ui/docshell/docsh.cxx           |   15 +++++++++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 3cbf1ced422d56e8a89e36cada8f1988b0e8d453
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Dec 20 14:50:36 2012 -0500

    Forgot to add checkbox to the dialog & saving the option when checked.
    
    Also remove a printf statement.
    
    Change-Id: I29c89a19f0c75b21f912d12903d1fceea535a6c7

diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index ba74b96..ba0c2fd 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -335,20 +335,20 @@ void WorkbookFragment::finalizeImport()
                 ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
             aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
 
-            boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
             sal_Int32 nRet = aBox.Execute();
             bHardRecalc = nRet == RET_YES;
 
             if (aBox.GetCheckBoxState())
             {
                 // Always perform selected action in the future.
+                boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
                 officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::set(sal_Int32(0), batch);
                 ScFormulaOptions aOpt = SC_MOD()->GetFormulaOptions();
                 aOpt.SetOOXMLRecalcOptions(bHardRecalc ? RECALC_ALWAYS : RECALC_NEVER);
                 SC_MOD()->SetFormulaOptions(aOpt);
 
+                batch->commit();
             }
-            batch->commit();
         }
     }
     else if (nRecalcMode == RECALC_ALWAYS)
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 0a5b488..291f5e0 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -442,15 +442,26 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un
             QueryBox aBox(
                 GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
                 ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS));
+            aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
 
             bHardRecalc = aBox.Execute() == RET_YES;
+
+            if (aBox.GetCheckBoxState())
+            {
+                // Always perform selected action in the future.
+                boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
+                officecfg::Office::Calc::Formula::Load::ODFRecalcMode::set(sal_Int32(0), batch);
+                ScFormulaOptions aOpt = SC_MOD()->GetFormulaOptions();
+                aOpt.SetODFRecalcOptions(bHardRecalc ? RECALC_ALWAYS : RECALC_NEVER);
+                SC_MOD()->SetFormulaOptions(aOpt);
+
+                batch->commit();
+            }
         }
     }
     else if (nRecalcMode == RECALC_ALWAYS)
         bHardRecalc = true;
 
-    fprintf(stdout, "ScDocShell::LoadXML:   hard recalc = %d\n", bHardRecalc);
-
     if (bHardRecalc)
         DoHardRecalc(false);
     else


More information about the Libreoffice-commits mailing list