[Winmerge-svn] SF.net SVN: winmerge:[5787] branches/R2_10
Windows visual diff and merge for files and directories
Brought to you by:
christianlist,
grimmdp
From: <ki...@us...> - 2008-08-11 08:39:16
|
Revision: 5787 http://winmerge.svn.sourceforge.net/winmerge/?rev=5787&view=rev Author: kimmov Date: 2008-08-11 08:39:04 +0000 (Mon, 11 Aug 2008) Log Message: ----------- BUG: [ 2027325 ] "Syntax Highlight" menu item enabled, if option disabled Modified Paths: -------------- branches/R2_10/Docs/Users/ChangeLog.txt branches/R2_10/Src/MergeDoc.cpp branches/R2_10/Src/MergeEditView.cpp Modified: branches/R2_10/Docs/Users/ChangeLog.txt =================================================================== --- branches/R2_10/Docs/Users/ChangeLog.txt 2008-08-11 03:28:03 UTC (rev 5786) +++ branches/R2_10/Docs/Users/ChangeLog.txt 2008-08-11 08:39:04 UTC (rev 5787) @@ -31,6 +31,8 @@ BugFix: Deleting/Moving file crashed WinMerge in debugger (#2025833) BugFix: External editor command line switches did not work (#2037862) BugFix: Editing line filters updated wrong filter (#2025130) + BugFix: Could change syntax highlight mode when highlighting was + disabled from options (#2027325) Translation updates: - Chinese Traditional (#2039929) Modified: branches/R2_10/Src/MergeDoc.cpp =================================================================== --- branches/R2_10/Src/MergeDoc.cpp 2008-08-11 03:28:03 UTC (rev 5786) +++ branches/R2_10/Src/MergeDoc.cpp 2008-08-11 08:39:04 UTC (rev 5787) @@ -2238,10 +2238,18 @@ sextL = GetFileExt(sLeftFile.c_str(), m_strDesc[0].c_str()); sextR = GetFileExt(sRightFile.c_str(), m_strDesc[1].c_str()); } - BOOL bLeftTyped = pLeft->SetTextType(sextL.c_str()); + + BOOL syntaxHLEnabled = GetOptionsMgr()->GetBool(OPT_SYNTAX_HIGHLIGHT); + BOOL bLeftTyped = FALSE; + BOOL bRightTyped = FALSE; + + if (syntaxHLEnabled) + { + bLeftTyped = pLeft->SetTextType(sextL.c_str()); pLeftDetail->SetTextType(sextL.c_str()); - BOOL bRightTyped = pRight->SetTextType(sextR.c_str()); + bRightTyped = pRight->SetTextType(sextR.c_str()); pRightDetail->SetTextType(sextR.c_str()); + } // If other side didn't have recognized texttype, apply recognized // type to unrecognized one. (comparing file.cpp and file.bak applies Modified: branches/R2_10/Src/MergeEditView.cpp =================================================================== --- branches/R2_10/Src/MergeEditView.cpp 2008-08-11 03:28:03 UTC (rev 5786) +++ branches/R2_10/Src/MergeEditView.cpp 2008-08-11 08:39:04 UTC (rev 5787) @@ -2320,6 +2320,9 @@ SetSelectionMargin(GetOptionsMgr()->GetBool(OPT_VIEW_FILEMARGIN)); + if (!GetOptionsMgr()->GetBool(OPT_SYNTAX_HIGHLIGHT)) + SetTextType(CCrystalTextView::TextType::SRC_PLAIN); + SetWordWrapping(GetOptionsMgr()->GetBool(OPT_WORDWRAP)); SetViewLineNumbers(GetOptionsMgr()->GetBool(OPT_VIEW_LINENUMBERS)); m_cachedColors.clrDiff = GetOptionsMgr()->GetInt(OPT_CLR_DIFF); @@ -3242,7 +3245,11 @@ const bool bIsCurrentScheme = (m_CurSourceDef->type == (pCmdUI->m_nID - ID_COLORSCHEME_FIRST)); pCmdUI->SetRadio(bIsCurrentScheme); - pCmdUI->Enable(TRUE); + BOOL syntaxHLEnabled = GetOptionsMgr()->GetBool(OPT_SYNTAX_HIGHLIGHT); + if (syntaxHLEnabled) + pCmdUI->Enable(TRUE); + else + pCmdUI->Enable(FALSE); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |