[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - officecfg/registry sc/source
Andras Timar
andras.timar at collabora.com
Wed Apr 19 14:51:09 UTC 2017
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 7064978d0b02178586b55602af2f83eb9ffd4b98
Author: Andras Timar <andras.timar at 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/36680
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
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;
More information about the Libreoffice-commits
mailing list