Index: src/ch/ShortcutsDlg.cpp =================================================================== diff -u -N -r9ea1e103b5fa4ddfebf8028f121ce16e917eec04 -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 --- src/ch/ShortcutsDlg.cpp (.../ShortcutsDlg.cpp) (revision 9ea1e103b5fa4ddfebf8028f121ce16e917eec04) +++ src/ch/ShortcutsDlg.cpp (.../ShortcutsDlg.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) @@ -31,17 +31,11 @@ ///////////////////////////////////////////////////////////////////////////// // CShortcutsDlg dialog - CShortcutsDlg::CShortcutsDlg(CWnd* pParent /*=NULL*/) :ictranslate::CLanguageDialog(CShortcutsDlg::IDD, pParent) { - //{{AFX_DATA_INIT(CShortcutsDlg) - m_strName = _T(""); - //}}AFX_DATA_INIT - m_bActualisation=false; } - void CShortcutsDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); @@ -52,7 +46,6 @@ //}}AFX_DATA_MAP } - BEGIN_MESSAGE_MAP(CShortcutsDlg,ictranslate::CLanguageDialog) //{{AFX_MSG_MAP(CShortcutsDlg) ON_NOTIFY(LVN_ITEMCHANGED, IDC_SHORTCUT_LIST, OnItemchangedShortcutList) @@ -139,7 +132,7 @@ CShortcut sc; for(size_t stIndex = 0; stIndex < m_cvShortcuts.size(); ++stIndex) { - sc = CString(m_cvShortcuts.at(stIndex)); + sc = CShortcut(m_cvShortcuts.at(stIndex)); sfi.iIcon = -1; SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.InsertItem(boost::numeric_cast(stIndex), sc.m_strName, sfi.iIcon); @@ -307,12 +300,11 @@ void CShortcutsDlg::OnUpButton() { POSITION pos=m_ctlShortcuts.GetFirstSelectedItemPosition(); - int iPos=-1; CShortcut sc; while (pos) { // get current selected item - iPos=m_ctlShortcuts.GetNextSelectedItem(pos); + int iPos=m_ctlShortcuts.GetNextSelectedItem(pos); // if the first element is trying to go up to nowhere if (iPos == 0) @@ -328,13 +320,13 @@ SHFILEINFO sfi; sfi.iIcon=-1; - sc=CString(m_cvShortcuts.at(iPos-1)); + sc=CShortcut(m_cvShortcuts.at(iPos-1)); SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.SetItem(iPos-1, -1, LVIF_TEXT | LVIF_IMAGE , sc.m_strName, sfi.iIcon, 0, 0, 0); m_ctlShortcuts.SetItem(iPos-1, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); sfi.iIcon=-1; - sc=CString(m_cvShortcuts.at(iPos)); + sc=CShortcut(m_cvShortcuts.at(iPos)); SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.SetItem(iPos, -1, LVIF_TEXT | LVIF_IMAGE, sc.m_strName, sfi.iIcon, 0, 0, 0); m_ctlShortcuts.SetItem(iPos, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); @@ -347,12 +339,10 @@ void CShortcutsDlg::OnDownButton() { POSITION pos=m_ctlShortcuts.GetFirstSelectedItemPosition(); - int iPos=-1; - CShortcut sc; while (pos) { // get current selected item - iPos=m_ctlShortcuts.GetNextSelectedItem(pos); + int iPos=m_ctlShortcuts.GetNextSelectedItem(pos); // if the last element is trying to go down to nowhere if (iPos == m_ctlShortcuts.GetItemCount()-1) @@ -368,13 +358,13 @@ SHFILEINFO sfi; sfi.iIcon=-1; - sc=CString(m_cvShortcuts.at(iPos)); + CShortcut sc=CShortcut(m_cvShortcuts.at(iPos)); SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.SetItem(iPos, -1, LVIF_TEXT | LVIF_IMAGE , sc.m_strName, sfi.iIcon, 0, 0, 0); m_ctlShortcuts.SetItem(iPos, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); sfi.iIcon=-1; - sc=CString(m_cvShortcuts.at(iPos+1)); + sc=CShortcut(m_cvShortcuts.at(iPos+1)); SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); m_ctlShortcuts.SetItem(iPos+1, -1, LVIF_TEXT | LVIF_IMAGE, sc.m_strName, sfi.iIcon, 0, 0, 0); m_ctlShortcuts.SetItem(iPos+1, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0);