OSDN Git Service

MergeLang.vcxproj*: Add *.po files for ShellExtension
[winmerge-jp/winmerge-jp.git] / Src / DirColsDlg.cpp
index 80d3fe4..9adda03 100644 (file)
@@ -22,7 +22,7 @@
  * @brief Default dialog constructor.
  * @param [in] pParent Dialog's parent component (window).
  */
-CDirColsDlg::CDirColsDlg(CWnd* pParent /*=NULL*/)
+CDirColsDlg::CDirColsDlg(CWnd* pParent /*= nullptr*/)
        : CTrDialog(CDirColsDlg::IDD, pParent)
        , m_bReset(false)
 {
@@ -62,7 +62,7 @@ void CDirColsDlg::InitList()
        // Show selection across entire row.
        // Also enable infotips.
        m_listColumns.SetExtendedStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
-       m_listColumns.InsertColumn(0, _T(""), LVCFMT_LEFT, pointToPixel(112));
+       m_listColumns.InsertColumn(0, _T(""), LVCFMT_LEFT, pointToPixel(148));
 }
 
 /**
@@ -151,7 +151,7 @@ void CDirColsDlg::MoveItem(int index, int newIndex)
 {
        // Get current column data
        String text =  m_listColumns.GetItemText(index, 0);
-       bool checked = m_listColumns.GetCheck(index);
+       bool checked = !!m_listColumns.GetCheck(index);
        UINT state = m_listColumns.GetItemState(index, LVIS_SELECTED);
        DWORD_PTR data = m_listColumns.GetItemData(index);
 
@@ -168,15 +168,15 @@ void CDirColsDlg::MoveItem(int index, int newIndex)
 
 /**
  * @brief Move selected items one position up or down.
- * @param [in] bUp If TRUE items are moved up,
- *  if FALSE items are moved down.
+ * @param [in] bUp If `true` items are moved up,
+ *  if `false` items are moved down.
  */
 void CDirColsDlg::MoveSelectedItems(bool bUp)
 {
        int firstInd = -1;
        POSITION pos = m_listColumns.GetFirstSelectedItemPosition();
 
-       while (pos)
+       while (pos != nullptr)
        {
                int ind = m_listColumns.GetNextSelectedItem(pos);
                int newInd = bUp ? ind - 1: ind + 1;
@@ -194,7 +194,7 @@ void CDirColsDlg::MoveSelectedItems(bool bUp)
  */
 void CDirColsDlg::OnUp()
 {
-       MoveSelectedItems(TRUE);
+       MoveSelectedItems(true);
 }
 
 /**
@@ -202,7 +202,7 @@ void CDirColsDlg::OnUp()
  */
 void CDirColsDlg::OnDown() 
 {
-       MoveSelectedItems(FALSE);
+       MoveSelectedItems(false);
 }
 
 /**
@@ -238,7 +238,7 @@ void CDirColsDlg::OnOK()
 
        for (int i = 0; i < m_listColumns.GetItemCount(); i++)
        {
-               bool checked = m_listColumns.GetCheck(i);
+               bool checked = !!m_listColumns.GetCheck(i);
                DWORD_PTR data = m_listColumns.GetItemData(i);
                column & col1 = m_cols[data];
                if (checked)
@@ -267,7 +267,7 @@ void CDirColsDlg::OnLvnItemchangedColdlgList(NMHDR *pNMHDR, LRESULT *pResult)
 {
        POSITION pos = m_listColumns.GetFirstSelectedItemPosition();
 
-       if (pos)
+       if (pos != nullptr)
        {
                int ind = m_listColumns.GetNextSelectedItem(pos);
                DWORD_PTR data = m_listColumns.GetItemData(ind);