Skip to content

Commit c3ddce1

Browse files
committedOct 30, 2018
Avoid crash in style model when adding symbols with a new tag to library
Fixes #20256 (cherry picked from commit f6aecd1)
1 parent ac1fa9e commit c3ddce1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/core/symbology/qgsstylemodel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ QVariant QgsStyleModel::data( const QModelIndex &index, int role ) const
5757

5858
const bool isColorRamp = index.row() >= mStyle->symbolCount();
5959
const QString name = !isColorRamp
60-
? mSymbolNames.at( index.row() )
61-
: mRampNames.at( index.row() - mSymbolNames.size() );
60+
? mSymbolNames.value( index.row() )
61+
: mRampNames.value( index.row() - mSymbolNames.size() );
6262

6363
switch ( role )
6464
{
@@ -187,8 +187,8 @@ bool QgsStyleModel::setData( const QModelIndex &index, const QVariant &value, in
187187
{
188188
const bool isColorRamp = index.row() >= mStyle->symbolCount();
189189
const QString name = !isColorRamp
190-
? mSymbolNames.at( index.row() )
191-
: mRampNames.at( index.row() - mSymbolNames.size() );
190+
? mSymbolNames.value( index.row() )
191+
: mRampNames.value( index.row() - mSymbolNames.size() );
192192
const QString newName = value.toString();
193193

194194
return isColorRamp

0 commit comments

Comments
 (0)
Please sign in to comment.