Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve representation of long strings
  • Loading branch information
m-kuhn committed Nov 20, 2021
1 parent ee255af commit 9f54751
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/qgsfield.cpp
Expand Up @@ -266,11 +266,12 @@ QString QgsField::displayString( const QVariant &v ) const
return QgsApplication::nullRepresentation();
else
{
QString formattedText = QStringLiteral( "%1 [%2]" ).arg( geom.asWkt(), geom.crs().userFriendlyIdentifier() );
if ( formattedText.length() >= 1050 )
QString wkt = geom.asWkt();
if ( wkt.length() >= 1050 )
{
formattedText = formattedText.left( 999 ) + QChar( 0x2026 );
wkt = wkt.left( 999 ) + QChar( 0x2026 );
}
QString formattedText = QStringLiteral( "%1 [%2]" ).arg( wkt, geom.crs().userFriendlyIdentifier() );
return formattedText;
}
}
Expand Down

0 comments on commit 9f54751

Please sign in to comment.