[Libreoffice-commits] core.git: cui/source cui/uiconfig

Muhammet Kara muhammet.kara at pardus.org.tr
Thu Oct 27 09:26:20 UTC 2016


 cui/source/dialogs/dlgname.cxx |    5 ++++-
 cui/uiconfig/ui/namedialog.ui  |    5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 0c2272786bc8663554ea7d4a72f03379e0d6608d
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date:   Wed Oct 26 11:35:24 2016 +0300

    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 at cib.de>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index 88b768a..cedbf7e 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 4d7bef0..541b795 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>


More information about the Libreoffice-commits mailing list