CPoint ptClient = point;
ScreenToClient(&ptClient);
int index = GetItemIndexFromPoint(ptClient);
- if (index < 0) return;
+ if (index < 0)
+ return;
TCITEM tci;
tci.mask = TCIF_PARAM;
// Check if we got 'ESC pressed' -message
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_ESCAPE))
{
- int nEscCloses = GetOptionsMgr()->GetInt(OPT_CLOSE_WITH_ESC);
- if ((theApp.m_bEscShutdown || nEscCloses == 3) && m_wndTabBar.GetItemCount() <= 1)
+ const int nEscCloses = GetOptionsMgr()->GetInt(OPT_CLOSE_WITH_ESC);
+ if ((theApp.m_bEscShutdown || 3 == nEscCloses) && m_wndTabBar.GetItemCount() <= 1)
{
AfxGetMainWnd()->SendMessage(WM_COMMAND, ID_APP_EXIT);
return TRUE;
}
- else if (nEscCloses == 1 && m_wndTabBar.GetItemCount() == 0)
+ else if (1 == nEscCloses && 0 == m_wndTabBar.GetItemCount())
{
AfxGetMainWnd()->PostMessage(WM_COMMAND, ID_APP_EXIT);
return FALSE;
}
}
- m_arrChild.InsertAt(0, (CMDIChildWnd*)lParam);
+ m_arrChild.InsertAt(0, reinterpret_cast<CMDIChildWnd*>(lParam));
return 1;
}
}
}
- m_arrChild.InsertAt(0, (CMDIChildWnd*)lParam);
+ m_arrChild.InsertAt(0, reinterpret_cast<CMDIChildWnd*>(lParam));
return 1;
}
const std::vector<std::wstring>& events, bool addAllMenu, unsigned baseId);
static String GetPluginPipelineByMenuId(unsigned idSearch, const std::vector<std::wstring>& events, unsigned baseId);
DropHandler *GetDropHandler() const { return m_pDropHandler; }
- const CTypedPtrArray<CPtrArray, CMDIChildWnd*>* GetChildArray() const { return &m_arrChild; }
+ const CTypedPtrArray<CPtrArray, CMDIChildWnd*>& GetChildArray() const { return m_arrChild; }
IMergeDoc* GetActiveIMergeDoc();
DirWatcher* GetDirWatcher() { return m_pDirWatcher.get(); }
void WatchDocuments(IMergeDoc* pMergeDoc);
m_List.DeleteAllItems();
CString sText;
- const CTypedPtrArray<CPtrArray, CMDIChildWnd*>* pArrChild = m_pFrame->GetChildArray();
- for (int i = 0; i < pArrChild->GetSize(); ++i)
+ const CTypedPtrArray<CPtrArray, CMDIChildWnd*>& arrChild = m_pFrame->GetChildArray();
+ for (int i = 0; i < arrChild.GetSize(); ++i)
{
sText.Empty();
- HICON hIcon = pArrChild->GetAt(i)->GetIcon(FALSE);
+ HICON hIcon = arrChild.GetAt(i)->GetIcon(FALSE);
if (NULL == hIcon)
{
- hIcon = pArrChild->GetAt(i)->GetIcon(TRUE);
+ hIcon = arrChild.GetAt(i)->GetIcon(TRUE);
if (NULL == hIcon)
hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
m_pIL->Add(hIcon);
- const CDocument* pDoc = pArrChild->GetAt(i)->GetActiveDocument();
+ const CDocument* pDoc = arrChild.GetAt(i)->GetActiveDocument();
if (nullptr != pDoc)
sText = pDoc->GetPathName();
if (sText.IsEmpty())
- pArrChild->GetAt(i)->GetWindowText(sText);
+ arrChild.GetAt(i)->GetWindowText(sText);
m_List.InsertItem(i, sText, m_pIL->GetImageCount() - 1);
- m_List.SetItemData(i, reinterpret_cast<DWORD_PTR>(pArrChild->GetAt(i)));
+ m_List.SetItemData(i, reinterpret_cast<DWORD_PTR>(arrChild.GetAt(i)));
}
}
// adjust size to listctrl column and dialog