#include "stdafx.h"
#include "LoadSaveCodepageDlg.h"
#include "resource.h"
-#include "unicoder.h"
#include "ExConverter.h"
#ifdef _DEBUG
// CLoadSaveCodepageDlg dialog
-CLoadSaveCodepageDlg::CLoadSaveCodepageDlg(int nFiles, CWnd* pParent /*=NULL*/)
+CLoadSaveCodepageDlg::CLoadSaveCodepageDlg(int nFiles, CWnd* pParent /*= nullptr*/)
: CTrDialog(CLoadSaveCodepageDlg::IDD, pParent)
, m_bAffectsLeft(true)
, m_bAffectsMiddle(true)
, m_bLoadSaveSameCodepage(true)
// String m_sAffectsLeftString
// String m_sAffectsRightString
+, m_bSaveCodepageBOM(false)
, m_nLoadCodepage(-1)
, m_nSaveCodepage(-1)
, m_bEnableSaveCodepage(false)
DDX_Control(pDX, IDC_AFFECTS_RIGHT_BTN, m_AffectsRightBtn);
DDX_Text(pDX, IDC_LOAD_CODEPAGE_TEXTBOX, m_nLoadCodepage);
DDX_Text(pDX, IDC_SAVE_CODEPAGE_TEXTBOX, m_nSaveCodepage);
+ DDX_Check(pDX, IDC_SAVE_CODEPAGE_BOM, m_bSaveCodepageBOM);
//}}AFX_DATA_MAP
}
CTrDialog::OnInitDialog();
IExconverter *pexconv = Exconverter::getInstance();
- if (pexconv != NULL)
+ if (pexconv != nullptr)
{
CComboBox combol, combos;
combol.Attach(::GetDlgItem(m_hWnd, IDC_LOAD_CODEPAGE_TEXTBOX));
std::vector<CodePageInfo> cpi = pexconv->enumCodePages();
for (size_t i = 0, j = 0; i < cpi.size(); i++)
{
- String desc = string_format(_T("%05d - %s"), cpi[i].codepage, cpi[i].desc.c_str());
+ String desc = strutils::format(_T("%05d - %s"), cpi[i].codepage, cpi[i].desc);
combol.AddString(desc.c_str());
combos.AddString(desc.c_str());
if (cpi[i].codepage == m_nLoadCodepage)
combos.Detach();
}
- AfxGetMainWnd()->CenterWindow(this);
+ CenterWindow();
SetDlgItemText(IDC_LEFT_FILES_LABEL, m_sAffectsLeftString);
SetDlgItemText(IDC_MIDDLE_FILES_LABEL, m_sAffectsMiddleString);
EnableDlgItem(IDC_LOAD_SAVE_SAME_CODEPAGE, false);
bool EnableSave = m_bEnableSaveCodepage && !m_bLoadSaveSameCodepage;
EnableDlgItem(IDC_SAVE_CODEPAGE_TEXTBOX, EnableSave);
+ EnableDlgItem(IDC_SAVE_CODEPAGE_BOM, EnableSave);
}
/**