summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-03-02 23:48:44 +0100
committerKohei Yoshida <kohei.yoshida@suse.com>2012-03-02 22:17:22 -0500
commitf4f0ef5790bd06145d977183da0ee244c5c46058 (patch)
treee6cc29806be2fa8f8ab653a5a3312cf8d452fb2b
parent61600b62068bf7837c532c8b32377984ee76af1e (diff)
don't show an error message for empty names in Define Names, fdo#46816
Signed-off-by: Kohei Yoshida <kohei.yoshida@suse.com>
-rw-r--r--sc/source/ui/namedlg/namedefdlg.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index 45c600bec33b..d060566cd3b8 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -166,7 +166,13 @@ bool ScNameDefDlg::IsNameValid()
}
maFtInfo.SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor());
- if (!ScRangeData::IsNameValid( aName, mpDoc ))
+ if ( aName.isEmpty() )
+ {
+ maBtnAdd.Disable();
+ maFtInfo.SetText(maStrInfoDefault);
+ return false;
+ }
+ else if (!ScRangeData::IsNameValid( aName, mpDoc ))
{
maFtInfo.SetControlBackground(GetSettings().GetStyleSettings().GetHighlightColor());
maFtInfo.SetText(maErrInvalidNameStr);