Skip to content

Commit

Permalink
use dynamic_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy authored and nyalldawson committed Feb 5, 2025
1 parent 2fd0175 commit b088ef2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/scalebar/qgsdoubleboxscalebarrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void QgsDoubleBoxScaleBarRenderer::draw( QgsRenderContext &context, const QgsSca

bool QgsDoubleBoxScaleBarRenderer::applyDefaultSettings( QgsScaleBarSettings &settings ) const
{
QgsSimpleFillSymbolLayer *fill = qgis::down_cast< QgsSimpleFillSymbolLayer * >( settings.fillSymbol()->symbolLayers().at( 0 ) );
QgsSimpleFillSymbolLayer *fill = dynamic_cast< QgsSimpleFillSymbolLayer * >( settings.fillSymbol()->symbolLayers().at( 0 ) );

// restore the fill symbols by default
if ( fill && fill->brushStyle() == Qt::NoBrush )
Expand Down
2 changes: 1 addition & 1 deletion src/core/scalebar/qgssingleboxscalebarrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void QgsSingleBoxScaleBarRenderer::draw( QgsRenderContext &context, const QgsSca

bool QgsSingleBoxScaleBarRenderer::applyDefaultSettings( QgsScaleBarSettings &settings ) const
{
QgsSimpleFillSymbolLayer *fill = qgis::down_cast< QgsSimpleFillSymbolLayer * >( settings.fillSymbol()->symbolLayers().at( 0 ) );
QgsSimpleFillSymbolLayer *fill = dynamic_cast< QgsSimpleFillSymbolLayer * >( settings.fillSymbol()->symbolLayers().at( 0 ) );

// restore the fill symbols by default
if ( fill && fill->brushStyle() == Qt::NoBrush )
Expand Down

0 comments on commit b088ef2

Please sign in to comment.