Skip to content

Commit

Permalink
CSearchAgent::ReplaceData の共有データ依存を除去
Browse files Browse the repository at this point in the history
  • Loading branch information
kengoide committed May 8, 2021
1 parent 9cab3f8 commit 5f44ac6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
7 changes: 3 additions & 4 deletions sakura_core/CSearchAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ end_of_func:;
Fromを含む位置からToの直前を含むデータを削除する
Fromの位置へテキストを挿入する
*/
void CSearchAgent::ReplaceData( DocLineReplaceArg* pArg )
void CSearchAgent::ReplaceData( DocLineReplaceArg* pArg, bool bEnableExtEol )
{
// MY_RUNNINGTIMER( cRunningTimer, "CDocLineMgr::ReplaceData()" );

Expand Down Expand Up @@ -796,7 +796,8 @@ 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( !CEditApp::getInstance()->m_pcGrepAgent->m_bGrepRunning ){
CGrepAgent *pcGrepAgent = CEditApp::getInstance()->m_pcGrepAgent;
if( pcGrepAgent && !pcGrepAgent->m_bGrepRunning ){
if( 3000 < nEditLines ){
/* 進捗ダイアログの表示 */
pCDlgCancel = new CDlgCancel;
Expand All @@ -814,8 +815,6 @@ void CSearchAgent::ReplaceData( DocLineReplaceArg* pArg )
pArg->pcmemDeleted->reserve( pArg->sDelRange.GetTo().y + CLogicInt(1) - pArg->sDelRange.GetFrom().y );
}

const bool bEnableExtEol = GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol;

// 2012.01.10 行内の削除&挿入のときの操作を1つにする
bool bChangeOneLine = false; // 行内の挿入
bool bInsOneLine = false;
Expand Down
2 changes: 1 addition & 1 deletion sakura_core/CSearchAgent.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class CSearchAgent{
// Jun. 26, 2001 genta 正規表現ライブラリの差し替え
int SearchWord( CLogicPoint ptSerachBegin, ESearchDirection eDirection, CLogicRange* pMatchRange, const CSearchStringPattern& pattern ); /* 単語検索 */

void ReplaceData( DocLineReplaceArg* pArg );
void ReplaceData( DocLineReplaceArg* pArg, bool bEnableExtEol );
private:
CDocLineMgr* m_pcDocLineMgr;
};
Expand Down
1 change: 1 addition & 0 deletions sakura_core/basis/primitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define SAKURA_PRIMITIVE_C8059DE4_C986_492E_9C09_7F044049C481_H_
#pragma once

#include <Windows.h>
#include "config/build_config.h"

// -- -- -- -- 文字 -- -- -- -- //
Expand Down
2 changes: 1 addition & 1 deletion sakura_core/doc/layout/CLayoutMgr_New2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void CLayoutMgr::ReplaceData_CLayoutMgr(
DLRArg.pInsData = pArg->pInsData; // 挿入するデータ
DLRArg.nDelSeq = pArg->nDelSeq;
CSearchAgent(m_pcDocLineMgr).ReplaceData(
&DLRArg
&DLRArg, GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol
);
pArg->nInsSeq = DLRArg.nInsSeq;

Expand Down
3 changes: 2 additions & 1 deletion sakura_core/view/CEditView_Command_New.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,8 @@ bool CEditView::ReplaceData_CEditView3(
DLRArg.pInsData = pInsData;
DLRArg.nDelSeq = nDelSeq;
// DLRArg.ptNewPos;
CSearchAgent(&GetDocument()->m_cDocLineMgr).ReplaceData( &DLRArg );
CSearchAgent(&GetDocument()->m_cDocLineMgr).ReplaceData(
&DLRArg, GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol);
}else{
LRArg.sDelRange = sDelRange; //!< 削除範囲レイアウト
LRArg.pcmemDeleted = pcMemDeleted; //!< [out] 削除されたデータ
Expand Down

0 comments on commit 5f44ac6

Please sign in to comment.