Skip to content

Commit 2ab844a

Browse files
committedAug 31, 2012
fix db handling when modifying existing color ramp (#6229)
1 parent 4b4ac5a commit 2ab844a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

‎resources/symbology-ng-style.db

1 KB
Binary file not shown.

‎scripts/symbol_xml2db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
_colorramp = "CREATE TABLE colorramp("\
3838
"id INTEGER PRIMARY KEY,"\
39-
"name TEXT,"\
39+
"name TEXT UNIQUE,"\
4040
"xml TEXT,"\
4141
"groupid INTEGER)"
4242

‎src/core/symbology-ng/qgsstylev2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ bool QgsStyleV2::addColorRamp( QString name, QgsVectorColorRampV2* colorRamp, bo
187187
if ( !colorRamp || name.isEmpty() )
188188
return false;
189189

190-
// delete previous symbol (if any)
191-
if ( mSymbols.contains( name ) )
190+
// delete previous color ramps (if any)
191+
if ( mColorRamps.contains( name ) )
192192
{
193193
// TODO remove groups and tags?
194194
delete mColorRamps.value( name );

0 commit comments

Comments
 (0)