summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/smileyroutines.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SmileyAdd/src/smileyroutines.cpp')
-rw-r--r--plugins/SmileyAdd/src/smileyroutines.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/SmileyAdd/src/smileyroutines.cpp b/plugins/SmileyAdd/src/smileyroutines.cpp
index 5175309d1b..88efdf2367 100644
--- a/plugins/SmileyAdd/src/smileyroutines.cpp
+++ b/plugins/SmileyAdd/src/smileyroutines.cpp
@@ -221,14 +221,11 @@ void UpdateSelection(CHARRANGE& sel, int pos, int dif)
void ReplaceSmileys(HWND hwnd, SmileyPackType* smp, SmileyPackCType* smcp, const CHARRANGE& sel,
bool useHidden, bool ignoreLast, bool unFreeze, bool fireView)
{
-/*
- LARGE_INTEGER freq, strt, end;
- QueryPerformanceFrequency(&freq);
- QueryPerformanceCounter(&strt);
-*/
- IRichEditOle* RichEditOle;
+ IRichEditOle* RichEditOle = NULL;
if (SendMessage(hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&RichEditOle) == 0)
return;
+ if (RichEditOle == NULL)
+ return;
ITextDocument* TextDocument;
if (RichEditOle->QueryInterface(IID_ITextDocument, (void**)&TextDocument) != S_OK)
@@ -534,9 +531,11 @@ void ReplaceSmileys(HWND hwnd, SmileyPackType* smp, SmileyPackCType* smcp, const
void ReplaceSmileysWithText(HWND hwnd, CHARRANGE& sel, bool keepFrozen)
{
- IRichEditOle* RichEditOle;
+ IRichEditOle* RichEditOle = NULL;
if (SendMessage(hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&RichEditOle) == 0)
return;
+ if (RichEditOle == NULL)
+ return;
ITextDocument* TextDocument;
if (RichEditOle->QueryInterface(IID_ITextDocument, (void**)&TextDocument) != S_OK)