Skip to content

Commit 76190d5

Browse files
committed
Remove useless member variable
1 parent 6dd1bd3 commit 76190d5

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

python/core/auto_generated/symbology/qgsfillsymbollayer.sip.in

-1
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,6 @@ the appropriate pixel dimensions of the output device*
10271027
Constructs SVG fill symbol layer with picture from given absolute path to a SVG file
10281028
%End
10291029
QgsSVGFillSymbolLayer( const QByteArray &svgData, double width = 20, double rotation = 0.0 );
1030-
~QgsSVGFillSymbolLayer();
10311030

10321031
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
10331032
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;

src/core/symbology/qgsfillsymbollayer.cpp

+7-17
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,6 @@ QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QString &svgFilePath, double
17241724
mSvgStrokeColor = QColor( 35, 35, 35 );
17251725
mSvgStrokeWidth = 0.2;
17261726
setDefaultSvgParams();
1727-
mSvgPattern = nullptr;
17281727
}
17291728

17301729
QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QByteArray &svgData, double width, double angle )
@@ -1742,12 +1741,6 @@ QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QByteArray &svgData, double
17421741
mSvgStrokeWidth = 0.2;
17431742
setSubSymbol( new QgsLineSymbol() );
17441743
setDefaultSvgParams();
1745-
mSvgPattern = nullptr;
1746-
}
1747-
1748-
QgsSVGFillSymbolLayer::~QgsSVGFillSymbolLayer()
1749-
{
1750-
delete mSvgPattern;
17511744
}
17521745

17531746
void QgsSVGFillSymbolLayer::setOutputUnit( QgsUnitTypes::RenderUnit unit )
@@ -1926,14 +1919,11 @@ void QgsSVGFillSymbolLayer::applyPattern( QBrush &brush, const QString &svgFileP
19261919
return;
19271920
}
19281921

1929-
delete mSvgPattern;
1930-
mSvgPattern = nullptr;
19311922
double size = context.renderContext().convertToPainterUnits( patternWidth, patternWidthUnit, patternWidthMapUnitScale );
19321923

19331924
if ( static_cast< int >( size ) < 1.0 || 10000.0 < size )
19341925
{
1935-
mSvgPattern = new QImage();
1936-
brush.setTextureImage( *mSvgPattern );
1926+
brush.setTextureImage( QImage() );
19371927
}
19381928
else
19391929
{
@@ -1950,23 +1940,23 @@ void QgsSVGFillSymbolLayer::applyPattern( QBrush &brush, const QString &svgFileP
19501940
{
19511941
hwRatio = static_cast< double >( patternPict.height() ) / static_cast< double >( patternPict.width() );
19521942
}
1953-
mSvgPattern = new QImage( static_cast< int >( size ), static_cast< int >( size * hwRatio ), QImage::Format_ARGB32_Premultiplied );
1954-
mSvgPattern->fill( 0 ); // transparent background
1943+
patternImage = QImage( static_cast< int >( size ), static_cast< int >( size * hwRatio ), QImage::Format_ARGB32_Premultiplied );
1944+
patternImage.fill( 0 ); // transparent background
19551945

1956-
QPainter p( mSvgPattern );
1946+
QPainter p( &patternImage );
19571947
p.drawPicture( QPointF( size / 2, size * hwRatio / 2 ), patternPict );
19581948
}
19591949

19601950
QTransform brushTransform;
19611951
if ( !qgsDoubleNear( context.opacity(), 1.0 ) )
19621952
{
1963-
QImage transparentImage = fitsInCache ? patternImage.copy() : mSvgPattern->copy();
1953+
QImage transparentImage = patternImage.copy();
19641954
QgsSymbolLayerUtils::multiplyImageOpacity( &transparentImage, context.opacity() );
19651955
brush.setTextureImage( transparentImage );
19661956
}
19671957
else
19681958
{
1969-
brush.setTextureImage( fitsInCache ? patternImage : *mSvgPattern );
1959+
brush.setTextureImage( patternImage );
19701960
}
19711961
brush.setTransform( brushTransform );
19721962
}
@@ -3631,7 +3621,7 @@ QgsSymbolLayer *QgsRasterFillSymbolLayer::create( const QgsStringMap &properties
36313621

36323622
symbolLayer->restoreOldDataDefinedProperties( properties );
36333623

3634-
return symbolLaye.release()r;
3624+
return symbolLayer.release();
36353625
}
36363626

36373627
void QgsRasterFillSymbolLayer::resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving )

src/core/symbology/qgsfillsymbollayer.h

-3
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,6 @@ class CORE_EXPORT QgsSVGFillSymbolLayer: public QgsImageFillSymbolLayer
915915
//! Constructs SVG fill symbol layer with picture from given absolute path to a SVG file
916916
QgsSVGFillSymbolLayer( const QString &svgFilePath, double width = 20, double rotation = 0.0 );
917917
QgsSVGFillSymbolLayer( const QByteArray &svgData, double width = 20, double rotation = 0.0 );
918-
~QgsSVGFillSymbolLayer() override;
919918

920919
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
921920
static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
@@ -1004,8 +1003,6 @@ class CORE_EXPORT QgsSVGFillSymbolLayer: public QgsImageFillSymbolLayer
10041003
QString mSvgFilePath;
10051004
//! SVG view box (to keep the aspect ratio
10061005
QRectF mSvgViewBox;
1007-
//! SVG pattern image
1008-
QImage *mSvgPattern = nullptr;
10091006

10101007
//param(fill), param(stroke), param(stroke-width) are going
10111008
//to be replaced in memory

0 commit comments

Comments
 (0)