Null pointer safety (from Coverity).

This commit is contained in:
Jeff Young 2020-11-29 10:54:50 +00:00
parent f57cd91cb3
commit 3b18fa84bf
1 changed files with 6 additions and 3 deletions

View File

@ -755,6 +755,12 @@ void WS_DATA_ITEM_BITMAP::SyncDrawItems( WS_DRAW_ITEM_LIST* aCollector, KIGFX::V
delete item;
}
if( aCollector )
{
double pix_size_iu = aCollector->GetMilsToIUfactor() * 1000 / m_ImageBitmap->GetPPI();
m_ImageBitmap->SetPixelSizeIu( pix_size_iu );
}
m_drawItems.clear();
for( int j = 0; j < m_RepeatCount; j++ )
@ -762,9 +768,6 @@ void WS_DATA_ITEM_BITMAP::SyncDrawItems( WS_DRAW_ITEM_LIST* aCollector, KIGFX::V
if( j && !IsInsidePage( j ) )
continue;
double pix_size_iu = aCollector->GetMilsToIUfactor() * 1000 / m_ImageBitmap->GetPPI();
m_ImageBitmap->SetPixelSizeIu( pix_size_iu );
WS_DRAW_ITEM_BITMAP* bitmap = new WS_DRAW_ITEM_BITMAP( this, j, GetStartPosUi( j ) );
bitmap->SetFlags( itemFlags[ j ] );