Kaydet (Commit) da243552 authored tarafından Andras Timar's avatar Andras Timar

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/36679Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst b1cd3eeb
......@@ -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>
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment