summaryrefslogtreecommitdiff
path: root/plugins/HistoryPlusPlus
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-07-07 14:33:45 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-07-07 14:33:45 +0300
commitcca308b6079ee778c564c0197756595faf63ec88 (patch)
treef0e4e92ca2f80cc288a82489fb47a0f754495915 /plugins/HistoryPlusPlus
parent81a813415b1921236ec456dd0cf74839191d2363 (diff)
IEView:
- text in groupchats isn't scrolled down; - unused flag removed from IEE_GET_SELECTION processing; - minor code optimization
Diffstat (limited to 'plugins/HistoryPlusPlus')
-rw-r--r--plugins/HistoryPlusPlus/hpp_external.pas2
-rw-r--r--plugins/HistoryPlusPlus/hpp_externalgrid.pas20
2 files changed, 6 insertions, 16 deletions
diff --git a/plugins/HistoryPlusPlus/hpp_external.pas b/plugins/HistoryPlusPlus/hpp_external.pas
index 3ec3937f37..53843d277f 100644
--- a/plugins/HistoryPlusPlus/hpp_external.pas
+++ b/plugins/HistoryPlusPlus/hpp_external.pas
@@ -203,7 +203,7 @@ begin
ExtGrid.EndUpdate;
end;
IEE_GET_SELECTION: begin
- Result := uint_ptr(ExtGrid.GetSelection(boolean(event.dwFlags and IEEF_NO_UNICODE)));
+ Result := uint_ptr(ExtGrid.GetSelection());
end;
IEE_SAVE_DOCUMENT: begin
ExtGrid.SaveSelected;
diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas
index 0ecc0d3a67..c19a755f76 100644
--- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas
+++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas
@@ -145,7 +145,7 @@ type
Codepage: Integer; RTL: Boolean; DoScroll: Boolean);
procedure SetPosition(x, y, cx, cy: Integer);
procedure ScrollToBottom;
- function GetSelection(NoUnicode: Boolean): PAnsiChar;
+ function GetSelection(): PAnsiChar;
procedure SaveSelected;
procedure Clear;
property ParentWindow: HWND read FParentWindow;
@@ -623,10 +623,9 @@ begin
SetWindowPos(Grid.Handle, 0, x, y, cx, cy, SWP_SHOWWINDOW);
end;
-function TExternalGrid.GetSelection(NoUnicode: Boolean): PAnsiChar;
+function TExternalGrid.GetSelection(): PAnsiChar;
var
- TextW: String;
- TextA: AnsiString;
+ TextW: WideString;
Source: Pointer;
Size: Integer;
begin
@@ -634,17 +633,8 @@ begin
if Length(TextW) > 0 then
begin
TextW := TextW + #0;
- if NoUnicode then
- begin
- TextA := WideToAnsiString(TextW, CP_ACP);
- Source := @TextA[1];
- Size := Length(TextA);
- end
- else
- begin
- Source := @TextW[1];
- Size := Length(TextW) * SizeOf(Char);
- end;
+ Source := @TextW[1];
+ Size := Length(TextW) * SizeOf(WideChar);
ReallocMem(FSelection, Size);
Move(Source^, FSelection^, Size);
Result := FSelection;