Skip to content

Commit

Permalink
Merge pull request #211 from beru/no_hwndProgress_when_bGrepRunning
Browse files Browse the repository at this point in the history
grep実行中はテキスト置換処理の進捗ダイアログ表示を抑制
  • Loading branch information
kobake authored Jul 4, 2018
2 parents 7884390 + 5b6c0c9 commit 610af5d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions sakura_core/CSearchAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "util/string_ex.h"
#include <algorithm>
#include "sakura_rc.h"
#include "CEditApp.h"
#include "CGrepAgent.h"

//#define MEASURE_SEARCH_TIME
#ifdef MEASURE_SEARCH_TIME
Expand Down Expand Up @@ -822,13 +824,15 @@ void CSearchAgent::ReplaceData( DocLineReplaceArg* pArg )
CDLgCandelCloser closer(pCDlgCancel);
const CLogicInt nDelLines = pArg->sDelRange.GetTo().y - pArg->sDelRange.GetFrom().y;
const CLogicInt nEditLines = std::max<CLogicInt>(CLogicInt(1), nDelLines + CLogicInt(pArg->pInsData ? pArg->pInsData->size(): 0));
if( 3000 < nEditLines ){
/* 進捗ダイアログの表示 */
pCDlgCancel = new CDlgCancel;
if( NULL != ( hwndCancel = pCDlgCancel->DoModeless( ::GetModuleHandle( NULL ), NULL, IDD_OPERATIONRUNNING ) ) ){
hwndProgress = ::GetDlgItem( hwndCancel, IDC_PROGRESS );
Progress_SetRange( hwndProgress, 0, 101 );
Progress_SetPos( hwndProgress, 0 );
if( !CEditApp::getInstance()->m_pcGrepAgent->m_bGrepRunning ){
if( 3000 < nEditLines ){
/* 進捗ダイアログの表示 */
pCDlgCancel = new CDlgCancel;
if( NULL != ( hwndCancel = pCDlgCancel->DoModeless( ::GetModuleHandle( NULL ), NULL, IDD_OPERATIONRUNNING ) ) ){
hwndProgress = ::GetDlgItem( hwndCancel, IDC_PROGRESS );
Progress_SetRange( hwndProgress, 0, 101 );
Progress_SetPos( hwndProgress, 0 );
}
}
}
int nProgressOld = 0;
Expand Down

0 comments on commit 610af5d

Please sign in to comment.