* ChangeUI should warn when it cannot find a dialog.

* CDialogTemplate::Save needs to free the template with the correct function.


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6535 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2014-08-05 13:53:20 +00:00
parent b7630502dc
commit fd6400d44d
7 changed files with 21 additions and 30 deletions

View file

@ -281,17 +281,12 @@ int CDialogTemplate::RemoveItem(WORD wId) {
// Sets the font of the dialog
void CDialogTemplate::SetFont(TCHAR* szFaceName, WORD wFontSize) {
if (_tcscmp(szFaceName, _T("MS Shell Dlg"))) {
// not MS Shell Dlg
m_dwStyle &= ~DS_SHELLFONT;
}
else {
// MS Shell Dlg
m_dwStyle &= ~DS_SHELLFONT;
if (!_tcscmp(szFaceName, _T("MS Shell Dlg"))) // TODO: "MS Shell Dlg 2"?
m_dwStyle |= DS_SHELLFONT;
}
m_bCharset = DEFAULT_CHARSET;
m_dwStyle |= DS_SETFONT;
if (m_szFont) free(m_szFont);
m_bCharset = DEFAULT_CHARSET;
free(m_szFont);
m_szFont = WinWStrDupFromTChar(szFaceName, m_uCodePage);
m_sFontSize = wFontSize;
}
@ -334,7 +329,7 @@ HWND CDialogTemplate::CreateDummyDialog() {
DWORD dwTemp;
BYTE* pbDlg = Save(dwTemp);
HWND hDlg = CreateDialogIndirect(GetModuleHandle(0), (DLGTEMPLATE*)pbDlg, 0, 0);
delete [] pbDlg;
FreeSavedTemplate(pbDlg);
if (!hDlg)
throw runtime_error("Can't create dialog from template!");