| 754 | } |
| 755 | |
| 756 | bool CMainFrame::LoadViews(int line) |
| 757 | { |
| 758 | LoadIgnoreCommentData(); |
| 759 | m_Data.SetBlame(m_bBlame); |
| 760 | m_Data.SetMovedBlocks(m_bViewMovedBlocks); |
| 761 | m_bHasConflicts = false; |
| 762 | CBaseView* pwndActiveView = m_pwndLeftView; |
| 763 | int nOldLine = m_pwndRightView ? m_pwndRightView->m_nTopLine : -1; |
| 764 | int nOldLineNumber = |
| 765 | m_pwndRightView && m_pwndRightView->m_pViewData ? |
| 766 | m_pwndRightView->m_pViewData->GetLineNumber(m_pwndRightView->m_nTopLine) : -1; |
| 767 | POINT ptOldCaretPos = {-1, -1}; |
| 768 | if (m_pwndRightView && m_pwndRightView->IsTarget()) |
| 769 | ptOldCaretPos = m_pwndRightView->GetCaretPosition(); |
| 770 | if (m_pwndBottomView && m_pwndBottomView->IsTarget()) |
| 771 | ptOldCaretPos = m_pwndBottomView->GetCaretPosition(); |
| 772 | CString sExt = CPathUtils::GetFileExtFromPath(m_Data.m_baseFile.GetFilename()).MakeLower(); |
| 773 | sExt.TrimLeft(L"."); |
| 774 | auto sC = m_IgnoreCommentsMap.find(sExt); |
| 775 | if (sC == m_IgnoreCommentsMap.end()) |
| 776 | { |
| 777 | sExt = CPathUtils::GetFileExtFromPath(m_Data.m_yourFile.GetFilename()).MakeLower(); |
| 778 | sC = m_IgnoreCommentsMap.find(sExt); |
| 779 | if (sC == m_IgnoreCommentsMap.end()) |
| 780 | { |
| 781 | sExt = CPathUtils::GetFileExtFromPath(m_Data.m_theirFile.GetFilename()).MakeLower(); |
| 782 | sC = m_IgnoreCommentsMap.find(sExt); |
| 783 | } |
| 784 | } |
| 785 | if (sC != m_IgnoreCommentsMap.end()) |
| 786 | m_Data.SetCommentTokens(std::get<0>(sC->second), std::get<1>(sC->second), std::get<2>(sC->second)); |
| 787 | else |
| 788 | m_Data.SetCommentTokens(L"", L"", L""); |
| 789 | if (!m_Data.Load()) |
| 790 | { |
| 791 | m_pwndLeftView->BuildAllScreen2ViewVector(); |
| 792 | m_pwndLeftView->DocumentUpdated(); |
| 793 | m_pwndRightView->DocumentUpdated(); |
| 794 | m_pwndBottomView->DocumentUpdated(); |
| 795 | m_wndLocatorBar.DocumentUpdated(); |
| 796 | m_wndLineDiffBar.DocumentUpdated(); |
| 797 | ::MessageBox(m_hWnd, m_Data.GetError(), L"TortoiseGitMerge", MB_ICONERROR); |
| 798 | m_Data.m_mergedFile.SetOutOfUse(); |
| 799 | m_bSaveRequired = false; |
| 800 | return false; |
| 801 | } |
| 802 | SetWindowTitle(); |
| 803 | m_pwndLeftView->BuildAllScreen2ViewVector(); |
| 804 | m_pwndLeftView->DocumentUpdated(); |
| 805 | m_pwndRightView->DocumentUpdated(); |
| 806 | m_pwndBottomView->DocumentUpdated(); |
| 807 | m_wndLocatorBar.DocumentUpdated(); |
| 808 | m_wndLineDiffBar.DocumentUpdated(); |
| 809 | |
| 810 | m_pwndLeftView->SetWritable(false); |
| 811 | m_pwndLeftView->SetWritableIsChangable(false); |
| 812 | m_pwndLeftView->SetTarget(false); |
| 813 | m_pwndRightView->SetWritable(false); |
no test coverage detected