summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2017-04-19 13:29:21 +0200
committerAndras Timar <andras.timar@collabora.com>2017-04-19 16:50:43 +0200
commit7064978d0b02178586b55602af2f83eb9ffd4b98 (patch)
tree861d5cdbd959ea8b4e990cb56f3540e788ac9168
parent68e50768b7f24f12c52a0eb3da0892d4eb39635a (diff)
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/36680 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Calc.xcs20
-rw-r--r--sc/source/ui/view/viewfun2.cxx10
2 files changed, 27 insertions, 3 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index d6426a3da049..72fc022484fd 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1811,6 +1811,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 ee8f6f7e854a..4b3e0334edda 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;
@@ -1085,11 +1087,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();
@@ -1102,7 +1105,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;