summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-10-14 20:06:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-10-14 20:06:14 +0000
commit26dd9ff89c617734e4f7959f1967fb98d7f3478f (patch)
treeb911c8fe9377a2aa1eb8a05d5f46eb21771a035c /src
parenteb4a70dde5107116aa29b7a673f34a27a71fcd5d (diff)
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@1940 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/modules/database/dbutils.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp
index cca96a763c..fe0ba20b34 100644
--- a/src/modules/database/dbutils.cpp
+++ b/src/modules/database/dbutils.cpp
@@ -123,13 +123,13 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam)
if (egt->datatype == DBVT_WCHAR)
{
WCHAR* msg = NULL;
- if (dbei->flags & DBEF_UTF) {
- char* str = (char*)alloca(dbei->cbBlob + 1);
- if (str == NULL) return NULL;
- memcpy(str, dbei->pBlob, dbei->cbBlob);
- str[dbei->cbBlob] = 0;
+ if (dbei->flags & DBEF_UTF) {
+ char* str = (char*)alloca(dbei->cbBlob + 1);
+ if (str == NULL) return NULL;
+ memcpy(str, dbei->pBlob, dbei->cbBlob);
+ str[dbei->cbBlob] = 0;
Utf8DecodeCP(str, egt->codepage, &msg);
- }
+ }
else {
size_t msglen = strlen((char*)dbei->pBlob) + 1, msglenW = 0;
if (msglen != dbei->cbBlob) {
@@ -154,7 +154,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam)
if (dbei->flags & DBEF_UTF)
Utf8DecodeCP(msg, egt->codepage, NULL);
- return (INT_PTR)msg;
+ return (INT_PTR)msg;
}
return 0;
}
@@ -195,10 +195,7 @@ static INT_PTR DbEventGetIcon(WPARAM wParam, LPARAM lParam)
}
}
- if (wParam & LR_SHARED)
- return (INT_PTR)icon;
- else
- return (INT_PTR)CopyIcon(icon);
+ return (INT_PTR)((wParam & LR_SHARED) ? icon : CopyIcon(icon));
}
static INT_PTR DbEventGetStringT(WPARAM wParam, LPARAM lParam)