summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@pardus.org.tr>2016-10-26 11:35:24 +0300
committerMuhammet Kara <muhammet.kara@pardus.org.tr>2016-10-27 09:25:59 +0000
commit0c2272786bc8663554ea7d4a72f03379e0d6608d (patch)
treeb624b498226a39932002c2eb5e97692beaae30d5
parent7195c7e8b80f0a875126e9275aa12e4608b1763c (diff)
tdf#103464 Don't allow empty names in SvxNameDialog
Menus, context menus, toolbars, toolbar items... could be created with empty names, and could be renamed to have empty names before this patch. Change-Id: Ic383f16955746002aa3ad69406bac855cdd58d2d Reviewed-on: https://gerrit.libreoffice.org/30286 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--cui/source/dialogs/dlgname.cxx5
-rw-r--r--cui/uiconfig/ui/namedialog.ui5
2 files changed, 7 insertions, 3 deletions
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index 88b768ad974e..cedbf7e14f6c 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -60,8 +60,11 @@ void SvxNameDialog::dispose()
IMPL_LINK_NOARG(SvxNameDialog, ModifyHdl, Edit&, void)
{
+ // Do not allow empty names
if(aCheckNameHdl.IsSet())
- pBtnOK->Enable(aCheckNameHdl.Call(*this));
+ pBtnOK->Enable(!pEdtName->GetText().isEmpty() && aCheckNameHdl.Call(*this));
+ else
+ pBtnOK->Enable(!pEdtName->GetText().isEmpty());
}
diff --git a/cui/uiconfig/ui/namedialog.ui b/cui/uiconfig/ui/namedialog.ui
index 4d7bef034e56..541b795f1a8a 100644
--- a/cui/uiconfig/ui/namedialog.ui
+++ b/cui/uiconfig/ui/namedialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="NameDialog">
@@ -20,6 +20,7 @@
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
@@ -80,10 +81,10 @@
<object class="GtkLabel" id="description_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="use_underline">True</property>
<property name="wrap">True</property>
<property name="mnemonic_widget">name_entry</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>