]> git.street.me.uk Git - andy/viking.git/blobdiff - src/clipboard.c
Really empty GPS realtime layers.
[andy/viking.git] / src / clipboard.c
index 5c283b67b47f165cac26e813fa8f48ec1bc6548d..64471379ace52b98e3d11de84d22294c54253516 100644 (file)
@@ -163,6 +163,10 @@ static gboolean clip_parse_latlon ( const gchar *text, struct LatLon *coord )
         s[i+2] = ' ';
       }
     }
+    if ( g_ascii_iscntrl (s[i]) ) {
+      // Replace any control characters (i.e. mainly for tabs) with a space
+      s[i] = ' ';
+    }
   }
 
   /* now try reading coordinates */
@@ -387,7 +391,8 @@ void a_clipboard_copy_selected ( VikLayersPanel *vlp )
   if ( ! sel )
     return;
 
-  vik_treeview_get_selected_iter ( sel->vt, &iter );
+  if ( !vik_treeview_get_selected_iter ( sel->vt, &iter ) )
+    return;
   layer_type = sel->type;
 
   // Since we intercept copy and paste keyboard operations, this is called even when a cell is being edited