From 7262f701767895727b07a2ac70d712721de353aa Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 15 Aug 2016 15:09:12 +0900 Subject: [PATCH] Cppcheck: Member variable '...' is not initialized in the constructor. --- Src/Common/MessageBoxDialog.cpp | 37 ++++--------------------------------- Src/MainFrm.cpp | 1 + 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/Src/Common/MessageBoxDialog.cpp b/Src/Common/MessageBoxDialog.cpp index 9d7774b27..1857c0eb7 100644 --- a/Src/Common/MessageBoxDialog.cpp +++ b/Src/Common/MessageBoxDialog.cpp @@ -141,40 +141,11 @@ IMPLEMENT_DYNAMIC(CMessageBoxDialog, CDialog) */ CMessageBoxDialog::CMessageBoxDialog ( CWnd* pParent, UINT nMessageID, UINT nTitleID, UINT nStyle, UINT nHelp ) - : CDialog ( CMessageBoxDialog::IDD, pParent ) + : CMessageBoxDialog(pParent, + LoadResString(nMessageID).c_str(), + nTitleID == 0 ? AfxGetAppName() : LoadResString(nTitleID).c_str(), + nStyle, nHelp ) { - // Check whether a title was given. - if ( nTitleID == 0 ) - { - // Use the application name. - m_strTitle = AfxGetAppName(); - } - else - { - // Try to load the title from the resources. - m_strTitle = LoadResString(nTitleID); - } - - // Save the information about the message box. - m_strMessage = LoadResString(nMessageID); - m_nStyle = nStyle; - m_nHelp = nHelp; - - // Do the default initialization. - m_hIcon = NULL; - m_nTimeoutSeconds = 0; - m_bTimeoutDisabled = FALSE; - m_nTimeoutTimer = 0; - m_strRegistryKey = _T(""); - m_nDefaultButton = IDC_STATIC; - m_nEscapeButton = IDC_STATIC; - m_sDialogUnit = CSize(0, 0); - m_sIcon = CSize(0, 0); - m_sMessage = CSize(0, 0); - m_sCheckbox = CSize(0, 0); - m_sButton = CSize(0, 0); - - m_aButtons.clear(); } /* diff --git a/Src/MainFrm.cpp b/Src/MainFrm.cpp index dae67a55a..9cafaa7c1 100644 --- a/Src/MainFrm.cpp +++ b/Src/MainFrm.cpp @@ -289,6 +289,7 @@ static CPtrList &GetDocList(CMultiDocTemplate *pTemplate) CMainFrame::CMainFrame() : m_bFirstTime(TRUE) , m_pDropHandler(NULL) +, m_bShowErrors(false) { } -- 2.11.0