Thread: [Winmerge-svn] SF.net SVN: winmerge:[5763] trunk/Src/DirViewColItems.cpp
Windows visual diff and merge for files and directories
Brought to you by:
christianlist,
grimmdp
From: <ki...@us...> - 2008-08-08 06:46:33
|
Revision: 5763 http://winmerge.svn.sourceforge.net/winmerge/?rev=5763&view=rev Author: kimmov Date: 2008-08-08 06:46:30 +0000 (Fri, 08 Aug 2008) Log Message: ----------- Fix std::string::find() return value checking (must check against std::string.npos). Modified Paths: -------------- trunk/Src/DirViewColItems.cpp Modified: trunk/Src/DirViewColItems.cpp =================================================================== --- trunk/Src/DirViewColItems.cpp 2008-08-08 05:32:15 UTC (rev 5762) +++ trunk/Src/DirViewColItems.cpp 2008-08-08 06:46:30 UTC (rev 5763) @@ -214,14 +214,13 @@ { int i_ahead = s.find('\\', i); int j_ahead = t.find('\\', j); - int length_s = (i_ahead != -1 ? i_ahead : s.length()) - i; - int length_t = (j_ahead != -1 ? j_ahead : t.length()) - j; + int length_s = (i_ahead != std::string.npos ? i_ahead : s.length()) - i; + int length_t = (j_ahead != std::string.npos ? j_ahead : t.length()) - j; if (length_s != length_t || !StrIsIntlEqual(FALSE, s.c_str() + i, t.c_str() + j, length_s)) { String u(t.c_str() + j, length_t + 1); u[length_t] = '|'; - //u.SetAt(length_t, '|'); s.insert(i, u.c_str()); i_ahead += u.length(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ki...@us...> - 2008-10-21 19:11:37
|
Revision: 6027 http://winmerge.svn.sourceforge.net/winmerge/?rev=6027&view=rev Author: kimmov Date: 2008-10-21 19:11:35 +0000 (Tue, 21 Oct 2008) Log Message: ----------- Small cleanup - use countof() macro to calculate array size. Modified Paths: -------------- trunk/Src/DirViewColItems.cpp Modified: trunk/Src/DirViewColItems.cpp =================================================================== --- trunk/Src/DirViewColItems.cpp 2008-10-21 19:00:39 UTC (rev 6026) +++ trunk/Src/DirViewColItems.cpp 2008-10-21 19:11:35 UTC (rev 6027) @@ -887,7 +887,7 @@ const DirColInfo * CDirView::DirViewColItems_GetDirColInfo(int col) const { - if (col < 0 || col >= sizeof(f_cols)/sizeof(f_cols[0])) + if (col < 0 || col >= countof(f_cols)) { ASSERT(0); // fix caller, should not ask for nonexistent columns return 0; @@ -901,7 +901,7 @@ static bool IsColById(int col, int id) { - if (col < 0 || col >= sizeof(f_cols)/sizeof(f_cols[0])) + if (col < 0 || col >= countof(f_cols)) { ASSERT(0); // fix caller, should not ask for nonexistent columns return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sdo...@us...> - 2009-03-10 20:22:10
|
Revision: 6560 http://winmerge.svn.sourceforge.net/winmerge/?rev=6560&view=rev Author: sdottaka Date: 2009-03-10 20:21:41 +0000 (Tue, 10 Mar 2009) Log Message: ----------- BUG: [ 2670046 ] Extension Column is Empty.(2) - Extension column was not sortable. Modified Paths: -------------- trunk/Src/DirViewColItems.cpp Modified: trunk/Src/DirViewColItems.cpp =================================================================== --- trunk/Src/DirViewColItems.cpp 2009-03-10 20:10:48 UTC (rev 6559) +++ trunk/Src/DirViewColItems.cpp 2009-03-10 20:21:41 UTC (rev 6560) @@ -647,10 +647,13 @@ */ static int ColExtSort(const CDiffContext *pCtxt, const void *p, const void *q) { - const String &r = *static_cast<const String*>(p); - const String &s = *static_cast<const String*>(q); - return lstrcmpi(PathFindExtension(r.c_str()), PathFindExtension(s.c_str())); - //return ColExtGet(pCtxt, p).CompareNoCase(ColExtGet(pCtxt, q)); + const DIFFITEM &ldi = *static_cast<const DIFFITEM *>(p); + const DIFFITEM &rdi = *static_cast<const DIFFITEM *>(q); + if (ldi.diffcode.isDirectory() && !rdi.diffcode.isDirectory()) + return -1; + if (!ldi.diffcode.isDirectory() && rdi.diffcode.isDirectory()) + return 1; + return lstrcmpi(ColExtGet(pCtxt, p).c_str(), ColExtGet(pCtxt, q).c_str()); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jt...@us...> - 2010-06-02 14:51:50
|
Revision: 7175 http://winmerge.svn.sourceforge.net/winmerge/?rev=7175&view=rev Author: jtuc Date: 2010-06-02 14:51:43 +0000 (Wed, 02 Jun 2010) Log Message: ----------- VC2010 does not accept a dot to serve as a class resolution operator Modified Paths: -------------- trunk/Src/DirViewColItems.cpp Modified: trunk/Src/DirViewColItems.cpp =================================================================== --- trunk/Src/DirViewColItems.cpp 2010-06-02 06:24:43 UTC (rev 7174) +++ trunk/Src/DirViewColItems.cpp 2010-06-02 14:51:43 UTC (rev 7175) @@ -228,8 +228,8 @@ { int i_ahead = s.find('\\', i); int j_ahead = t.find('\\', j); - int length_s = (i_ahead != std::string.npos ? i_ahead : s.length()) - i; - int length_t = (j_ahead != std::string.npos ? j_ahead : t.length()) - j; + int length_s = (i_ahead != String::npos ? i_ahead : s.length()) - i; + int length_t = (j_ahead != String::npos ? j_ahead : t.length()) - j; if (length_s != length_t || !StrIsIntlEqual(FALSE, s.c_str() + i, t.c_str() + j, length_s)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |