mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Avoid crash in style model when adding symbols with a new tag to library
Fixes #20256
This commit is contained in:
parent
5ebb974569
commit
f6aecd152d
@ -57,8 +57,8 @@ QVariant QgsStyleModel::data( const QModelIndex &index, int role ) const
|
|||||||
|
|
||||||
const bool isColorRamp = index.row() >= mStyle->symbolCount();
|
const bool isColorRamp = index.row() >= mStyle->symbolCount();
|
||||||
const QString name = !isColorRamp
|
const QString name = !isColorRamp
|
||||||
? mSymbolNames.at( index.row() )
|
? mSymbolNames.value( index.row() )
|
||||||
: mRampNames.at( index.row() - mSymbolNames.size() );
|
: mRampNames.value( index.row() - mSymbolNames.size() );
|
||||||
|
|
||||||
switch ( role )
|
switch ( role )
|
||||||
{
|
{
|
||||||
@ -187,8 +187,8 @@ bool QgsStyleModel::setData( const QModelIndex &index, const QVariant &value, in
|
|||||||
{
|
{
|
||||||
const bool isColorRamp = index.row() >= mStyle->symbolCount();
|
const bool isColorRamp = index.row() >= mStyle->symbolCount();
|
||||||
const QString name = !isColorRamp
|
const QString name = !isColorRamp
|
||||||
? mSymbolNames.at( index.row() )
|
? mSymbolNames.value( index.row() )
|
||||||
: mRampNames.at( index.row() - mSymbolNames.size() );
|
: mRampNames.value( index.row() - mSymbolNames.size() );
|
||||||
const QString newName = value.toString();
|
const QString newName = value.toString();
|
||||||
|
|
||||||
return isColorRamp
|
return isColorRamp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user