officecfg/registry/schema/org/openoffice/Office/Calc.xcs |   20 +++++++++++++++
 sc/source/ui/view/viewfun2.cxx                           |   10 +++++--
 2 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit da24355234ec12f2f4c652113dbbb1216ba5492c
Author: Andras Timar <andras.ti...@collabora.com>
Date:   Wed Apr 19 13:29:21 2017 +0200

    Settings for not showing Merge Cells dialog and for emptying hidden cells
    
    By default nothing changes. But users have the possibility to avoid the
    confusing (?) Merge Cell dialog. Also, when the dialog is disabled, users
    may want to set the EmptyMergedCells to true, to mimic Excel's behaviour.
    
    Change-Id: I9656ae59199bb697c45786dd478379f5c89eb08f
    Reviewed-on: https://gerrit.libreoffice.org/36679
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index f03fcae1e147..86d3525d8689 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1865,6 +1865,26 @@
       <info>
         <desc>Contains various compatibility settings.</desc>
       </info>
+      <group oor:name="MergeCells">
+        <info>
+          <desc>Contains settings for merging cells.</desc>
+          <label>Merge cells</label>
+        </info>
+        <prop oor:name="ShowDialog" oor:type="xs:boolean" oor:nillable="false">
+          <info>
+            <desc>Specifies whether the Merge Cells dialog box is shown, when 
some cells are not empty.</desc>
+            <label>Show Merge Cells dialog</label>
+          </info>
+          <value>true</value>
+        </prop>
+        <prop oor:name="EmptyMergedCells" oor:type="xs:boolean" 
oor:nillable="false">
+          <info>
+            <desc>Specifies whether to empty the contents of the hidden cells 
(like Excel does).</desc>
+            <label>Empty merged cells</label>
+          </info>
+          <value>false</value>
+        </prop>
+      </group>
       <group oor:name="KeyBindings">
         <info>
           <desc>Contains options related to key bindings</desc>
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index b7ee8dd55eb6..59609fbebfe0 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -92,6 +92,8 @@
 #include <memory>
 #include <boost/property_tree/json_parser.hpp>
 
+#include <officecfg/Office/Calc.hxx>
+
 using namespace com::sun::star;
 using ::editeng::SvxBorderLine;
 
@@ -1096,11 +1098,12 @@ bool ScViewFunc::MergeCells( bool bApi, bool& 
rDoContents, bool bCenter )
     }
 
     bool bOk = true;
-    bool bEmptyMergedCells = false;
+    bool bEmptyMergedCells = 
officecfg::Office::Calc::Compatibility::MergeCells::EmptyMergedCells::get();
 
     if (bAskDialog)
     {
-        if (!bApi)
+        bool bShowDialog = 
officecfg::Office::Calc::Compatibility::MergeCells::ShowDialog::get();
+        if (!bApi && bShowDialog)
         {
             VclPtr<ScMergeCellsDialog> aBox = 
VclPtr<ScMergeCellsDialog>::Create( GetViewData().GetDialogParent() );
             sal_uInt16 nRetVal = aBox->Execute();
@@ -1113,7 +1116,8 @@ bool ScViewFunc::MergeCells( bool bApi, bool& 
rDoContents, bool bCenter )
                         rDoContents = true;
                         break;
                     case KeepContentHiddenCells:
-                        break; // keep default values
+                        bEmptyMergedCells = false;
+                        break;
                     case EmptyContentHiddenCells:
                         bEmptyMergedCells = true;
                         break;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to