diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/SpellChecker/src/RichEdit.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/SpellChecker/src/RichEdit.cpp')
-rw-r--r-- | plugins/SpellChecker/src/RichEdit.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp index e81e679606..8cc6fd0e20 100644 --- a/plugins/SpellChecker/src/RichEdit.cpp +++ b/plugins/SpellChecker/src/RichEdit.cpp @@ -7,9 +7,9 @@ DEFINE_GUIDXXX(IID_ITextDocument,0x8CC497C0,0xA1DF,0x11CE,0x80,0x98,0x00,0xAA,0x00,0x47,0xBE,0x5D);
RichEdit::RichEdit(HWND hwnd) :
- m_hwnd(NULL),
- m_ole(NULL),
- m_textDocument(NULL),
+ m_hwnd(nullptr),
+ m_ole(nullptr),
+ m_textDocument(nullptr),
m_stopped(0),
m_undoEnabled(TRUE)
{
@@ -18,12 +18,12 @@ RichEdit::RichEdit(HWND hwnd) : RichEdit::~RichEdit()
{
- SetHWND(NULL);
+ SetHWND(nullptr);
}
bool RichEdit::IsValid() const
{
- return m_ole != NULL;
+ return m_ole != nullptr;
}
HWND RichEdit::GetHWND() const
@@ -33,26 +33,26 @@ HWND RichEdit::GetHWND() const void RichEdit::SetHWND(HWND hwnd)
{
- if (m_textDocument != NULL) {
+ if (m_textDocument != nullptr) {
m_textDocument->Release();
- m_textDocument = NULL;
+ m_textDocument = nullptr;
}
- if (m_ole != NULL) {
+ if (m_ole != nullptr) {
m_ole->Release();
- m_ole = NULL;
+ m_ole = nullptr;
}
m_hwnd = hwnd;
- if (hwnd == NULL)
+ if (hwnd == nullptr)
return;
SendMessage(EM_GETOLEINTERFACE, 0, (LPARAM)&m_ole);
- if (m_ole == NULL)
+ if (m_ole == nullptr)
return;
if (m_ole->QueryInterface(IID_ITextDocument, (void**)&m_textDocument) != S_OK)
- m_textDocument = NULL;
+ m_textDocument = nullptr;
}
LRESULT RichEdit::SendMessage(UINT Msg, WPARAM wParam, LPARAM lParam) const
@@ -67,16 +67,16 @@ bool RichEdit::IsReadOnly() const void RichEdit::SuspendUndo()
{
- if (m_textDocument != NULL) {
- m_textDocument->Undo(tomSuspend, NULL);
+ if (m_textDocument != nullptr) {
+ m_textDocument->Undo(tomSuspend, nullptr);
m_undoEnabled = FALSE;
}
}
void RichEdit::ResumeUndo()
{
- if (m_textDocument != NULL) {
- m_textDocument->Undo(tomResume, NULL);
+ if (m_textDocument != nullptr) {
+ m_textDocument->Undo(tomResume, nullptr);
m_undoEnabled = TRUE;
}
}
@@ -123,7 +123,7 @@ void RichEdit::Start() SendMessage(EM_SETSCROLLPOS, 0, (LPARAM)&m_old_scroll_pos);
SendMessage(WM_SETREDRAW, TRUE, 0);
- InvalidateRect(m_hwnd, NULL, FALSE);
+ InvalidateRect(m_hwnd, nullptr, FALSE);
ResumeUndo();
}
@@ -198,12 +198,12 @@ wchar_t* RichEdit::GetText(int start, int end) const if (end <= start)
end = GetTextLength();
- if (m_textDocument != NULL) {
+ if (m_textDocument != nullptr) {
ITextRange *range;
if (m_textDocument->Range(start, end, &range) != S_OK)
return mir_wstrdup(L"");
- BSTR text = NULL;
+ BSTR text = nullptr;
if (FAILED(range->GetText(&text))) {
if (text)
::SysFreeString(text);
|