From 598a65a3c1632c24f2aac38c5a2c9f6a55618cd6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 15 Apr 2020 08:56:07 +0200 Subject: loplugin:flatten in dbaccess Change-Id: Ifcfd3637fbce6dc3a07a1859f102a6ac85149190 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92237 Tested-by: Jenkins Reviewed-by: Noel Grandin --- dbaccess/source/ui/browser/dsEntriesNoExp.cxx | 84 +++++++++++++-------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'dbaccess/source/ui/browser/dsEntriesNoExp.cxx') diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx index 1e3bfd3b57d1..7e9bfc851360 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -195,59 +195,59 @@ sal_Int32 SbaTableQueryBrowser::getDatabaseObjectType( EntryType _eType ) void SbaTableQueryBrowser::notifyHiContrastChanged() { - if ( m_pTreeView ) + if ( !m_pTreeView ) + return; + + auto pTreeModel = m_pTreeView->GetTreeModel(); + // change all bitmap entries + SvTreeListEntry* pEntryLoop = pTreeModel->First(); + while ( pEntryLoop ) { - auto pTreeModel = m_pTreeView->GetTreeModel(); - // change all bitmap entries - SvTreeListEntry* pEntryLoop = pTreeModel->First(); - while ( pEntryLoop ) + DBTreeListUserData* pData = static_cast(pEntryLoop->GetUserData()); + if ( !pData ) { - DBTreeListUserData* pData = static_cast(pEntryLoop->GetUserData()); - if ( !pData ) - { - pEntryLoop = pTreeModel->Next(pEntryLoop); - continue; - } + pEntryLoop = pTreeModel->Next(pEntryLoop); + continue; + } - // the connection to which this entry belongs, if any - std::unique_ptr< ImageProvider > pImageProvider( getImageProviderFor( pEntryLoop ) ); + // the connection to which this entry belongs, if any + std::unique_ptr< ImageProvider > pImageProvider( getImageProviderFor( pEntryLoop ) ); - // the images for this entry - Image aImage; - if ( pData->eType == etDatasource ) - aImage = ImageProvider::getDatabaseImage(); - else + // the images for this entry + Image aImage; + if ( pData->eType == etDatasource ) + aImage = ImageProvider::getDatabaseImage(); + else + { + bool bIsFolder = !isObject( pData->eType ); + if ( bIsFolder ) { - bool bIsFolder = !isObject( pData->eType ); - if ( bIsFolder ) - { - sal_Int32 nObjectType( getDatabaseObjectType( pData->eType ) ); - aImage = ImageProvider::getFolderImage( nObjectType ); - } - else - { - sal_Int32 nObjectType( getDatabaseObjectType( pData->eType ) ); - pImageProvider->getImages( GetEntryText( pEntryLoop ), nObjectType, aImage ); - } + sal_Int32 nObjectType( getDatabaseObjectType( pData->eType ) ); + aImage = ImageProvider::getFolderImage( nObjectType ); } - - // find the proper item, and set its icons - sal_uInt16 nCount = pEntryLoop->ItemCount(); - for (sal_uInt16 i=0;iGetItem(i); - if (rItem.GetType() != SvLBoxItemType::ContextBmp) - continue; + sal_Int32 nObjectType( getDatabaseObjectType( pData->eType ) ); + pImageProvider->getImages( GetEntryText( pEntryLoop ), nObjectType, aImage ); + } + } - SvLBoxContextBmp& rContextBitmapItem = static_cast< SvLBoxContextBmp& >( rItem ); + // find the proper item, and set its icons + sal_uInt16 nCount = pEntryLoop->ItemCount(); + for (sal_uInt16 i=0;iGetItem(i); + if (rItem.GetType() != SvLBoxItemType::ContextBmp) + continue; - rContextBitmapItem.SetBitmap1( aImage ); - rContextBitmapItem.SetBitmap2( aImage ); - break; - } + SvLBoxContextBmp& rContextBitmapItem = static_cast< SvLBoxContextBmp& >( rItem ); - pEntryLoop = pTreeModel->Next(pEntryLoop); + rContextBitmapItem.SetBitmap1( aImage ); + rContextBitmapItem.SetBitmap2( aImage ); + break; } + + pEntryLoop = pTreeModel->Next(pEntryLoop); } } -- cgit