"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core/symbology/qgssvgcache.cpp" between
QGIS-final-3_14_15.tar.gz and QGIS-final-3_14_16.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Latest release (3.14.x series).

qgssvgcache.cpp  (QGIS-final-3_14_15):qgssvgcache.cpp  (QGIS-final-3_14_16)
skipping to change at line 349 skipping to change at line 349
{ {
if ( svgElem.hasAttribute( QStringLiteral( "viewBox" ) ) ) if ( svgElem.hasAttribute( QStringLiteral( "viewBox" ) ) )
viewBox = svgElem.attribute( QStringLiteral( "viewBox" ), QString() ); viewBox = svgElem.attribute( QStringLiteral( "viewBox" ), QString() );
else if ( svgElem.hasAttribute( QStringLiteral( "viewbox" ) ) ) else if ( svgElem.hasAttribute( QStringLiteral( "viewbox" ) ) )
viewBox = svgElem.attribute( QStringLiteral( "viewbox" ), QString() ); viewBox = svgElem.attribute( QStringLiteral( "viewbox" ), QString() );
} }
} }
//could not find valid viewbox attribute //could not find valid viewbox attribute
if ( viewBox.isEmpty() ) if ( viewBox.isEmpty() )
{
// trying looking for width/height and use them as a fallback
if ( docElem.tagName() == QLatin1String( "svg" ) && docElem.hasAttribute( QS
tringLiteral( "width" ) ) )
{
const QString widthString = docElem.attribute( QStringLiteral( "width" ) )
;
const QRegularExpression measureRegEx( QStringLiteral( "([\\d\\.]+).*?$" )
);
const QRegularExpressionMatch widthMatch = measureRegEx.match( widthString
);
if ( widthMatch.hasMatch() )
{
double width = widthMatch.captured( 1 ).toDouble();
const QString heightString = docElem.attribute( QStringLiteral( "height"
) );
const QRegularExpressionMatch heightMatch = measureRegEx.match( heightSt
ring );
if ( heightMatch.hasMatch() )
{
double height = heightMatch.captured( 1 ).toDouble();
viewboxSize = QSizeF( width, height );
return width / entry->size;
}
}
}
return 1.0; return 1.0;
}
//width should be 3rd element in a 4 part space delimited string //width should be 3rd element in a 4 part space delimited string
QStringList parts = viewBox.split( ' ' ); QStringList parts = viewBox.split( ' ' );
if ( parts.count() != 4 ) if ( parts.count() != 4 )
return 1.0; return 1.0;
bool heightOk = false; bool heightOk = false;
double height = parts.at( 3 ).toDouble( &heightOk ); double height = parts.at( 3 ).toDouble( &heightOk );
bool widthOk = false; bool widthOk = false;
 End of changes. 2 change blocks. 
0 lines changed or deleted 29 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)