Skip to content

Commit

Permalink
fix windows build (partly reverts 1a199d0)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Nov 27, 2018
1 parent 06312f0 commit 60ea432
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ Returns extra information for data-defined size legend rendering. Normally it re

};


typedef QList< QgsLegendSymbolItem > QgsLegendSymbolList;

/************************************************************************
Expand Down
1 change: 1 addition & 0 deletions src/core/symbology/qgs25drenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "qgsgloweffect.h"
#include "qgsproperty.h"
#include "qgssymbollayerutils.h"
#include "qgsdatadefinedsizelegend.h"

#define ROOF_EXPRESSION \
"translate(" \
Expand Down
20 changes: 14 additions & 6 deletions src/core/symbology/qgslegendsymbolitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,24 @@ QgsLegendSymbolItem::QgsLegendSymbolItem( const QgsLegendSymbolItem &other )
*this = other;
}

QgsLegendSymbolItem::~QgsLegendSymbolItem() = default;
QgsLegendSymbolItem::~QgsLegendSymbolItem()
{
delete mSymbol;
delete mDataDefinedSizeLegendSettings;
}

QgsLegendSymbolItem &QgsLegendSymbolItem::operator=( const QgsLegendSymbolItem &other )
{
if ( this == &other )
return *this;

mSymbol.reset( other.mSymbol ? other.mSymbol->clone() : nullptr );
delete mSymbol;
mSymbol = other.mSymbol ? other.mSymbol->clone() : nullptr;
mLabel = other.mLabel;
mKey = other.mKey;
mCheckable = other.mCheckable;
mDataDefinedSizeLegendSettings.reset( other.mDataDefinedSizeLegendSettings ? new QgsDataDefinedSizeLegend( *other.mDataDefinedSizeLegendSettings ) : nullptr );
delete mDataDefinedSizeLegendSettings;
mDataDefinedSizeLegendSettings = other.mDataDefinedSizeLegendSettings ? new QgsDataDefinedSizeLegend( *other.mDataDefinedSizeLegendSettings ) : nullptr;
mOriginalSymbolPointer = other.mOriginalSymbolPointer;
mScaleMinDenom = other.mScaleMinDenom;
mScaleMaxDenom = other.mScaleMaxDenom;
Expand All @@ -72,16 +78,18 @@ bool QgsLegendSymbolItem::isScaleOK( double scale ) const

void QgsLegendSymbolItem::setSymbol( QgsSymbol *s )
{
mSymbol.reset( s ? s->clone() : nullptr );
delete mSymbol;
mSymbol = s ? s->clone() : nullptr;
mOriginalSymbolPointer = s;
}

void QgsLegendSymbolItem::setDataDefinedSizeLegendSettings( QgsDataDefinedSizeLegend *settings )
{
mDataDefinedSizeLegendSettings.reset( settings );
delete mDataDefinedSizeLegendSettings;
mDataDefinedSizeLegendSettings = settings;
}

QgsDataDefinedSizeLegend *QgsLegendSymbolItem::dataDefinedSizeLegendSettings() const
{
return mDataDefinedSizeLegendSettings.get();
return mDataDefinedSizeLegendSettings;
}
6 changes: 3 additions & 3 deletions src/core/symbology/qgslegendsymbolitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CORE_EXPORT QgsLegendSymbolItem
QgsLegendSymbolItem &operator=( const QgsLegendSymbolItem &other );

//! Returns associated symbol. May be null.
QgsSymbol *symbol() const { return mSymbol.get(); }
QgsSymbol *symbol() const { return mSymbol; }
//! Returns text label
QString label() const { return mLabel; }
//! Returns unique identifier of the rule for identification of the item within renderer
Expand Down Expand Up @@ -114,7 +114,7 @@ class CORE_EXPORT QgsLegendSymbolItem

private:
//! Legend symbol -- may be null.
std::unique_ptr< QgsSymbol > mSymbol;
QgsSymbol *mSymbol = nullptr;
//! label of the item (may be empty or non-unique)
QString mLabel;
//! unique identifier of the symbol item (within renderer)
Expand All @@ -128,7 +128,7 @@ class CORE_EXPORT QgsLegendSymbolItem
* optional pointer to data-defined legend size settings - if set, the output legend
* node should be QgsDataDefinedSizeLegendNode rather than ordinary QgsSymbolLegendNode
*/
std::unique_ptr< QgsDataDefinedSizeLegend > mDataDefinedSizeLegendSettings;
QgsDataDefinedSizeLegend *mDataDefinedSizeLegendSettings = nullptr;

// additional data that may be used for filtering

Expand Down

0 comments on commit 60ea432

Please sign in to comment.