[GRASS-SVN] r52079 - grass/trunk/vector/v.in.db

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 15 08:15:36 PDT 2012


Author: mlennert
Date: 2012-06-15 08:15:36 -0700 (Fri, 15 Jun 2012)
New Revision: 52079

Modified:
   grass/trunk/vector/v.in.db/main.c
Log:
applied indent script


Modified: grass/trunk/vector/v.in.db/main.c
===================================================================
--- grass/trunk/vector/v.in.db/main.c	2012-06-15 15:11:34 UTC (rev 52078)
+++ grass/trunk/vector/v.in.db/main.c	2012-06-15 15:15:36 UTC (rev 52079)
@@ -63,11 +63,11 @@
 
     driver_opt = G_define_standard_option(G_OPT_DB_DRIVER);
     driver_opt->options = db_list_drivers();
-    driver_opt->answer = (char *) db_get_default_driver_name();
+    driver_opt->answer = (char *)db_get_default_driver_name();
     driver_opt->guisection = _("Connection");
 
     database_opt = G_define_standard_option(G_OPT_DB_DATABASE);
-    database_opt->answer = (char *) db_get_default_database_name();
+    database_opt->answer = (char *)db_get_default_database_name();
     database_opt->guisection = _("Connection");
 
     xcol_opt = G_define_standard_option(G_OPT_DB_COLUMN);
@@ -97,7 +97,8 @@
     same_table_flag = G_define_flag();
     same_table_flag->key = 't';
     same_table_flag->guisection = _("Connection");
-    same_table_flag->description = _("Use imported table as attribute table for new map");
+    same_table_flag->description =
+	_("Use imported table as attribute table for new map");
 
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
@@ -177,7 +178,7 @@
     nrows = db_get_num_rows(&cursor);
 
     G_debug(2, "%d points selected", nrows);
-    
+
     count = 0;
     G_message(_("Writing features..."));
     while (db_fetch(&cursor, DB_NEXT, &more) == DB_OK && more) {
@@ -201,7 +202,7 @@
 	    else
 		coor[i] = db_get_value_double(value);
 	}
-	
+
 	Vect_reset_line(Points);
 	Vect_reset_cats(Cats);
 
@@ -220,26 +221,30 @@
     /* Copy table */
     G_message(_("Copying attributes..."));
     if (!same_table_flag->answer) {
-        if (where_opt->answer)
-	ret =
-	    db_copy_table_where(driver_opt->answer, database_opt->answer,
-				table_opt->answer, fi->driver, fi->database,
-				fi->table, where_opt->answer);
-    else
-	ret =
-	    db_copy_table(driver_opt->answer, database_opt->answer,
-			  table_opt->answer, fi->driver, fi->database,
-			  fi->table);
-    if (ret == DB_FAILED) {
-	G_warning(_("Unable to copy table"));
+	if (where_opt->answer)
+	    ret =
+		db_copy_table_where(driver_opt->answer, database_opt->answer,
+				    table_opt->answer, fi->driver,
+				    fi->database, fi->table,
+				    where_opt->answer);
+	else
+	    ret =
+		db_copy_table(driver_opt->answer, database_opt->answer,
+			      table_opt->answer, fi->driver, fi->database,
+			      fi->table);
+	if (ret == DB_FAILED) {
+	    G_warning(_("Unable to copy table"));
+	}
+	else {
+	    Vect_map_add_dblink(&Map, 1, NULL, fi->table, keycol_opt->answer,
+				fi->database, fi->driver);
+	}
     }
     else {
-	Vect_map_add_dblink(&Map, 1, NULL, fi->table, keycol_opt->answer,
-			    fi->database, fi->driver);
+	Vect_map_add_dblink(&Map, 1, NULL, table_opt->answer,
+			    keycol_opt->answer, database_opt->answer,
+			    driver_opt->answer);
     }
-    } else {
-        Vect_map_add_dblink(&Map, 1, NULL, table_opt->answer, keycol_opt->answer, database_opt->answer, driver_opt->answer);
-    }
 
     Vect_build(&Map);
     Vect_close(&Map);



More information about the grass-commit mailing list