Skip to content

Commit 3d91663

Browse files
committed
labeling: 'show' empty string instead of configured representation for NULL (party reverts e497a5c; refs #9998; fixes #10151)
1 parent 5093394 commit 3d91663

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/core/qgspallabeling.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,17 +449,13 @@ QgsPalLayerSettings::QgsPalLayerSettings()
449449

450450
// temp stuff for when drawing label components (don't copy)
451451
showingShadowRects = false;
452-
453-
QSettings settings;
454-
mNullValue = settings.value( "qgis/nullValue", "NULL" ).toString();
455452
}
456453

457454
QgsPalLayerSettings::QgsPalLayerSettings( const QgsPalLayerSettings& s )
458455
{
459456
// copy only permanent stuff
460457

461458
enabled = s.enabled;
462-
mNullValue = s.mNullValue;
463459

464460
// text style
465461
fieldName = s.fieldName;
@@ -1706,12 +1702,12 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
17061702
QgsDebugMsgLevel( QString( "Expression parser eval error:%1" ).arg( exp->evalErrorString() ), 4 );
17071703
return;
17081704
}
1709-
labelText = result.isNull() ? mNullValue : result.toString();
1705+
labelText = result.isNull() ? "" : result.toString();
17101706
}
17111707
else
17121708
{
17131709
const QVariant &v = f.attribute( fieldIndex );
1714-
labelText = v.isNull() ? mNullValue : v.toString();
1710+
labelText = v.isNull() ? "" : v.toString();
17151711
}
17161712

17171713
// data defined format numbers?

src/core/qgspallabeling.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,6 @@ class CORE_EXPORT QgsPalLayerSettings
550550
QMap<QgsPalLayerSettings::DataDefinedProperties, QPair<QString, int> > mDataDefinedNames;
551551

552552
QFontDatabase mFontDB;
553-
QString mNullValue;
554553
};
555554

556555
class CORE_EXPORT QgsLabelCandidate

0 commit comments

Comments
 (0)