@brief Return active merge edit view, if can figure it out/is available */
| 1995 | |
| 1996 | /** @brief Return active merge edit view, if can figure it out/is available */ |
| 1997 | CMergeEditView * CMainFrame::GetActiveMergeEditView() |
| 1998 | { |
| 1999 | // NB: GetActiveDocument does not return the Merge Doc |
| 2000 | // even when the merge edit view is in front |
| 2001 | // NB: CMergeEditFrame::GetActiveView returns `nullptr` when location view active |
| 2002 | // So we have this rather complicated logic to try to get a merge edit view |
| 2003 | // We look at the front child window, which should be a frame |
| 2004 | // and we can get a MergeEditView from it, if it is a CMergeEditFrame |
| 2005 | // (DirViews use a different frame type) |
| 2006 | CMergeEditFrame * pFrame = dynamic_cast<CMergeEditFrame *>(GetActiveFrame()); |
| 2007 | if (pFrame == nullptr) return nullptr; |
| 2008 | // Try to get the active MergeEditView (ie, left or right) |
| 2009 | if (pFrame->GetActiveView() != nullptr && pFrame->GetActiveView()->IsKindOf(RUNTIME_CLASS(CMergeEditView))) |
| 2010 | { |
| 2011 | return dynamic_cast<CMergeEditView *>(pFrame->GetActiveView()); |
| 2012 | } |
| 2013 | return pFrame->GetMergeDoc()->GetActiveMergeView(); |
| 2014 | } |
| 2015 | |
| 2016 | void CMainFrame::UpdatePrediffersMenu(CMenu* pPredifferMenu) |
| 2017 | { |
nothing calls this directly
no test coverage detected