Clone
ixen <ixen@copyhandler.com>
committed
on 31 Jan 09
Fixed some warnings reported from the static code analysis (/analyze).
LoggerImprovements + 5 more
src/ch/AboutDlg.cpp (+9 -12)
41 41 }
42 42
43 43 BEGIN_MESSAGE_MAP(CAboutDlg,ictranslate::CLanguageDialog)
44 44         //{{AFX_MSG_MAP(CAboutDlg)
45 45         //}}AFX_MSG_MAP
46 46 END_MESSAGE_MAP()
47 47
48 48 void CAboutDlg::UpdateProgramVersion()
49 49 {
50 50         CWnd* pCtl = GetDlgItem(IDC_PROGRAM_STATICEX);
51 51         CWnd* pCtl2 = GetDlgItem(IDC_FULLVERSION_STATICEX);
52 52         CWnd* pWndCopyright = GetDlgItem(IDC_COPYRIGHT_STATIC);
53 53         CWnd* pctlSite = GetDlgItem(IDC_HOMEPAGELINK_STATIC);
54 54         CWnd* pctlLanguage = GetDlgItem(IDC_LANGUAGE_STATIC);
55 55         CWnd* pctlContact = GetDlgItem(IDC_CONTACT1LINK_STATIC);
56 56
57 57         if (!pCtl || !pCtl2 || !pWndCopyright || !pctlSite || !pctlLanguage || !pctlContact)
58 58                 return;
59 59
60 60         // Readable version
61           pCtl->SetWindowText(GetApp()->GetAppNameVer());
  61         pCtl->SetWindowText(GetApp().GetAppNameVer());
62 62
63 63         // full version
64 64         CString strText;
65           strText.Format(_T("%s: %ld.%ld.%ld.%ld"), GetResManager()->LoadString(IDS_ABOUTVERSION_STRING),
  65         strText.Format(_T("%s: %ld.%ld.%ld.%ld"), GetResManager().LoadString(IDS_ABOUTVERSION_STRING),
66 66                 PRODUCT_VERSION1, PRODUCT_VERSION2, PRODUCT_VERSION3, PRODUCT_VERSION4);
67 67         pCtl2->SetWindowText(strText);
68 68         // Copyright information
69 69         pWndCopyright->SetWindowText(_T(COPYRIGHT_INFO));
70 70
71 71         // web page link
72 72         pctlSite->SetWindowText(_T(PRODUCT_SITE) _T("|") _T(PRODUCT_SITE));
73 73         pctlContact->SetWindowText(_T(CONTACT_INFO) _T("|mailto:") _T(CONTACT_INFO));
74 74
75 75         // language information
76           ictranslate::CResourceManager* pResManager = GetResManager();
77           if(pResManager)
78           {
79                   const ictranslate::CLangData* pLangData = pResManager->GetLanguageData();
  76         ictranslate::CResourceManager& rResManager = GetResManager();
  77         const ictranslate::CLangData* pLangData = rResManager.GetLanguageData();
80 78         if(pLangData)
81 79         {
82                           ictranslate::CFormat fmt(pResManager->LoadString(IDS_ABOUT_LANGUAGE_STRING));
  80                 ictranslate::CFormat fmt(rResManager.LoadString(IDS_ABOUT_LANGUAGE_STRING));
83 81                 fmt.SetParam(_t("%langname"), pLangData->GetLangName());
84 82                 fmt.SetParam(_t("%authors"), pLangData->GetAuthor());
85 83
86 84                 pctlLanguage->SetWindowText(fmt);
87 85         }
88 86 }
89   }
90 87
91 88 BOOL CAboutDlg::OnInitDialog()
92 89 {
93 90         CLanguageDialog::OnInitDialog();
94 91
95 92         UpdateProgramVersion();
96 93
97 94         return TRUE;
98 95 }
99 96
100 97 void CAboutDlg::OnLanguageChanged()
101 98 {
102 99         UpdateProgramVersion();
103 100 }
104 101
105 102 BOOL CAboutDlg::OnTooltipText(UINT uiID, TOOLTIPTEXT* pTip)
106 103 {
107 104         switch(uiID)
108 105         {
109 106         case IDC_HOMEPAGELINK_STATIC: