• R/O
  • HTTP
  • SSH
  • HTTPS

thirdparty-altwindirstat: Commit

A - since abandoned - fork of WinDirStat which had some interesting changes.

Original home: https://github.com/ariccio/altWinDirStat


Commit MetaInfo

Révision73ec0da831f163e5179ebc7b27451c3c7e3f2afc (tree)
l'heure2016-05-09 14:36:48
AuteurAlexander Riccio <alexander@ricc...>
CommiterAlexander Riccio

Message de Log

lifted some unnecessary complexity out of deep functions

Change Summary

Modification

--- a/WinDirStat/windirstat/ownerdrawnlistcontrol.h
+++ b/WinDirStat/windirstat/ownerdrawnlistcontrol.h
@@ -515,7 +515,7 @@ namespace {
515515
516516 //defined at the BOTTOM of this file!
517517 template<size_t count>
518- void build_array_of_rects_from_subitem_rects( _In_ _In_range_( 1, count ) const size_t thisLoopSize, _In_ _In_reads_( thisLoopSize ) const column::ENUM_COL( &subitems_temp )[ count ], _Out_ _Out_writes_( thisLoopSize ) RECT( &rects_temp )[ count ], _In_ PDRAWITEMSTRUCT pdis, _In_ const COwnerDrawnListCtrl* const owner_drawn_list_ctrl, _In_ CHeaderCtrl* const thisHeaderCtrl );
518+ void build_array_of_rects_from_subitem_rects( _In_ _In_range_( 1, count ) const size_t thisLoopSize, _In_ _In_reads_( thisLoopSize ) const column::ENUM_COL( &subitems_temp )[ count ], _Out_ _Out_writes_( thisLoopSize ) RECT( &rects_temp )[ count ], _In_ INT itemID, _In_ const COwnerDrawnListCtrl* const owner_drawn_list_ctrl, _In_ CHeaderCtrl* const thisHeaderCtrl );
519519
520520
521521 //The compiler will automatically inline if /Ob2 is on, so we'll ask anyways.
@@ -594,9 +594,9 @@ namespace {
594594
595595 //The compiler will automatically inline if /Ob2 is on, so we'll ask anyways.
596596 template<size_t count>
597- inline void map_column_number_to_ENUM_and_build_drawable_rect( const rsize_t thisLoopSize, _In_ const INT( &order )[ count ], _Out_ _Out_writes_( thisLoopSize ) column::ENUM_COL( &subitems_temp )[ count ], _Out_ _Out_writes_( thisLoopSize ) RECT( &rects_temp )[ count ], _In_ const PDRAWITEMSTRUCT pDestinationDrawItemStruct, _Inout_ const COwnerDrawnListCtrl* const this_ctrl, _Inout_ CHeaderCtrl* thisHeaderCtrl, _In_ const RECT rcItem ) {
597+ inline void map_column_number_to_ENUM_and_build_drawable_rect( const rsize_t thisLoopSize, _In_ const INT( &order )[ count ], _Out_ _Out_writes_( thisLoopSize ) column::ENUM_COL( &subitems_temp )[ count ], _Out_ _Out_writes_( thisLoopSize ) RECT( &rects_temp )[ count ], _In_ const INT itemID, _Inout_ const COwnerDrawnListCtrl* const this_ctrl, _Inout_ CHeaderCtrl* thisHeaderCtrl, _In_ const RECT rcItem ) {
598598 iterate_over_columns_and_populate_column_fields_( thisLoopSize, order, subitems_temp );
599- build_array_of_rects_from_subitem_rects( thisLoopSize, subitems_temp, rects_temp, pDestinationDrawItemStruct, this_ctrl, thisHeaderCtrl );
599+ build_array_of_rects_from_subitem_rects( thisLoopSize, subitems_temp, rects_temp, itemID, this_ctrl, thisHeaderCtrl );
600600 build_array_of_drawable_rects_by_offsetting_( thisLoopSize, rects_temp, rcItem.left, rcItem.top );
601601 }
602602
@@ -652,6 +652,7 @@ protected:
652652 const auto item = reinterpret_cast< COwnerDrawnListItem *> ( pDestinationDrawItemStruct->itemData );
653653 const auto pCDestinationDeviceContext = CDC::FromHandle( pDestinationDrawItemStruct->hDC );
654654 const auto bIsFullRowSelection = m_showFullRowSelection;
655+ ASSERT( pDestinationDrawItemStruct->hDC != NULL );
655656 ASSERT_VALID( pCDestinationDeviceContext );
656657 //RECT rcItem_temp( pdis->rcItem );
657658
@@ -682,6 +683,8 @@ protected:
682683 }
683684 } );
684685
686+ //_AFXWIN_INLINE BOOL CBitmap::CreateCompatibleBitmap(CDC* pDC, int nWidth, int nHeight)
687+ //{ return Attach(::CreateCompatibleBitmap(pDC->m_hDC, nWidth, nHeight)); }
685688
686689 CBitmap bm;
687690 VERIFY( bm.CreateCompatibleBitmap( pCDestinationDeviceContext, ( rcItem.right - rcItem.left ), ( rcItem.bottom - rcItem.top ) ) );
@@ -743,7 +746,7 @@ protected:
743746
744747 //build map of column# -> ENUM_COL
745748 //build drawable rect for each column
746- map_column_number_to_ENUM_and_build_drawable_rect( thisLoopSize, order, subitems_temp, rects_temp, pDestinationDrawItemStruct, this, thisHeaderCtrl, rcItem );
749+ map_column_number_to_ENUM_and_build_drawable_rect( thisLoopSize, order, subitems_temp, rects_temp, static_cast<INT>( pDestinationDrawItemStruct->itemID ), this, thisHeaderCtrl, rcItem );
747750
748751 const column::ENUM_COL (&subitems)[ stack_array_size ] = subitems_temp;
749752 const RECT (&rects_draw)[ stack_array_size ] = rects_temp;
@@ -755,10 +758,10 @@ protected:
755758
756759 const int (&focusLefts)[ stack_array_size ] = focusLefts_temp;
757760
758- draw_focus_rects( thisLoopSize, hInMemoryDeviceContext, rects_draw, focusLefts, pCDestinationDeviceContext->m_hDC, rcFocus, rcItem, drawFocus );
761+ draw_focus_rects( thisLoopSize, hInMemoryDeviceContext, rects_draw, focusLefts, pDestinationDrawItemStruct->hDC, rcFocus, rcItem, drawFocus );
759762
760763 if ( drawFocus ) {
761- pCDestinationDeviceContext->DrawFocusRect( &rcFocus );
764+ VERIFY( ::DrawFocusRect( pDestinationDrawItemStruct->hDC, &rcFocus ) );
762765 }
763766
764767 }
@@ -2156,9 +2159,9 @@ namespace{
21562159 }
21572160
21582161 template<size_t count>
2159- void build_array_of_rects_from_subitem_rects( _In_ _In_range_( 1, count ) const size_t thisLoopSize, _In_ _In_reads_( thisLoopSize ) const column::ENUM_COL( &subitems_temp )[ count ], _Out_ _Out_writes_( thisLoopSize ) RECT( &rects_temp )[ count ], _In_ const PDRAWITEMSTRUCT pdis, _In_ const COwnerDrawnListCtrl* const owner_drawn_list_ctrl, _In_ CHeaderCtrl* const thisHeaderCtrl ) {
2162+ void build_array_of_rects_from_subitem_rects( _In_ _In_range_( 1, count ) const size_t thisLoopSize, _In_ _In_reads_( thisLoopSize ) const column::ENUM_COL( &subitems_temp )[ count ], _Out_ _Out_writes_( thisLoopSize ) RECT( &rects_temp )[ count ], _In_ const INT itemID, _In_ const COwnerDrawnListCtrl* const owner_drawn_list_ctrl, _In_ CHeaderCtrl* const thisHeaderCtrl ) {
21602163 for ( size_t i = 0; i < thisLoopSize; ++i ) {
2161- rects_temp[ i ] = owner_drawn_list_ctrl->GetWholeSubitemRect( static_cast<INT>( pdis->itemID ), subitems_temp[ i ], thisHeaderCtrl );
2164+ rects_temp[ i ] = owner_drawn_list_ctrl->GetWholeSubitemRect( itemID, subitems_temp[ i ], thisHeaderCtrl );
21622165 }
21632166 }
21642167
Afficher sur ancien navigateur de dépôt.