mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
auto update the symbol DB with 0s in place of NULLs
This commit is contained in:
parent
3bb33b827e
commit
6a9c994878
@ -299,8 +299,14 @@ bool QgsStyleV2::load( QString filename )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure there are no Null fields in parenting symbols ang groups
|
||||||
|
char *query = sqlite3_mprintf( "UPDATE symbol SET groupid=0 WHERE groupid IS NULL;"
|
||||||
|
"UPDATE colorramp SET groupid=0 WHERE groupid IS NULL;"
|
||||||
|
"UPDATE symgroup SET parent=0 WHERE parent IS NULL;");
|
||||||
|
runEmptyQuery( query );
|
||||||
|
|
||||||
// First create all the main symbols
|
// First create all the main symbols
|
||||||
const char *query = "SELECT * FROM symbol";
|
query = sqlite3_mprintf( "SELECT * FROM symbol" );
|
||||||
|
|
||||||
sqlite3_stmt *ppStmt;
|
sqlite3_stmt *ppStmt;
|
||||||
int nError = sqlite3_prepare_v2( mCurrentDB, query, -1, &ppStmt, NULL );
|
int nError = sqlite3_prepare_v2( mCurrentDB, query, -1, &ppStmt, NULL );
|
||||||
@ -323,8 +329,8 @@ bool QgsStyleV2::load( QString filename )
|
|||||||
|
|
||||||
sqlite3_finalize( ppStmt );
|
sqlite3_finalize( ppStmt );
|
||||||
|
|
||||||
const char *rquery = "SELECT * FROM colorramp";
|
query = sqlite3_mprintf( "SELECT * FROM colorramp" );
|
||||||
nError = sqlite3_prepare_v2( mCurrentDB, rquery, -1, &ppStmt, NULL );
|
nError = sqlite3_prepare_v2( mCurrentDB, query, -1, &ppStmt, NULL );
|
||||||
while ( nError == SQLITE_OK && sqlite3_step( ppStmt ) == SQLITE_ROW )
|
while ( nError == SQLITE_OK && sqlite3_step( ppStmt ) == SQLITE_ROW )
|
||||||
{
|
{
|
||||||
QDomDocument doc;
|
QDomDocument doc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user