[Winmerge-svn] SF.net SVN: winmerge: [3978] branches/R2_6/Src
Windows visual diff and merge for files and directories
Brought to you by:
christianlist,
grimmdp
From: <ki...@us...> - 2006-12-18 22:50:27
|
Revision: 3978 http://svn.sourceforge.net/winmerge/?rev=3978&view=rev Author: kimmov Date: 2006-12-18 14:50:24 -0800 (Mon, 18 Dec 2006) Log Message: ----------- BUG: [ 1602219 ] Crappy save of project files Modified Paths: -------------- branches/R2_6/Src/Changes.txt branches/R2_6/Src/MainFrm.cpp branches/R2_6/Src/ProjectFilePathsDlg.cpp Modified: branches/R2_6/Src/Changes.txt =================================================================== --- branches/R2_6/Src/Changes.txt 2006-12-18 21:07:47 UTC (rev 3977) +++ branches/R2_6/Src/Changes.txt 2006-12-18 22:50:24 UTC (rev 3978) @@ -2,6 +2,10 @@ Add new items to top. (This summarizes all changes to all files under Src, including Src\Languages.) +2006-12-18 Kimmo + BUG: [ 1602219 ] Crappy save of project files + Src: MainFrm.cpp ProjectFilePathsDlg.cpp + 2006-12-14 2.6.2 Stable Release (R3963) 2006-12-12 Kimmo Modified: branches/R2_6/Src/MainFrm.cpp =================================================================== --- branches/R2_6/Src/MainFrm.cpp 2006-12-18 21:07:47 UTC (rev 3977) +++ branches/R2_6/Src/MainFrm.cpp 2006-12-18 22:50:24 UTC (rev 3978) @@ -3003,6 +3003,8 @@ /** * @brief Opens dialog for user to Load, edit and save project files. + * This dialog gets current compare paths and filter (+other properties + * possible in project files) and initializes the dialog with them. */ void CMainFrame::OnSaveProject() { @@ -3028,15 +3030,16 @@ } else if (bDirFrame) { + // Get paths currently in compare CDirDoc * pDoc = (CDirDoc*)pFrame->GetActiveDocument(); - CDirView *pView = pDoc->GetMainView(); - // Use first item if no item is selected. - int ind = max(pView->GetFirstSelectedInd(), 0); - const DIFFITEM item = pView->GetItemAt(ind); - left = item.getLeftFilepath(pDoc->GetLeftBasePath()); - left += "\\"; - right = item.getRightFilepath(pDoc->GetRightBasePath()); - right += "\\"; + left = pDoc->GetLeftBasePath(); + right = pDoc->GetRightBasePath(); + if (!paths_EndsWithSlash(left)) + left += _T("\\"); + if (!paths_EndsWithSlash(right)) + right += _T("\\"); + + // Set-up the dialog pathsDlg.SetPaths(left, right); pathsDlg.m_bIncludeSubfolders = pDoc->GetRecursive(); pathsDlg.m_bLeftPathReadOnly = pDoc->GetReadOnly(TRUE); Modified: branches/R2_6/Src/ProjectFilePathsDlg.cpp =================================================================== --- branches/R2_6/Src/ProjectFilePathsDlg.cpp 2006-12-18 21:07:47 UTC (rev 3977) +++ branches/R2_6/Src/ProjectFilePathsDlg.cpp 2006-12-18 22:50:24 UTC (rev 3978) @@ -207,16 +207,30 @@ /** * @brief Set paths for dialog. - * This function is used to set paths from outside the dialog. + * This function is used to set paths from outside the dialog. The dialog + * only accepts existing paths, as we expect paths coming from existing + * compare windows. * @param [in] left Left path. * @param [in] right Right path. */ void ProjectFilePathsDlg::SetPaths(LPCTSTR left, LPCTSTR right) { if (left != NULL) - m_sLeftFile = left; + { + PATH_EXISTENCE pe = paths_DoesPathExist(left); + if (pe != DOES_NOT_EXIST) + { + m_sLeftFile = left; + } + } if (right != NULL) - m_sRightFile = right; + { + PATH_EXISTENCE pe = paths_DoesPathExist(right); + if (pe != DOES_NOT_EXIST) + { + m_sRightFile = right; + } + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |