You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ( format.dataDefinedProperties().hasActiveProperties() ) // note, we use format instead of tmpFormat here, it's const and potentially avoids a detach
90
-
tmpFormat.updateDataDefinedProperties( context );
88
+
QgsTextFormat lFormat = _format;
89
+
if ( _format.dataDefinedProperties().hasActiveProperties() ) // note, we use format instead of tmpFormat here, it's const and potentially avoids a detach
90
+
lFormat.updateDataDefinedProperties( context );
91
+
92
+
// DO NOT USE _format in the following code, always use lFormat!!
91
93
92
94
QStringList textLines;
93
95
for ( const QString &line : text )
94
96
{
95
-
if ( flags & Qgis::TextRendererFlag::WrapLines && textRequiresWrapping( context, line, rect.width(), format ) )
if ( format.dataDefinedProperties().hasActiveProperties() ) // note, we use format instead of tmpFormat here, it's const and potentially avoids a detach
135
-
tmpFormat.updateDataDefinedProperties( context );
136
-
tmpFormat = updateShadowPosition( tmpFormat );
135
+
QgsTextFormat lFormat = _format;
136
+
if ( _format.dataDefinedProperties().hasActiveProperties() ) // note, we use _format instead of tmpFormat here, it's const and potentially avoids a detach
if ( format.dataDefinedProperties().hasActiveProperties() ) // note, we use format instead of tmpFormat here, it's const and potentially avoids a detach
160
-
tmpFormat.updateDataDefinedProperties( context );
161
-
tmpFormat = updateShadowPosition( tmpFormat );
161
+
QgsTextFormat lFormat = _format;
162
+
if ( _format.dataDefinedProperties().hasActiveProperties() ) // note, we use _format instead of tmpFormat here, it's const and potentially avoids a detach
163
+
lFormat.updateDataDefinedProperties( context );
164
+
lFormat = updateShadowPosition( lFormat );
165
+
166
+
// DO NOT USE _format in the following code, always use lFormat!!
162
167
163
168
// todo handle newlines??
164
-
QgsTextDocument document = format.allowHtmlFormatting() ? QgsTextDocument::fromHtml( { text } ) : QgsTextDocument::fromPlainText( { text } );
0 commit comments