|
33 | 33 |
|
34 | 34 | #include "StdAfx.h"
|
35 | 35 | #include <algorithm>
|
36 |
| -#include <tuple> |
37 | 36 | #include "CDlgFavorite.h"
|
38 | 37 | #include "dlg/CDlgInput1.h"
|
39 | 38 | #include "env/DLLSHAREDATA.h"
|
@@ -90,8 +89,7 @@ static int FormatFavoriteColumn( WCHAR*, int, int , bool );
|
90 | 89 | static int ListView_GetLParamInt( HWND, int );
|
91 | 90 | static int CALLBACK CompareListViewFunc( LPARAM, LPARAM, LPARAM );
|
92 | 91 |
|
93 |
| -const int nFavoriteMax = 3; |
94 |
| -const int nFavoriteLimitOffset = 20; |
| 92 | +const int nFavoriteLimitOffset = 5; |
95 | 93 | const int ignoreTab = 3;
|
96 | 94 |
|
97 | 95 | struct CompareListViewLParam
|
@@ -356,31 +354,18 @@ void CDlgFavorite::SetDataOne( int nIndex, int nLvItemIndex )
|
356 | 354 | int CDlgFavorite::GetData( void )
|
357 | 355 | {
|
358 | 356 | int nTab;
|
359 |
| - std::wstring strReachFavLimitMsg; |
360 |
| - std::tuple<int,int> FavoriteCountAndHistory; |
361 | 357 |
|
362 | 358 | for( nTab = 0; m_aFavoriteInfo[nTab].m_pRecent; nTab++ )
|
363 | 359 | {
|
364 | 360 | if( m_aFavoriteInfo[nTab].m_bHaveFavorite )
|
365 | 361 | {
|
366 |
| - GetFavorite(nTab); |
367 |
| - FavoriteCountAndHistory = GetListFavorite(nTab); |
368 |
| - if (std::get<0>(FavoriteCountAndHistory) >= nFavoriteMax) { |
369 |
| - std::wstring buffer = strprintf(L"%s : %d (%d)\n", m_aFavoriteInfo[nTab].m_strCaption.c_str(), std::get<0>(FavoriteCountAndHistory), std::get<1>(FavoriteCountAndHistory)); |
370 |
| - strReachFavLimitMsg.append(buffer); |
371 |
| - } |
| 362 | + GetFavorite( nTab ); |
372 | 363 |
|
373 | 364 | //リストを更新する。
|
374 | 365 | CRecent* pRecent = m_aFavoriteInfo[nTab].m_pRecent;
|
375 | 366 | pRecent->UpdateView();
|
376 | 367 | }
|
377 | 368 | }
|
378 |
| - if (!strReachFavLimitMsg.empty()) |
379 |
| - { |
380 |
| - strReachFavLimitMsg.append(LS( STR_DLGFAV_FAV_COUNT_LIMIT )); |
381 |
| - WarningMessage(GetHwnd(), strReachFavLimitMsg.c_str()); |
382 |
| - strReachFavLimitMsg.clear(); |
383 |
| - } |
384 | 369 |
|
385 | 370 | return TRUE;
|
386 | 371 | }
|
@@ -887,37 +872,18 @@ bool CDlgFavorite::RefreshListOne( int nIndex )
|
887 | 872 | // お気に入りのフラグだけ適用
|
888 | 873 | void CDlgFavorite::GetFavorite( int nIndex )
|
889 | 874 | {
|
890 |
| - CRecent* const pRecent = m_aFavoriteInfo[nIndex].m_pRecent; |
| 875 | + CRecent * const pRecent = m_aFavoriteInfo[nIndex].m_pRecent; |
891 | 876 | const HWND hwndList = m_aListViewInfo[nIndex].hListView;
|
892 | 877 | if( m_aFavoriteInfo[nIndex].m_bHaveFavorite ){
|
893 | 878 | const int nCount = ListView_GetItemCount( hwndList );
|
894 | 879 | for( int i = 0; i < nCount; i++ ){
|
895 | 880 | const int recIndex = ListView_GetLParamInt( hwndList, i );
|
896 | 881 | const BOOL bret = ListView_GetCheckState( hwndList, i );
|
897 |
| - pRecent->GetTextMaxLength(); |
898 | 882 | pRecent->SetFavorite( recIndex, bret ? true : false );
|
899 | 883 | }
|
900 | 884 | }
|
901 | 885 | }
|
902 | 886 |
|
903 |
| -std::tuple<int,int> CDlgFavorite::GetListFavorite( int nIndex ) |
904 |
| -{ |
905 |
| - if ( nIndex < ignoreTab ) { |
906 |
| - return std::make_tuple( 0, 0 ); |
907 |
| - } |
908 |
| - const HWND hwndList = m_aListViewInfo[nIndex].hListView; |
909 |
| - CRecent* const pRecent = m_aFavoriteInfo[nIndex].m_pRecent; |
910 |
| - int nMax = pRecent->GetArrayCount(); |
911 |
| - int nFavoriteCount = 0; |
912 |
| - const int nCount = ListView_GetItemCount( hwndList ); |
913 |
| - for( int i = 0; i < nCount; i++ ){ |
914 |
| - if(ListView_GetCheckState( hwndList, i )){ |
915 |
| - nFavoriteCount++; |
916 |
| - } |
917 |
| - } |
918 |
| - return std::make_tuple( nFavoriteCount, nMax - nFavoriteCount ); |
919 |
| -} |
920 |
| - |
921 | 887 | bool CDlgFavorite::IsGreaterThanOrEqualMax( int nTab )
|
922 | 888 | {
|
923 | 889 | if( nTab < ignoreTab ){
|
|
0 commit comments