summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 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;