OSDN Git Service

Use constant values for whitespace compare setting
authorKimmo Varis <kimmov@gmail.com>
Sun, 7 Sep 2003 11:32:50 +0000 (11:32 +0000)
committerKimmo Varis <kimmov@gmail.com>
Sun, 7 Sep 2003 11:32:50 +0000 (11:32 +0000)
Src/DiffWrapper.cpp
Src/DiffWrapper.h
Src/readme.txt

index b837a94..3d3411b 100644 (file)
@@ -384,9 +384,9 @@ void CDiffWrapper::InternalGetOptions(DIFFOPTIONS *options)
        int nIgnoreWhitespace = 0;
 
        if (m_settings.ignoreAllSpace)
-               nIgnoreWhitespace = 2;
+               nIgnoreWhitespace = WHITESPACE_IGNORE_ALL;
        else if (m_settings.ignoreSpaceChange)
-               nIgnoreWhitespace = 1;
+               nIgnoreWhitespace = WHITESPACE_IGNORE_CHANGE;
 
        options->nIgnoreWhitespace = nIgnoreWhitespace;
        options->bIgnoreBlankLines = m_settings.ignoreBlankLines;
@@ -400,15 +400,15 @@ void CDiffWrapper::InternalGetOptions(DIFFOPTIONS *options)
  */
 void CDiffWrapper::InternalSetOptions(DIFFOPTIONS *options)
 {
-       m_settings.ignoreAllSpace = (options->nIgnoreWhitespace == 2);
-       m_settings.ignoreSpaceChange = (options->nIgnoreWhitespace == 1);
+       m_settings.ignoreAllSpace = (options->nIgnoreWhitespace == WHITESPACE_IGNORE_ALL);
+       m_settings.ignoreSpaceChange = (options->nIgnoreWhitespace == WHITESPACE_IGNORE_CHANGE);
        m_settings.ignoreBlankLines = options->bIgnoreBlankLines;
        m_settings.ignoreEOLDiff = !options->bEolSensitive;
        m_settings.ignoreCase = options->bIgnoreCase;
-       m_settings.ignoreSomeChanges = (options->nIgnoreWhitespace != 0) ||
+       m_settings.ignoreSomeChanges = (options->nIgnoreWhitespace != WHITESPACE_COMPARE_ALL) ||
                options->bIgnoreCase || options->bIgnoreBlankLines ||
                !options->bEolSensitive;
-       m_settings.lengthVaries = (options->nIgnoreWhitespace!=0);
+       m_settings.lengthVaries = (options->nIgnoreWhitespace != WHITESPACE_COMPARE_ALL);
 }
 
 /**
index dc080bf..266ee96 100644 (file)
@@ -40,6 +40,18 @@ enum
 };
 
 /**
+ * @brief Whitespace options
+ *
+ * DIFFOPTIONS structs nIgnoreWhitespace can have these values
+ */
+enum
+{
+       WHITESPACE_COMPARE_ALL = 0,
+       WHITESPACE_IGNORE_CHANGE,
+       WHITESPACE_IGNORE_ALL
+};
+
+/**
  * @brief One difference defined by linenumbers.
  *
  * This struct defines one set of different lines "diff".
index d904628..74e3c95 100644 (file)
@@ -1,6 +1,8 @@
 2003-09-07 Kimmo
  PATCH: [ 800420 ] Fix recursive compare and cleanup recursive usage
   WinMerge: DiffThread.h DiffThread.cpp DirDoc.h DirDoc.cpp MainFrm.cpp
+ Use constant values for whitespace compare setting
+  WinMerge: DiffWrapper.h DiffWrapper.cpp
 
 2003-09-06 Perry
  PATCH: [ 795082 ] Display Private Build version in about box