summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/smileyroutines.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-04 07:23:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-04 07:23:42 +0000
commit66cb770a982a2502456d10d73838df2b7239fd89 (patch)
treefc419dde94a9be3ebe8f2266ff46feb90d2bcbec /plugins/SmileyAdd/src/smileyroutines.cpp
parentbc256df33a57e585367edffe33d3e58d53f82ce8 (diff)
new subclassing functions applied to all plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@3880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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)