void CDirView::GetItemFileNames(int sel, CString& strLeft, CString& strRight) const
{
POSITION diffpos = GetItemKey(sel);
- if (diffpos == (POSITION)-1)
+ if (diffpos == (POSITION)SPECIAL_ITEM_POS)
{
strLeft.Empty();
strRight.Empty();
{
ASSERT(paths);
POSITION diffpos = GetItemKey(sel);
- if (diffpos == (POSITION)-1)
+ if (diffpos == (POSITION)SPECIAL_ITEM_POS)
{
paths->SetLeft(_T(""));
paths->SetRight(_T(""));
{
POSITION diffpos = GetItemKey(sel);
- // Browse to parent folder(s) selected, -1 is position for
+ // Browse to parent folder(s) selected, SPECIAL_ITEM_POS is position for
// special items, but there is currenly only one (parent folder)
- if (diffpos == (POSITION) -1)
+ if (diffpos == (POSITION) SPECIAL_ITEM_POS)
{
OpenParentDirectory();
break;
POSITION diffpos = GetItemKey(sel);
// If it is special item, return empty DIFFITEM
- if (diffpos == (POSITION) -1)
+ if (diffpos == (POSITION) SPECIAL_ITEM_POS)
{
static DIFFITEM item;
return item;
{
int i = AddNewItem(0);
SetImage(i, bEnable ? DIFFIMG_DIRUP : DIFFIMG_DIRUP_DISABLE);
- SetItemKey(i, (POSITION) -1);
+ SetItemKey(i, (POSITION) SPECIAL_ITEM_POS);
LV_ITEM lvItem;
lvItem.mask = LVIF_TEXT;
for (int i = 0; i < selCount; i++)
{
- // Don't select special items (POSITION -1)
+ // Don't select special items (SPECIAL_ITEM_POS)
POSITION diffpos = GetItemKey(i);
- if (diffpos != (POSITION) -1)
+ if (diffpos != (POSITION) SPECIAL_ITEM_POS)
m_pList->SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
}
}
namespace varprop { struct VariantValue; }
+/**
+ * @brief Position value for special items (..) in directory compare view.
+ */
+const int SPECIAL_ITEM_POS = -1;
+
/** Default column width in directory compare */
const UINT DefColumnWidth = 150;
-/** View displaying results of a diff, one row per file */
+/**
+ * @brief Directory compare results view.
+ *
+ * Directory compare view is list-view based, so it shows one result (for
+ * folder or file, commonly called as 'item') in one line. User can select
+ * visible columns, re-order columns, sort by column etc.
+ *
+ * Actual data is stored in CDiffContext in CDirDoc. Dircompare items and
+ * CDiffContext items are linked by storing POSITION of CDiffContext item
+ * as CDirView listitem key.
+ */
class CDirView : public CListViewEx
{
class DirItemEnumerator;
+2005-06-21 Kimmo
+ PATCH: [ 1224249 ] Use constant for dirview special items
+ Src: DirActions.cpp DirView.cpp DirView.h
+
2005-06-17 Kimmo
PATCH: [ 1221672 ] MergeSwedish. rc 1.207 update
Submitted by Hans Eriksson