diff --git a/sakura_core/dlg/CDlgFavorite.cpp b/sakura_core/dlg/CDlgFavorite.cpp index 71a7ac4483..24ca0d69cd 100644 --- a/sakura_core/dlg/CDlgFavorite.cpp +++ b/sakura_core/dlg/CDlgFavorite.cpp @@ -934,7 +934,7 @@ void CDlgFavorite::AddItem() CDlgInput1 cDlgInput1; std::wstring strTitle = LS( STR_DLGFAV_ADD ); std::wstring strMessage = LS( STR_DLGFAV_ADD_PROMPT ); - if( !cDlgInput1.DoModal( G_AppInstance(), GetHwnd(), strTitle.c_str(), strMessage.c_str(), max_size, szAddText ) ){ + if( !cDlgInput1.DoModal( G_AppInstance(), GetHwnd(), strTitle.c_str(), strMessage.c_str(), max_size - 1, szAddText ) ){ return; } @@ -965,7 +965,7 @@ void CDlgFavorite::EditItem() CDlgInput1 cDlgInput1; std::wstring strTitle = LS( STR_DLGFAV_EDIT ); std::wstring strMessage = LS( STR_DLGFAV_EDIT_PROMPT ); - if( !cDlgInput1.DoModal(G_AppInstance(), GetHwnd(), strTitle.c_str(), strMessage.c_str(), max_size, szText) ){ + if( !cDlgInput1.DoModal(G_AppInstance(), GetHwnd(), strTitle.c_str(), strMessage.c_str(), max_size - 1, szText) ){ return; } GetFavorite(m_nCurrentTab); diff --git a/sakura_core/dlg/CDlgPrintSetting.cpp b/sakura_core/dlg/CDlgPrintSetting.cpp index 4a685b51e1..ecff2c9930 100644 --- a/sakura_core/dlg/CDlgPrintSetting.cpp +++ b/sakura_core/dlg/CDlgPrintSetting.cpp @@ -187,7 +187,6 @@ BOOL CDlgPrintSetting::OnDestroy( void ) BOOL CDlgPrintSetting::OnNotify(NMHDR* pNMHDR) { - CDlgInput1 cDlgInput1; NM_UPDOWN* pMNUD; int idCtrl; BOOL bSpinDown; diff --git a/sakura_core/dlg/CDlgProfileMgr.cpp b/sakura_core/dlg/CDlgProfileMgr.cpp index 6ee540c9eb..eaa10716f0 100644 --- a/sakura_core/dlg/CDlgProfileMgr.cpp +++ b/sakura_core/dlg/CDlgProfileMgr.cpp @@ -343,7 +343,7 @@ void CDlgProfileMgr::CreateProf() std::wstring strTitle = LS(STR_DLGPROFILE_NEW_PROF_TITLE); std::wstring strMessage = LS(STR_DLGPROFILE_NEW_PROF_MSG); szText[0] = L'\0'; - if( !cDlgInput1.DoModal(::GetModuleHandle(NULL), GetHwnd(), strTitle.c_str(), strMessage.c_str(), max_size, szText) ){ + if( !cDlgInput1.DoModal(::GetModuleHandle(NULL), GetHwnd(), strTitle.c_str(), strMessage.c_str(), max_size - 1, szText) ){ return; } if( szText[0] == L'\0' ){ @@ -402,7 +402,7 @@ void CDlgProfileMgr::RenameProf() std::wstring strTitle = LS(STR_DLGPROFILE_RENAME_TITLE); std::wstring strMessage = LS(STR_DLGPROFILE_RENAME_MSG); int max_size = _MAX_PATH; - if( !cDlgInput1.DoModal(::GetModuleHandle(NULL), GetHwnd(), strTitle.c_str(), strMessage.c_str(), max_size, szText) ){ + if( !cDlgInput1.DoModal(::GetModuleHandle(NULL), GetHwnd(), strTitle.c_str(), strMessage.c_str(), max_size - 1, szText) ){ return; } if( szText[0] == L'\0' ){ diff --git a/sakura_core/outline/CDlgFileTree.cpp b/sakura_core/outline/CDlgFileTree.cpp index 6d9f18439a..a72a138492 100644 --- a/sakura_core/outline/CDlgFileTree.cpp +++ b/sakura_core/outline/CDlgFileTree.cpp @@ -776,11 +776,11 @@ BOOL CDlgFileTree::OnBnClicked( int wID ) std::wstring strTitle = LS(STR_DLGREPLC_STR); WCHAR szPathFrom[_MAX_PATH]; szPathFrom[0] = L'\0'; - if( dlgInput.DoModal(G_AppInstance(), GetHwnd(), strTitle.c_str(), strMsg.c_str(), _countof(szPathFrom), szPathFrom) ){ + if( dlgInput.DoModal(G_AppInstance(), GetHwnd(), strTitle.c_str(), strMsg.c_str(), _countof(szPathFrom) - 1, szPathFrom) ){ WCHAR szPathTo[_MAX_PATH]; szPathTo[0] = L'\0'; strMsg = LS(STR_FILETREE_REPLACE_PATH_TO); - if( dlgInput.DoModal( G_AppInstance(), GetHwnd(), strTitle.c_str(), strMsg.c_str(), _countof(szPathTo), szPathTo) ){ + if( dlgInput.DoModal( G_AppInstance(), GetHwnd(), strTitle.c_str(), strMsg.c_str(), _countof(szPathTo) - 1, szPathTo) ){ int nItemsCount = (int)m_fileTreeSetting.m_aItems.size(); for( int i = 0; i < nItemsCount; i++ ){ SFileTreeItem& item = m_fileTreeSetting.m_aItems[i]; diff --git a/sakura_core/print/CPrintPreview.cpp b/sakura_core/print/CPrintPreview.cpp index 6416235adc..f481916347 100644 --- a/sakura_core/print/CPrintPreview.cpp +++ b/sakura_core/print/CPrintPreview.cpp @@ -889,7 +889,7 @@ void CPrintPreview::OnPreviewGoDirectPage( void ) m_hwndPrintPreviewBar, LS(STR_ERR_DLGPRNPRVW5), szMessage, - INPUT_PAGE_NUM_LEN, + _countof(szPageNum) - 1, szPageNum ); if( FALSE != bDlgInputPageResult ){