diff options
author | Alexey Kulakov <panda75@bk.ru> | 2015-02-14 20:59:32 +0000 |
---|---|---|
committer | Alexey Kulakov <panda75@bk.ru> | 2015-02-14 20:59:32 +0000 |
commit | 1bd8a05fc766f007574f32f7fdcc6c468c991315 (patch) | |
tree | 28394934ed025ab344e1c7bf442e610708021f73 | |
parent | 3aa5dd18a8bda96ab65def0fe9ca78bfd0af3960 (diff) |
QuickSearch: trying to fix service param type bug
git-svn-id: http://svn.miranda-ng.org/main/trunk@12110 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/QuickSearch/i_ok.inc | 18 | ||||
-rw-r--r-- | plugins/QuickSearch/sr_global.pas | 33 | ||||
-rw-r--r-- | plugins/QuickSearch/sr_optdialog.pas | 4 |
3 files changed, 39 insertions, 16 deletions
diff --git a/plugins/QuickSearch/i_ok.inc b/plugins/QuickSearch/i_ok.inc index 00918a0ffb..a5bdf7c715 100644 --- a/plugins/QuickSearch/i_ok.inc +++ b/plugins/QuickSearch/i_ok.inc @@ -262,6 +262,7 @@ procedure LoadOneItem(hContact:THANDLE;column:pcolumnitem;proto:integer; var res var
tmp:int_ptr;
lmodule,srv:PAnsiChar;
+ lwparam,llparam:TLPARAM;
DbEvent:TMEVENT;
cni:TCONTACTINFO;
dbei:TDBEVENTINFO;
@@ -278,14 +279,25 @@ begin end;
QST_SERVICE: begin
- if wparam._type=ACF_CURRENT then wparam.value:=hContact;
- if lparam._type=ACF_CURRENT then lparam.value:=hContact;
+ case wparam._type of
+ ACF_CURRENT: lwparam:=hContact;
+ ACF_NUMBER : lwparam:=NumToInt(wparam.value);
+ else
+ lwparam:=TLPARAM(wparam.value);
+ end;
+ case lparam._type of
+ ACF_CURRENT: llparam:=hContact;
+ ACF_NUMBER : llparam:=NumToInt(lparam.value);
+ else
+ llparam:=TLPARAM(lparam.value);
+ end;
if (restype and ACF_SCRIPT_SERVICE)<>0 then
srv:=ParseVarString(service,hContact,nil)
else
srv:=service;
- tmp:=int_ptr(CallService(srv,TWPARAM(wparam.value),TLPARAM(lparam.value)));
+
+ tmp:=int_ptr(CallService(srv,TWPARAM(lwparam),TLPARAM(llparam)));
if (restype and ACF_SCRIPT_SERVICE)<>0 then
mFreeMem(srv);
diff --git a/plugins/QuickSearch/sr_global.pas b/plugins/QuickSearch/sr_global.pas index a304728f0c..fa817ae0f6 100644 --- a/plugins/QuickSearch/sr_global.pas +++ b/plugins/QuickSearch/sr_global.pas @@ -76,7 +76,7 @@ const type
tserviceparam = record
- value:uint_ptr;
+ value:pWideChar;
_type:dword;
end;
@@ -396,7 +396,7 @@ begin restype :=ACF_RSTRING;
wparam._type :=ACF_CURRENT;
lparam._type :=ACF_NUMBER;
- lparam.value :=0;
+ lparam.value :=nil;
end;
inc(i);
@@ -433,7 +433,7 @@ begin restype :=ACF_RUNICODE;
wparam._type :=ACF_CURRENT;
lparam._type :=ACF_NUMBER;
- lparam.value :=2; // 0 for ANSI
+ lparam.value :='2'; // 0 for ANSI
end;
inc(i);
@@ -666,13 +666,13 @@ begin StrCopy(p,so__lparam_type); WriteInt(buf,lparam._type);
StrCopy(p,so__wparam);
case wparam._type of
- ACF_NUMBER : WriteInt (buf,wparam.value);
+ ACF_NUMBER : WriteUnicode(buf,wparam.value);
ACF_STRING : WriteStr (buf,pointer(wparam.value));
ACF_UNICODE: WriteUnicode(buf,pointer(wparam.value));
end;
StrCopy(p,so__lparam);
case lparam._type of
- ACF_NUMBER : WriteInt (buf,lparam.value);
+ ACF_NUMBER : WriteUnicode(buf,lparam.value);
ACF_STRING : WriteStr (buf,pointer(lparam.value));
ACF_UNICODE: WriteUnicode(buf,pointer(lparam.value));
end;
@@ -738,6 +738,7 @@ end; function loadopt_db(var columns:array of tcolumnitem):integer;
var
buf:array [0..127] of AnsiChar;
+ buf1:array [0..31] of WideChar;
p,pp:PAnsiChar;
i:integer;
begin
@@ -801,15 +802,25 @@ begin StrCopy(p,so__lparam_type); lparam._type:=GetInt(buf,0);
StrCopy(p,so__wparam);
case wparam._type of
- ACF_NUMBER : wparam.value:=GetInt(buf,0);
- ACF_STRING : wparam.value:=uint_ptr(GetStr(buf));
- ACF_UNICODE: wparam.value:=uint_ptr(GetUnicode(buf));
+ ACF_NUMBER : begin
+ if DBGetSettingType(0,qs_module,so__wparam)=DBVT_DWORD then
+ StrDupW(wparam.value,IntToStr(buf1,GetInt(buf,0)))
+ else
+ wparam.value:=pointer(GetUnicode(buf));
+ end;
+ ACF_STRING : wparam.value:=pointer(GetStr(buf));
+ ACF_UNICODE: wparam.value:=pointer(GetUnicode(buf));
end;
StrCopy(p,so__lparam);
case lparam._type of
- ACF_NUMBER : lparam.value:=GetInt(buf,0);
- ACF_STRING : lparam.value:=uint_ptr(GetStr(buf));
- ACF_UNICODE: lparam.value:=uint_ptr(GetUnicode(buf));
+ ACF_NUMBER : begin
+ if DBGetSettingType(0,qs_module,so__lparam)=DBVT_DWORD then
+ StrDupW(lparam.value,IntToStr(buf1,GetInt(buf,0)))
+ else
+ lparam.value:=pointer(GetUnicode(buf));
+ end;
+ ACF_STRING : lparam.value:=pointer(GetStr(buf));
+ ACF_UNICODE: lparam.value:=pointer(GetUnicode(buf));
end;
end;
diff --git a/plugins/QuickSearch/sr_optdialog.pas b/plugins/QuickSearch/sr_optdialog.pas index 1317397033..c73843677d 100644 --- a/plugins/QuickSearch/sr_optdialog.pas +++ b/plugins/QuickSearch/sr_optdialog.pas @@ -366,9 +366,9 @@ begin QST_SERVICE: begin
GetSrvBlockValue(ServiceBlock,srvalue);
service :=srvalue.service;
- wparam.value:=uint_ptr(srvalue.wparam);
+ wparam.value:=srvalue.wparam;
wparam._type:=srvalue.w_flag;
- lparam.value:=uint_ptr(srvalue.lparam);
+ lparam.value:=srvalue.lparam;
lparam._type:=srvalue.l_flag;
restype :=srvalue.flags;
end;
|