From 241f961533f02cfa17d51738c4b7c36d32f0f51d Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sun, 20 Aug 2023 13:25:03 +0900 Subject: [PATCH] Remove far modifier and _MFC_VER --- .../renderers/ccrystalrendererdirectwrite.cpp | 2 +- Src/Common/CMoveConstraint.cpp | 2 +- Src/Common/CMoveConstraint.h | 2 +- Src/Common/scbarcf.cpp | 4 ++-- Src/Common/scbarg.cpp | 2 +- Src/Common/scbarg.h | 11 +---------- Src/Common/sizecbar.cpp | 10 +++++----- Src/Common/sizecbar.h | 19 +++++-------------- Src/MainFrm.cpp | 8 -------- Src/MainFrm.h | 4 ---- Src/MergeFrameCommon.cpp | 2 -- 11 files changed, 17 insertions(+), 49 deletions(-) diff --git a/Externals/crystaledit/editlib/renderers/ccrystalrendererdirectwrite.cpp b/Externals/crystaledit/editlib/renderers/ccrystalrendererdirectwrite.cpp index a53ba4867f3..ed28160e545 100644 --- a/Externals/crystaledit/editlib/renderers/ccrystalrendererdirectwrite.cpp +++ b/Externals/crystaledit/editlib/renderers/ccrystalrendererdirectwrite.cpp @@ -228,7 +228,7 @@ STDMETHODIMP_(ULONG) CCustomTextRenderer::XCustomTextRenderer::Release() return pThis->ExternalRelease(); } -STDMETHODIMP CCustomTextRenderer::XCustomTextRenderer::QueryInterface(REFIID iid, LPVOID far* ppvObj) +STDMETHODIMP CCustomTextRenderer::XCustomTextRenderer::QueryInterface(REFIID iid, LPVOID* ppvObj) { METHOD_PROLOGUE(CCustomTextRenderer, CustomTextRenderer); return pThis->ExternalQueryInterface(&iid, ppvObj); diff --git a/Src/Common/CMoveConstraint.cpp b/Src/Common/CMoveConstraint.cpp index 50d8cb3d218..6f078cbc611 100644 --- a/Src/Common/CMoveConstraint.cpp +++ b/Src/Common/CMoveConstraint.cpp @@ -480,7 +480,7 @@ CMoveConstraint::Resize(HWND hWnd, UINT nType) * Enforce any resizing limitations. */ void -CMoveConstraint::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) +CMoveConstraint::OnGetMinMaxInfo(MINMAXINFO* lpMMI) { // views don't get WM_GETMINMAXINFO, but dialogs & frames do if (m_hwndDlg == nullptr) diff --git a/Src/Common/CMoveConstraint.h b/Src/Common/CMoveConstraint.h index 38dbcae35f7..1d2b4369b9a 100644 --- a/Src/Common/CMoveConstraint.h +++ b/Src/Common/CMoveConstraint.h @@ -173,7 +173,7 @@ class CMoveConstraint // handle WM_SIZE void Resize(HWND hWnd, UINT nType); // handle WM_GETMINMAXINFO - void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI ); + void OnGetMinMaxInfo(MINMAXINFO* lpMMI ); // handle WM_NCHITTEST bool OnNcHitTest(UINT message, WPARAM wParam, LPARAM lParam, LRESULT * plresult); // handle WM_NOTIFY/TTN_NEEDTEXT combination diff --git a/Src/Common/scbarcf.cpp b/Src/Common/scbarcf.cpp index 218ead2459b..0f157838131 100644 --- a/Src/Common/scbarcf.cpp +++ b/Src/Common/scbarcf.cpp @@ -34,8 +34,8 @@ IMPLEMENT_DYNAMIC(CSizingControlBarCF, baseCSizingControlBarCF); -int CALLBACK EnumFontFamProc(ENUMLOGFONT FAR *lpelf, - NEWTEXTMETRIC FAR *lpntm, +int CALLBACK EnumFontFamProc(ENUMLOGFONT* lpelf, + NEWTEXTMETRIC* lpntm, int FontType, LPARAM lParam) { diff --git a/Src/Common/scbarg.cpp b/Src/Common/scbarg.cpp index 1a566e38a9a..0713431d169 100644 --- a/Src/Common/scbarg.cpp +++ b/Src/Common/scbarg.cpp @@ -143,7 +143,7 @@ void CSizingControlBarG::NcPaintGripper(CDC* pDC, const CRect& rcClient) m_biHide.Paint(pDC); } -NCHITTEST_RESULT CSizingControlBarG::OnNcHitTest(CPoint point) +LRESULT CSizingControlBarG::OnNcHitTest(CPoint point) { CRect rcBar; GetWindowRect(rcBar); diff --git a/Src/Common/scbarg.h b/Src/Common/scbarg.h index 35bb17af3ca..a8e2cd9a13d 100644 --- a/Src/Common/scbarg.h +++ b/Src/Common/scbarg.h @@ -27,15 +27,6 @@ ///////////////////////////////////////////////////////////////////////// #pragma once -// MFC 8/VS.NET 2005 has breaking change in OnNcHitTest return value -#ifndef NCHITTEST_RESULT -#if _MFC_VER >= 0x0800 -#define NCHITTEST_RESULT LRESULT -#else -#define NCHITTEST_RESULT UINT -#endif -#endif - ///////////////////////////////////////////////////////////////////////// // CSCBButton (button info) helper class @@ -101,7 +92,7 @@ class CSizingControlBarG : public baseCSizingControlBarG // Generated message map functions protected: //{{AFX_MSG(CSizingControlBarG) - afx_msg NCHITTEST_RESULT OnNcHitTest(CPoint point); + afx_msg LRESULT OnNcHitTest(CPoint point); afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point); //}}AFX_MSG diff --git a/Src/Common/sizecbar.cpp b/Src/Common/sizecbar.cpp index cceaa766972..e620311cce7 100644 --- a/Src/Common/sizecbar.cpp +++ b/Src/Common/sizecbar.cpp @@ -313,7 +313,7 @@ CSize CSizingControlBar::CalcDynamicLayout(int nLength, DWORD dwMode) return m_szFloat; } -void CSizingControlBar::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) +void CSizingControlBar::OnWindowPosChanging(WINDOWPOS* lpwndpos) { // force non-client recalc if moved or resized lpwndpos->flags |= SWP_FRAMECHANGED; @@ -405,7 +405,7 @@ void CSizingControlBar::OnCaptureChanged(CWnd *pWnd) } void CSizingControlBar::OnNcCalcSize(BOOL bCalcValidRects, - NCCALCSIZE_PARAMS FAR* lpncsp) + NCCALCSIZE_PARAMS* lpncsp) { UNUSED_ALWAYS(bCalcValidRects); @@ -542,7 +542,7 @@ void CSizingControlBar::OnPaint() CPaintDC dc(this); } -NCHITTEST_RESULT CSizingControlBar::OnNcHitTest(CPoint point) +LRESULT CSizingControlBar::OnNcHitTest(CPoint point) { CRect rcBar, rcEdge; GetWindowRect(rcBar); @@ -1345,7 +1345,7 @@ void CSCBMiniDockFrameWnd::OnSize(UINT nType, int cx, int cy) baseCSCBMiniDockFrameWnd::OnSize(nType, cx, cy); } -void CSCBMiniDockFrameWnd::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) +void CSCBMiniDockFrameWnd::OnGetMinMaxInfo(MINMAXINFO* lpMMI) { baseCSCBMiniDockFrameWnd::OnGetMinMaxInfo(lpMMI); @@ -1363,7 +1363,7 @@ void CSCBMiniDockFrameWnd::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) } } -void CSCBMiniDockFrameWnd::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) +void CSCBMiniDockFrameWnd::OnWindowPosChanging(WINDOWPOS* lpwndpos) { if ((GetStyle() & MFS_4THICKFRAME) != 0) { diff --git a/Src/Common/sizecbar.h b/Src/Common/sizecbar.h index a6adfaf94a9..917f648b2dd 100644 --- a/Src/Common/sizecbar.h +++ b/Src/Common/sizecbar.h @@ -30,15 +30,6 @@ #include // for CDockContext #include // for CTypedPtrArray -// MFC 8/VS.NET 2005 has breaking change in OnNcHitTest return value -#ifndef NCHITTEST_RESULT -#if _MFC_VER >= 0x0800 -#define NCHITTEST_RESULT LRESULT -#else -#define NCHITTEST_RESULT UINT -#endif -#endif - #if defined(_SCB_MINIFRAME_CAPTION) && !defined(_SCB_REPLACE_MINIFRAME) #error "_SCB_MINIFRAME_CAPTION requires _SCB_REPLACE_MINIFRAME" #endif @@ -162,8 +153,8 @@ class CSizingControlBar : public baseCSizingControlBar //{{AFX_MSG(CSizingControlBar) afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnNcPaint(); - afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); - afx_msg NCHITTEST_RESULT OnNcHitTest(CPoint point); + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp); + afx_msg LRESULT OnNcHitTest(CPoint point); afx_msg void OnCaptureChanged(CWnd *pWnd); afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); @@ -172,7 +163,7 @@ class CSizingControlBar : public baseCSizingControlBar afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); afx_msg void OnRButtonDown(UINT nFlags, CPoint point); - afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos); + afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos); afx_msg void OnPaint(); afx_msg void OnClose(); afx_msg void OnSize(UINT nType, int cx, int cy); @@ -226,8 +217,8 @@ class CSCBMiniDockFrameWnd : public baseCSCBMiniDockFrameWnd //{{AFX_MSG(CSCBMiniDockFrameWnd) afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); - afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI); - afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos); + afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI); + afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos); afx_msg void OnSize(UINT nType, int cx, int cy); //}}AFX_MSG DECLARE_MESSAGE_MAP() diff --git a/Src/MainFrm.cpp b/Src/MainFrm.cpp index 52999a1d0a4..d07271e7f4f 100644 --- a/Src/MainFrm.cpp +++ b/Src/MainFrm.cpp @@ -2449,17 +2449,9 @@ void CMainFrame::StartFlashing() FlashWindowEx(FLASHW_ALL | FLASHW_TIMERNOFG, 3, 0); } -#if _MFC_VER > 0x0600 void CMainFrame::OnActivateApp(BOOL bActive, DWORD dwThreadID) -#else -void CMainFrame::OnActivateApp(BOOL bActive, HTASK hTask) -#endif { -#if _MFC_VER > 0x0600 __super::OnActivateApp(bActive, dwThreadID); -#else - __super::OnActivateApp(bActive, hTask); -#endif if (GetOptionsMgr()->GetInt(OPT_AUTO_RELOAD_MODIFIED_FILES) == AUTO_RELOAD_MODIFIED_FILES_ONWINDOWACTIVATED) { diff --git a/Src/MainFrm.h b/Src/MainFrm.h index 7535f6d380f..5fbed9c6a2b 100644 --- a/Src/MainFrm.h +++ b/Src/MainFrm.h @@ -361,11 +361,7 @@ class CMainFrame : public CMDIFrameWnd afx_msg void OnWindowCloseAll(); afx_msg void OnUpdateWindowCloseAll(CCmdUI* pCmdUI); afx_msg void OnSaveProject(); -#if _MFC_VER > 0x0600 afx_msg void OnActivateApp(BOOL bActive, DWORD dwThreadID); -#else - afx_msg void OnActivateApp(BOOL bActive, HTASK hTask); -#endif afx_msg void OnToolbarSize(UINT id); afx_msg void OnUpdateToolbarSize(CCmdUI* pCmdUI); afx_msg BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult); diff --git a/Src/MergeFrameCommon.cpp b/Src/MergeFrameCommon.cpp index 4629be39913..700d6e0f5ce 100644 --- a/Src/MergeFrameCommon.cpp +++ b/Src/MergeFrameCommon.cpp @@ -370,10 +370,8 @@ void CMergeFrameCommon::OnGetMinMaxInfo(MINMAXINFO* lpMMI) __super::OnGetMinMaxInfo(lpMMI); // [Fix for MFC 8.0 MDI Maximizing Child Window bug on Vista] // https://groups.google.com/forum/#!topic/microsoft.public.vc.mfc/iajCdW5DzTM -#if _MFC_VER >= 0x0800 lpMMI->ptMaxTrackSize.x = max(lpMMI->ptMaxTrackSize.x, lpMMI->ptMaxSize.x); lpMMI->ptMaxTrackSize.y = max(lpMMI->ptMaxTrackSize.y, lpMMI->ptMaxSize.y); -#endif } void CMergeFrameCommon::OnDestroy()