src/waypoint_gui.cpp
changeset 10148 ad8e8a65f6a2
parent 10145 849ba8b8626b
--- a/src/waypoint_gui.cpp	Mon Sep 15 18:50:48 2008 +0000
+++ b/src/waypoint_gui.cpp	Mon Sep 15 19:02:50 2008 +0000
@@ -74,7 +74,7 @@
 
 			case WAYPVW_RENAME: /* rename */
 				SetDParam(0, this->wp->index);
-				ShowQueryString(STR_WAYPOINT_RAW, STR_EDIT_WAYPOINT_NAME, MAX_LENGTH_WAYPOINT_NAME_BYTES, MAX_LENGTH_WAYPOINT_NAME_PIXELS, this, CS_ALPHANUMERAL, QSF_NONE);
+				ShowQueryString(STR_WAYPOINT_RAW, STR_EDIT_WAYPOINT_NAME, MAX_LENGTH_WAYPOINT_NAME_BYTES, MAX_LENGTH_WAYPOINT_NAME_PIXELS, this, CS_ALPHANUMERAL, QSF_ENABLE_DEFAULT);
 				break;
 
 			case WAYPVW_SHOW_TRAINS: /* show list of trains having this waypoint in their orders*/
@@ -92,10 +92,10 @@
 
 	virtual void OnQueryTextFinished(char *str)
 	{
-		if (!StrEmpty(str)) {
-			_cmd_text = str;
-			DoCommandP(0, this->window_number, 0, NULL, CMD_RENAME_WAYPOINT | CMD_MSG(STR_CANT_CHANGE_WAYPOINT_NAME));
-		}
+		if (str == NULL) return;
+
+		_cmd_text = str;
+		DoCommandP(0, this->window_number, 0, NULL, CMD_RENAME_WAYPOINT | CMD_MSG(STR_CANT_CHANGE_WAYPOINT_NAME));
 	}
 
 };