Skip to content

Commit a765bbe

Browse files
committed
Renamed variable and corrected typo
1 parent 158eafa commit a765bbe

File tree

11 files changed

+32
-32
lines changed

11 files changed

+32
-32
lines changed

NppJSONViewer/NppJsonViewer/AboutDlg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#include <commctrl.h>
88

99

10-
AboutDlg::AboutDlg(HINSTANCE hIntance, HWND hParent, int nCmdId)
10+
AboutDlg::AboutDlg(HINSTANCE hInstance, HWND hParent, int nCmdId)
1111
: m_nCmdId(nCmdId)
1212
, StaticDialog()
1313
{
14-
init(hIntance, hParent);
14+
init(hInstance, hParent);
1515
}
1616

1717

NppJSONViewer/NppJsonViewer/AboutDlg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class AboutDlg : public StaticDialog
55
{
66
public:
7-
AboutDlg(HINSTANCE hIntance, HWND hParent, int nCmdId);
7+
AboutDlg(HINSTANCE hInstance, HWND hParent, int nCmdId);
88
~AboutDlg() = default;
99

1010
bool ShowDlg(bool bShow);

NppJSONViewer/NppJsonViewer/JsonViewDlg.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <regex>
1010

1111

12-
JsonViewDlg::JsonViewDlg(HINSTANCE hIntance, const NppData &nppData, const bool &isReady, int nCmdId, std::shared_ptr<Setting> &pSetting)
12+
JsonViewDlg::JsonViewDlg(HINSTANCE hInstance, const NppData &nppData, const bool &isReady, int nCmdId, std::shared_ptr<Setting> &pSetting)
1313
: DockingDlgInterface(IDD_TREEDLG)
1414
, m_NppData(nppData)
1515
, m_IsNppReady(isReady)
@@ -19,7 +19,7 @@ JsonViewDlg::JsonViewDlg(HINSTANCE hIntance, const NppData &nppData, const bool
1919
, m_pSetting(pSetting)
2020
{
2121
_hParent = nppData._nppHandle;
22-
_hInst = hIntance;
22+
_hInst = hInstance;
2323
}
2424

2525
JsonViewDlg::~JsonViewDlg()
@@ -77,7 +77,7 @@ void JsonViewDlg::FormatJson()
7777
if (res.success)
7878
{
7979
m_Editor->ReplaceSelection(res.response);
80-
HightlightAsJson();
80+
HighlightAsJson();
8181
}
8282
else
8383
{
@@ -98,7 +98,7 @@ void JsonViewDlg::CompressJson()
9898
if (res.success)
9999
{
100100
m_Editor->ReplaceSelection(res.response);
101-
HightlightAsJson();
101+
HighlightAsJson();
102102
}
103103
else
104104
{
@@ -152,7 +152,7 @@ bool JsonViewDlg::CheckForTokenUndefined(eMethod method, std::string selectedTex
152152
if (res.success)
153153
{
154154
m_Editor->ReplaceSelection((method == eMethod::ParseJson || method == eMethod::ValidateJson) ? text : res.response);
155-
HightlightAsJson();
155+
HighlightAsJson();
156156
return true;
157157
}
158158
else
@@ -257,7 +257,7 @@ void JsonViewDlg::DrawJsonTree()
257257
EnableControls(ctrls, true);
258258
}
259259

260-
void JsonViewDlg::HightlightAsJson(bool bForcefully) const
260+
void JsonViewDlg::HighlightAsJson(bool bForcefully) const
261261
{
262262
bool setJsonLang = bForcefully || m_pSetting->bUseJsonHighlight;
263263
if (setJsonLang)
@@ -295,7 +295,7 @@ auto JsonViewDlg::PopulateTreeUsingSax(HTREEITEM tree_root, const std::string &j
295295
}
296296
else
297297
{
298-
HightlightAsJson();
298+
HighlightAsJson();
299299
}
300300

301301
return retVal;
@@ -338,7 +338,7 @@ void JsonViewDlg::SearchInTree()
338338
static std::wstring previousSearch;
339339
static HTREEITEM nextNode = m_hTreeView->NextItem(m_hTreeView->GetRoot());
340340

341-
// New search, hence search from begining
341+
// New search, hence search from beginning
342342
if (previousSearch != itemToSearch)
343343
{
344344
previousSearch = itemToSearch;
@@ -372,7 +372,7 @@ void JsonViewDlg::SearchInTree()
372372

373373
// Search in node value
374374
// 1. If both key and value are not equal
375-
// 2. If both are euaal, but not all three (key, value and keyValue)
375+
// 2. If both are equal, but not all three (key, value and keyValue)
376376
// 3. If all three equal, but key does not start with '[' and end with ']'
377377

378378
bool shouldSearch = (nodeKey != nodeVal);

NppJSONViewer/NppJsonViewer/JsonViewDlg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class JsonViewDlg : public DockingDlgInterface
2929
};
3030

3131
public:
32-
JsonViewDlg(HINSTANCE hIntance, const NppData &nppData, const bool &isReady, int nCmdId, std::shared_ptr<Setting> &pSetting);
32+
JsonViewDlg(HINSTANCE hInstance, const NppData &nppData, const bool &isReady, int nCmdId, std::shared_ptr<Setting> &pSetting);
3333
virtual ~JsonViewDlg();
3434

3535
void ShowDlg(bool bShow);
@@ -42,7 +42,7 @@ class JsonViewDlg : public DockingDlgInterface
4242

4343
private:
4444
void DrawJsonTree();
45-
void HightlightAsJson(bool bForcefully = false) const;
45+
void HighlightAsJson(bool bForcefully = false) const;
4646
auto PopulateTreeUsingSax(HTREEITEM tree_root, const std::string &jsonText) -> std::optional<std::wstring>;
4747

4848
void ValidateJson();

NppJSONViewer/NppJsonViewer/NppJsonPlugin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void NppJsonPlugin::ProcessNotification(const SCNotification *notifyCode)
7070

7171
case NPPN_READY:
7272
{
73-
// This is work arround where dialog does not show tree on launch
73+
// This is workaround where dialog does not show tree on launch
7474
if (m_pJsonViewDlg && m_pJsonViewDlg->isVisible() && !m_bAboutToClose)
7575
{
7676
::SendMessage(m_pJsonViewDlg->getHSelf(), WM_COMMAND, IDC_BTN_REFRESH, 0);
@@ -132,9 +132,9 @@ void NppJsonPlugin::InitToolbarIcon()
132132
auto dpi = GetDeviceCaps(GetWindowDC(m_NppData._nppHandle), LOGPIXELSX);
133133
int size = 16 * dpi / 96;
134134
m_hMenuIcon.hToolbarIcon = reinterpret_cast<HICON>(::LoadImage(static_cast<HINSTANCE>(m_hModule), MAKEINTRESOURCE(IDI_ICON_TOOLBAR), IMAGE_ICON, size, size, 0));
135-
ICONINFO iconinfo;
136-
GetIconInfo(m_hMenuIcon.hToolbarIcon, &iconinfo);
137-
m_hMenuIcon.hToolbarBmp = iconinfo.hbmColor;
135+
ICONINFO iconInfo;
136+
GetIconInfo(m_hMenuIcon.hToolbarIcon, &iconInfo);
137+
m_hMenuIcon.hToolbarBmp = iconInfo.hbmColor;
138138
}
139139

140140
void NppJsonPlugin::InitConfigPath()

NppJSONViewer/NppJsonViewer/SettingsDlg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
#include <Uxtheme.h>
77

88

9-
SettingsDlg::SettingsDlg(HINSTANCE hIntance, HWND hParent, int nCmdId, const std::wstring &configPath, std::shared_ptr<Setting> &pSetting)
9+
SettingsDlg::SettingsDlg(HINSTANCE hInstance, HWND hParent, int nCmdId, const std::wstring &configPath, std::shared_ptr<Setting> &pSetting)
1010
: m_nCmdId(nCmdId)
1111
, m_configPath(configPath)
1212
, StaticDialog()
1313
, m_pSetting(pSetting)
1414
{
15-
init(hIntance, hParent);
15+
init(hInstance, hParent);
1616
}
1717

1818

NppJSONViewer/NppJsonViewer/SettingsDlg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class SettingsDlg : public StaticDialog
88
{
99
public:
10-
SettingsDlg(HINSTANCE hIntance, HWND hParent, int nCmdId, const std::wstring &configPath, std::shared_ptr<Setting> &pSetting);
10+
SettingsDlg(HINSTANCE hInstance, HWND hParent, int nCmdId, const std::wstring &configPath, std::shared_ptr<Setting> &pSetting);
1111
~SettingsDlg() = default;
1212

1313
bool ShowDlg(bool bShow);

NppJSONViewer/NppJsonViewer/TreeViewCtrl.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ bool TreeViewCtrl::IsThisOrAnyChildCollapsed(HTREEITEM node) const
109109

110110
void TreeViewCtrl::Expand(HTREEITEM node) const
111111
{
112-
ExpandOrCollpase(node, TVE_EXPAND);
112+
ExpandOrCollapse(node, TVE_EXPAND);
113113
}
114114

115115
void TreeViewCtrl::Collapse(HTREEITEM node) const
116116
{
117-
ExpandOrCollpase(node, TVE_COLLAPSE);
117+
ExpandOrCollapse(node, TVE_COLLAPSE);
118118
}
119119

120-
void TreeViewCtrl::ExpandOrCollpase(HTREEITEM node, UINT_PTR code) const
120+
void TreeViewCtrl::ExpandOrCollapse(HTREEITEM node, UINT_PTR code) const
121121
{
122122
TreeView_Expand(m_hTree, node, code);
123123
}
@@ -235,7 +235,7 @@ auto TreeViewCtrl::GetNodePath(HTREEITEM hti) const -> std::wstring
235235

236236
if (!nodeKey.empty())
237237
{
238-
// remove " from the beinging and end
238+
// remove " from the beginning and end
239239
if (nodeKey[0] == TEXT('"'))
240240
nodeKey.erase(0, 1);
241241
if (nodeKey[nodeKey.size() - 1] == TEXT('"'))
@@ -262,7 +262,7 @@ auto TreeViewCtrl::GetNodePath(HTREEITEM hti) const -> std::wstring
262262
hitTravel = htiParent;
263263
}
264264

265-
// remove trailling dot (.)
265+
// remove trailing dot (.)
266266
wstrJsonPath.pop_back();
267267

268268
return wstrJsonPath;
@@ -295,7 +295,7 @@ HTREEITEM TreeViewCtrl::GetParentItem(HTREEITEM hti) const
295295

296296
/*
297297
* Get next item of current item on the TreeView.
298-
* If current item has a child (or chidren) item, next will be the first child item.
298+
* If current item has a child (or children) item, next will be the first child item.
299299
* If current item has no child, next will be its sibling item.
300300
* If current item has no child and no sibling, next will be its parent's (parent's parent's ...) sibling item.
301301
* If current item's parent is ROOT and has no sibling item, it will return NULL.

NppJSONViewer/NppJsonViewer/TreeViewCtrl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class TreeViewCtrl
5757
auto GetNodePath(HTREEITEM hti) const -> std::wstring;
5858

5959
private:
60-
void ExpandOrCollpase(HTREEITEM node, UINT_PTR code) const;
60+
void ExpandOrCollapse(HTREEITEM node, UINT_PTR code) const;
6161

6262
HTREEITEM GetParentItem(HTREEITEM hti) const;
6363

NppJSONViewer/UtilityLib/Utility.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,14 @@ bool CUtility::OpenFileDlg(std::wstring &filePath, const std::wstring &dlgTitle,
220220

221221
if (::GetOpenFileName(&ofn) != FALSE)
222222
{
223-
filePath = ofn.lpstrFile; // will have the full pathand file name.
223+
filePath = ofn.lpstrFile; // will have the full path and file name.
224224
bRetVal = true;
225225
}
226226

227227
return bRetVal;
228228
}
229229

230-
bool CUtility::CopyToClipboard(const std::wstring &str2cpy, HWND hwnd)
230+
bool CUtility::CopyToClipboard(const std::wstring &str2cpy, HWND hWnd)
231231
{
232232
size_t len2Allocate = (str2cpy.size() + 1) * sizeof(TCHAR);
233233
HGLOBAL hglbCopy = ::GlobalAlloc(GMEM_MOVEABLE, len2Allocate);
@@ -236,7 +236,7 @@ bool CUtility::CopyToClipboard(const std::wstring &str2cpy, HWND hwnd)
236236
return false;
237237
}
238238

239-
if (!::OpenClipboard(hwnd))
239+
if (!::OpenClipboard(hWnd))
240240
{
241241
::GlobalFree(hglbCopy);
242242
::CloseClipboard();

0 commit comments

Comments
 (0)