OSDN Git Service

Fix issue #940: Replace slow (2)
[winmerge-jp/winmerge-jp.git] / Src / PatchDlg.h
index 2d4a04f..6f4444f 100644 (file)
@@ -1,19 +1,4 @@
-/////////////////////////////////////////////////////////////////////////////
-//    License (GPLv2+):
-//    This program is free software; you can redistribute it and/or modify
-//    it under the terms of the GNU General Public License as published by
-//    the Free Software Foundation; either version 2 of the License, or
-//    (at your option) any later version.
-//
-//    This program is distributed in the hope that it will be useful, but
-//    WITHOUT ANY WARRANTY; without even the implied warranty of
-//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//    General Public License for more details.
-//
-//    You should have received a copy of the GNU General Public License
-//    along with this program; if not, write to the Free Software
-//    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-/////////////////////////////////////////////////////////////////////////////
+// SPDX-License-Identifier: GPL-2.0-or-later
 /** 
  * @file  PatchDlg.h
  *
@@ -40,7 +25,7 @@ class CPatchDlg : public CTrDialog
 {
 // Construction
 public:
-       explicit CPatchDlg(CWnd* pParent = NULL);   // standard constructor
+       explicit CPatchDlg(CWnd* pParent = nullptr);   // standard constructor
 
        // Functions to add and get selected files (as PATCHFILEs)
        void AddItem(const PATCHFILES& pf);
@@ -53,7 +38,7 @@ public:
        enum { IDD = IDD_GENERATE_PATCH };
        CComboBox m_comboStyle;
        CSuperComboBox m_comboContext;
-       bool m_caseSensitive;
+       bool m_ignoreCase;
        CSuperComboBox m_ctlFile1;
        CSuperComboBox m_ctlFile2;
        CSuperComboBox m_ctlResult;
@@ -70,6 +55,8 @@ public:
 
        enum output_style m_outputStyle; /**< Patch style (context, unified etc.) */
        int m_contextLines; /**< How many context lines are added. */
+       enum DiffAlgorithm m_diffAlgorithm;
+       bool m_indentHeuristic;
 
 // Overrides
        // ClassWizard generated virtual function overrides
@@ -90,14 +77,55 @@ protected:
 
        // Generated message map functions
        //{{AFX_MSG(CPatchDlg)
-       virtual void OnOK();
-       virtual BOOL OnInitDialog();
+       virtual void OnOK() override;
+       virtual BOOL OnInitDialog() override;
        afx_msg void OnDiffBrowseFile1();
        afx_msg void OnDiffBrowseFile2();
        afx_msg void OnDiffBrowseResult();
        afx_msg void OnSelchangeDiffStyle();
        afx_msg void OnDiffSwapFiles();
        afx_msg void OnDefaultSettings();
+       afx_msg void OnSelchangeFile1();
+       afx_msg void OnSelchangeFile2();
+       afx_msg void OnEditchangeFile1();
+       afx_msg void OnEditchangeFile2();
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 };
+
+/** 
+ * @brief Add patch item to internal list.
+ * @param [in] pf Patch item to add.
+ */
+inline void CPatchDlg::AddItem(const PATCHFILES& pf)
+{
+       m_fileList.push_back(pf);
+}
+
+/** 
+ * @brief Returns amount of patch items in the internal list.
+ * @return Count of patch items in the list.
+ */
+inline size_t CPatchDlg::GetItemCount()
+{
+       return m_fileList.size();
+}
+
+/** 
+ * @brief Return item in the internal list at given position
+ * @param [in] position Zero-based index of item to get
+ * @return PATCHFILES from given position.
+ */
+inline const PATCHFILES& CPatchDlg::GetItemAt(size_t position)
+{
+       return m_fileList.at(position);
+}
+
+/** 
+ * @brief Empties internal item list.
+ */
+inline void CPatchDlg::ClearItems()
+{
+       m_fileList.clear();
+}
+