Skip to content

Commit

Permalink
Corrected typo
Browse files Browse the repository at this point in the history
  • Loading branch information
SinghRajenM committed Aug 15, 2024
1 parent 8e6bd0a commit b91f87b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions NppJSONViewer/NppJsonViewer/Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ struct Indent

struct ParseOptions
{
bool bIgnoreComment = true;
bool bIgnoreTraillingComma = true;
bool bReplaceUndefined = false;
bool bIgnoreComment = true;
bool bIgnoreTrailingComma = true;
bool bReplaceUndefined = false;
};

struct Setting
Expand Down
8 changes: 4 additions & 4 deletions NppJSONViewer/NppJsonViewer/JsonHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,22 @@ inline auto JsonHandler::ParseJson(const std::string &jsonText, rj::StringBuffer
constexpr auto flgBase_comma = flgBase | rj::kParseTrailingCommasFlag;
constexpr auto flgBase_Both = flgBase_comma | flgBase_commemt;

if (m_parseOptions.bIgnoreComment && m_parseOptions.bIgnoreTraillingComma)
if (m_parseOptions.bIgnoreComment && m_parseOptions.bIgnoreTrailingComma)
{
success = reader.Parse<flgBase_Both>(ss, handler) && sb.GetString();
}

else if (!m_parseOptions.bIgnoreComment && m_parseOptions.bIgnoreTraillingComma)
else if (!m_parseOptions.bIgnoreComment && m_parseOptions.bIgnoreTrailingComma)
{
success = reader.Parse<flgBase_comma>(ss, handler) && sb.GetString();
}

else if (m_parseOptions.bIgnoreComment && !m_parseOptions.bIgnoreTraillingComma)
else if (m_parseOptions.bIgnoreComment && !m_parseOptions.bIgnoreTrailingComma)
{
success = reader.Parse<flgBase_commemt>(ss, handler) && sb.GetString();
}

else if (!m_parseOptions.bIgnoreComment && !m_parseOptions.bIgnoreTraillingComma)
else if (!m_parseOptions.bIgnoreComment && !m_parseOptions.bIgnoreTrailingComma)
{
success = reader.Parse<flgBase>(ss, handler) && sb.GetString();
}
Expand Down
6 changes: 3 additions & 3 deletions NppJSONViewer/NppJsonViewer/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ bool ProfileSetting::GetSettings(Setting &info) const
if (bRetVal)
info.parseOptions.bIgnoreComment = static_cast<bool>(nVal);

bRetVal &= ReadValue(STR_INI_OTHER_SEC, STR_INI_OTHER_IGNORE_COMMA, nVal, info.parseOptions.bIgnoreTraillingComma);
bRetVal &= ReadValue(STR_INI_OTHER_SEC, STR_INI_OTHER_IGNORE_COMMA, nVal, info.parseOptions.bIgnoreTrailingComma);
if (bRetVal)
info.parseOptions.bIgnoreTraillingComma = static_cast<bool>(nVal);
info.parseOptions.bIgnoreTrailingComma = static_cast<bool>(nVal);

bRetVal &= ReadValue(STR_INI_OTHER_SEC, STR_INI_OTHER_REPLACE_UNDEFINED, nVal, info.parseOptions.bReplaceUndefined);
if (bRetVal)
Expand All @@ -130,7 +130,7 @@ bool ProfileSetting::SetSettings(const Setting &info) const
bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_AUTO_FORMAT, info.bAutoFormat);
bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_USE_HIGHLIGHT, info.bUseJsonHighlight);
bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_IGNORE_COMMENT, info.parseOptions.bIgnoreComment);
bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_IGNORE_COMMA, info.parseOptions.bIgnoreTraillingComma);
bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_IGNORE_COMMA, info.parseOptions.bIgnoreTrailingComma);
bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_REPLACE_UNDEFINED, info.parseOptions.bReplaceUndefined);

return bRetVal;
Expand Down
4 changes: 2 additions & 2 deletions NppJSONViewer/NppJsonViewer/SettingsDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ bool SettingsDlg::Apply()
m_pSetting->bFollowCurrentTab = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_FOLLOW_CURRENT_DOC));
m_pSetting->bAutoFormat = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_FORMAT_ON_OPEN));
m_pSetting->bUseJsonHighlight = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_JSON_HIGHLIGHT));
m_pSetting->parseOptions.bIgnoreTraillingComma = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMA));
m_pSetting->parseOptions.bIgnoreTrailingComma = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMA));
m_pSetting->parseOptions.bIgnoreComment = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMENT));
m_pSetting->parseOptions.bReplaceUndefined = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_REPLACE_UNDEFINED));

Expand Down Expand Up @@ -207,7 +207,7 @@ void SettingsDlg::InitDlg()
CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_FOLLOW_CURRENT_DOC), m_pSetting->bFollowCurrentTab);
CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_FORMAT_ON_OPEN), m_pSetting->bAutoFormat);
CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_JSON_HIGHLIGHT), m_pSetting->bUseJsonHighlight);
CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMA), m_pSetting->parseOptions.bIgnoreTraillingComma);
CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMA), m_pSetting->parseOptions.bIgnoreTrailingComma);
CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMENT), m_pSetting->parseOptions.bIgnoreComment);
CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_REPLACE_UNDEFINED), m_pSetting->parseOptions.bReplaceUndefined);
}
Expand Down

0 comments on commit b91f87b

Please sign in to comment.