Revision: 4037
http://svn.sourceforge.net/winmerge/?rev=4037&view=rev
Author: galh
Date: 2007-01-12 01:18:47 -0800 (Fri, 12 Jan 2007)
Log Message:
-----------
BUG: [ 1597939 ] Rename Edits Wrong Field in Folder Compare List
Modified Paths:
--------------
branches/R2_6/Src/Changes.txt
branches/R2_6/Src/DirView.cpp
Modified: branches/R2_6/Src/Changes.txt
===================================================================
--- branches/R2_6/Src/Changes.txt 2007-01-12 09:11:08 UTC (rev 4036)
+++ branches/R2_6/Src/Changes.txt 2007-01-12 09:18:47 UTC (rev 4037)
@@ -3,6 +3,10 @@
(This summarizes all changes to all files under Src, including Src\Languages.)
2007-01-12 Gal
+ BUG: [ 1597939 ] Rename Edits Wrong Field in Folder Compare List
+ Src: DirView.cpp
+
+2007-01-12 Gal
PATCH: [ 1633194 ] Add editor tab setting to configuration log
Src: ConfigLog.cpp ConfigLog.h MainFrm.cpp
Modified: branches/R2_6/Src/DirView.cpp
===================================================================
--- branches/R2_6/Src/DirView.cpp 2007-01-12 09:11:08 UTC (rev 4036)
+++ branches/R2_6/Src/DirView.cpp 2007-01-12 09:18:47 UTC (rev 4037)
@@ -2804,18 +2804,22 @@
*
* Disable label edit if initiated from a user double-click.
*/
-afx_msg void CDirView::OnBeginLabelEdit(NMHDR* /*pNMHDR*/, LRESULT* pResult)
+afx_msg void CDirView::OnBeginLabelEdit(NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = IsItemSelectedSpecial();
// If label edit is allowed.
if (FALSE == *pResult)
{
- CEdit *pEdit = m_pList->GetEditControl();
- ASSERT(NULL != pEdit);
+ const NMLVDISPINFO *pdi = (NMLVDISPINFO*)pNMHDR;
+ ASSERT(pdi != NULL);
- CString sText;
- pEdit->GetWindowText(sText);
+ // Locate the edit box on the right column in case the user changed the
+ // column order.
+ const int nColPos = ColLogToPhys(0);
+
+ // Get text from the "File Name" column.
+ CString sText = m_pList->GetItemText(pdi->item.iItem, nColPos);
ASSERT(!sText.IsEmpty());
// Keep only left file name (separated by '|'). This form occurs
@@ -2824,9 +2828,13 @@
if (-1 != nPos)
{
sText = sText.Left(nPos);
- pEdit->SetWindowText(sText);
}
+ // Set the edit control with the updated text.
+ CEdit *pEdit = m_pList->GetEditControl();
+ ASSERT(NULL != pEdit);
+ pEdit->SetWindowText(sText);
+
m_bUserCancelEdit = FALSE;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|