-#if 0\r
-void CLogDlg::ResizeAllListCtrlCols()\r
-{\r
-\r
- const int nMinimumWidth = ICONITEMBORDER+16*4;\r
- int maxcol = ((CHeaderCtrl*)(m_LogList.GetDlgItem(0)))->GetItemCount()-1;\r
- int nItemCount = m_LogList.GetItemCount();\r
- TCHAR textbuf[MAX_PATH];\r
- CHeaderCtrl * pHdrCtrl = (CHeaderCtrl*)(m_LogList.GetDlgItem(0));\r
- if (pHdrCtrl)\r
- {\r
- for (int col = 0; col <= maxcol; col++)\r
- {\r
- HDITEM hdi = {0};\r
- hdi.mask = HDI_TEXT;\r
- hdi.pszText = textbuf;\r
- hdi.cchTextMax = sizeof(textbuf);\r
- pHdrCtrl->GetItem(col, &hdi);\r
- int cx = m_LogList.GetStringWidth(hdi.pszText)+20; // 20 pixels for col separator and margin\r
- for (int index = 0; index<nItemCount; ++index)\r
- {\r
- // get the width of the string and add 14 pixels for the column separator and margins\r
- int linewidth = m_LogList.GetStringWidth(m_LogList.GetItemText(index, col)) + 14;\r
- if (index < m_arShownList.GetCount())\r
- {\r
- GitRev * pCurLogEntry = reinterpret_cast<GitRev*>(m_arShownList.GetAt(index));\r
- if ((pCurLogEntry)&&(pCurLogEntry->m_CommitHash == m_wcRev.m_CommitHash))\r
- {\r
- // set the bold font and ask for the string width again\r
- m_LogList.SendMessage(WM_SETFONT, (WPARAM)m_boldFont, NULL);\r
- linewidth = m_LogList.GetStringWidth(m_LogList.GetItemText(index, col)) + 14;\r
- // restore the system font\r
- m_LogList.SendMessage(WM_SETFONT, NULL, NULL);\r
- }\r
- }\r
- if (index == 0)\r
- {\r
- // add the image size\r
- CImageList * pImgList = m_LogList.GetImageList(LVSIL_SMALL);\r
- if ((pImgList)&&(pImgList->GetImageCount()))\r
- {\r
- IMAGEINFO imginfo;\r
- pImgList->GetImageInfo(0, &imginfo);\r
- linewidth += (imginfo.rcImage.right - imginfo.rcImage.left);\r
- linewidth += 3; // 3 pixels between icon and text\r
- }\r
- }\r
- if (cx < linewidth)\r
- cx = linewidth;\r
- }\r
- // Adjust columns "Actions" containing icons\r
- if (col == this->LOGLIST_ACTION)\r
- {\r
- if (cx < nMinimumWidth)\r
- {\r
- cx = nMinimumWidth;\r
- }\r
- }\r
- \r
- if (col == this->LOGLIST_MESSAGE)\r
- {\r
- if (cx > LOGLIST_MESSAGE_MAX)\r
- {\r
- cx = LOGLIST_MESSAGE_MAX;\r
- }\r
-\r
- }\r
- // keep the bug id column small\r
- if ((col == 4)&&(m_bShowBugtraqColumn))\r
- {\r
- if (cx > (int)(DWORD)m_regMaxBugIDColWidth)\r
- {\r
- cx = (int)(DWORD)m_regMaxBugIDColWidth;\r
- }\r
- }\r
-\r
- m_LogList.SetColumnWidth(col, cx);\r
- }\r
- }\r
-\r
-}\r
-#endif\r
-\r