Revision: 3620
http://svn.sourceforge.net/winmerge/?rev=3620&view=rev
Author: kimmov
Date: 2006-09-22 09:03:08 -0700 (Fri, 22 Sep 2006)
Log Message:
-----------
Some SPECIAL_ITEM_POS cleanups
Modified Paths:
--------------
trunk/Src/Changes.txt
trunk/Src/DirActions.cpp
trunk/Src/DirDoc.cpp
trunk/Src/DirView.cpp
trunk/Src/DirView.h
Modified: trunk/Src/Changes.txt
===================================================================
--- trunk/Src/Changes.txt 2006-09-22 15:28:28 UTC (rev 3619)
+++ trunk/Src/Changes.txt 2006-09-22 16:03:08 UTC (rev 3620)
@@ -15,6 +15,8 @@
Src/Languages/Spanish: MergeSpanish.rc
Quiet warnings from DiffList.cpp
Src: DiffList.cpp
+ Some SPECIAL_ITEM_POS cleanups
+ Src: DirActions.cpp DirDoc.cpp DirView.cpp DirView.h
2006-09-21 WinMerge experimental release 2.5.7.1 (SVN revision 3600)
Modified: trunk/Src/DirActions.cpp
===================================================================
--- trunk/Src/DirActions.cpp 2006-09-22 15:28:28 UTC (rev 3619)
+++ trunk/Src/DirActions.cpp 2006-09-22 16:03:08 UTC (rev 3620)
@@ -985,7 +985,7 @@
while ((sel = m_pList->GetNextItem(sel, LVNI_SELECTED)) != -1)
{
// Don't try to rescan special items
- if (GetItemKey(sel) == (POSITION)SPECIAL_ITEM_POS)
+ if (GetItemKey(sel) == SPECIAL_ITEM_POS)
continue;
DIFFITEM di = GetDiffItem(sel);
@@ -1181,7 +1181,7 @@
BOOL bRenameRight = RenameOnSameDir(sRightFile, szNewItemName);
POSITION key = GetItemKey(nSelItem);
- ASSERT(key != (POSITION)SPECIAL_ITEM_POS);
+ ASSERT(key != SPECIAL_ITEM_POS);
DIFFITEM& di = GetDocument()->GetDiffRefByKey(key);
if ((TRUE == bRenameLeft) && (TRUE == bRenameRight))
Modified: trunk/Src/DirDoc.cpp
===================================================================
--- trunk/Src/DirDoc.cpp 2006-09-22 15:28:28 UTC (rev 3619)
+++ trunk/Src/DirDoc.cpp 2006-09-22 16:03:08 UTC (rev 3620)
@@ -657,7 +657,7 @@
// so there really is not status to update.
if (pos > 0)
{
- int ind = m_pDirView->GetItemIndex((DWORD)pos);
+ int ind = m_pDirView->GetItemIndex(pos);
// Figure out new status code
UINT diffcode = (bIdentical ? DIFFCODE::SAME : DIFFCODE::DIFF);
Modified: trunk/Src/DirView.cpp
===================================================================
--- trunk/Src/DirView.cpp 2006-09-22 15:28:28 UTC (rev 3619)
+++ trunk/Src/DirView.cpp 2006-09-22 16:03:08 UTC (rev 3620)
@@ -930,7 +930,7 @@
// Now handle the various cases of what was selected
- if (pos1 == (POSITION) SPECIAL_ITEM_POS)
+ if (pos1 == SPECIAL_ITEM_POS)
{
if (!pos2)
{
@@ -1372,7 +1372,7 @@
POSITION diffpos = GetItemKey(sel);
// If it is special item, return empty DIFFITEM
- if (diffpos == (POSITION) SPECIAL_ITEM_POS)
+ if (diffpos == SPECIAL_ITEM_POS)
{
// TODO: It would be better if there were individual items
// for whatever these special items are
@@ -1405,12 +1405,12 @@
* @brief Given key, get index of item which has it stored.
* This function searches from list in UI.
*/
-int CDirView::GetItemIndex(DWORD key)
+int CDirView::GetItemIndex(POSITION key)
{
LVFINDINFO findInfo;
findInfo.flags = LVFI_PARAM; // Search for itemdata
- findInfo.lParam = key;
+ findInfo.lParam = (LPARAM)key;
return m_pList->FindItem(&findInfo);
}
@@ -2387,7 +2387,7 @@
*/
void CDirView::AddParentFolderItem(BOOL bEnable)
{
- AddNewItem(0, (POSITION) SPECIAL_ITEM_POS, bEnable ? DIFFIMG_DIRUP : DIFFIMG_DIRUP_DISABLE);
+ AddNewItem(0, SPECIAL_ITEM_POS, bEnable ? DIFFIMG_DIRUP : DIFFIMG_DIRUP_DISABLE);
}
/**
@@ -2487,7 +2487,7 @@
{
// Don't select special items (SPECIAL_ITEM_POS)
POSITION diffpos = GetItemKey(i);
- if (diffpos != (POSITION) SPECIAL_ITEM_POS)
+ if (diffpos != SPECIAL_ITEM_POS)
m_pList->SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
}
}
@@ -2894,7 +2894,7 @@
CString sIdx, sCnt;
// Don't show number to special items
POSITION pos = GetItemKey(focusItem);
- if (pos != (POSITION) SPECIAL_ITEM_POS)
+ if (pos != SPECIAL_ITEM_POS)
{
// If compare is non-recursive reduce special items count
BOOL bRecursive = GetDocument()->GetRecursive();
@@ -2985,7 +2985,7 @@
{
int nSelItem = m_pList->GetNextItem(-1, LVNI_SELECTED);
ASSERT(-1 != nSelItem);
- return ((POSITION)SPECIAL_ITEM_POS == GetItemKey(nSelItem));
+ return (SPECIAL_ITEM_POS == GetItemKey(nSelItem));
}
/**
Modified: trunk/Src/DirView.h
===================================================================
--- trunk/Src/DirView.h 2006-09-22 15:28:28 UTC (rev 3619)
+++ trunk/Src/DirView.h 2006-09-22 16:03:08 UTC (rev 3620)
@@ -69,7 +69,7 @@
/**
* @brief Position value for special items (..) in directory compare view.
*/
-const int SPECIAL_ITEM_POS = -1;
+const POSITION SPECIAL_ITEM_POS = (POSITION)-1L;
/** Default column width in directory compare */
const UINT DefColumnWidth = 150;
@@ -109,7 +109,7 @@
void UpdateResources();
void LoadColumnHeaderItems();
POSITION GetItemKey(int idx) const;
- int GetItemIndex(DWORD key);
+ int GetItemIndex(POSITION key);
// for populating list
void DeleteAllDisplayItems();
void SetColumnWidths();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|