diff options
-rw-r--r-- | sc/source/ui/namedlg/namedefdlg.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx index a9795d560a08..282c47a3a9b1 100644 --- a/sc/source/ui/namedlg/namedefdlg.cxx +++ b/sc/source/ui/namedlg/namedefdlg.cxx @@ -167,7 +167,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); |