Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ファイル保存の副次処理調整 #1054

Merged
merged 1 commit into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sakura_core/CSaveAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ void CSaveAgent::OnAfterSave(const SSaveInfo& sSaveInfo)
// 上書き(明示的な上書きや自動保存)では変更しない
// ---> 上書きの場合は一時的な折り返し桁変更やタブ幅変更を維持したままにする
if(!sSaveInfo.bOverwriteMode){
pcDoc->OnChangeSetting();
// 文書種別が変更になった場合にのみ設定変更を反映させる
int prevIndex = pcDoc->m_cDocType.GetDocumentType().GetIndex();
int newIndex = CDocTypeManager().GetDocumentTypeOfPath( sSaveInfo.cFilePath ).GetIndex();
if(newIndex != prevIndex)
pcDoc->OnChangeSetting();
}
}

Expand Down
7 changes: 6 additions & 1 deletion sakura_core/CWriteManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,16 @@ EConvertResult CWriteManager::WriteFile_From_CDocLineMgr(
}
}
CMemory cmemOutputBuffer;
constexpr DWORD userInterfaceInterval = 33;
DWORD prevTime = GetTickCount() + userInterfaceInterval;
while( pcDocLine ){
++nLineNumber;

//経過通知
if(pcDocLineMgr.GetLineCount()>0 && nLineNumber%1024==0){
DWORD currTime = GetTickCount();
DWORD diffTime = currTime - prevTime;
if(diffTime >= userInterfaceInterval){
prevTime = currTime;
NotifyProgress(nLineNumber * 100 / pcDocLineMgr.GetLineCount());
// 処理中のユーザー操作を可能にする
if( !::BlockingHook( NULL ) ){
Expand Down