Permalink
Browse files

Temporarily disable local number formatting in data grid while the se…

…arch dialog is open. Closes #30.
  • Loading branch information...
ansgarbecker committed Dec 5, 2017
1 parent d029a83 commit 0786673c09339353242317b2eceda5a2a490987d
Showing with 11 additions and 1 deletion.
  1. +11 −1 source/main.pas
View
@@ -4020,13 +4020,19 @@ procedure TMainForm.actNewWindowExecute(Sender: TObject);
procedure TMainForm.actQueryFindReplaceExecute(Sender: TObject);
var
OldDataLocalNumberFormat: Boolean;
begin
// Display search + replace dialog
if not Assigned(FSearchReplaceDialog) then
FSearchReplaceDialog := TfrmSearchReplace.Create(Self);
FSearchReplaceDialog.chkReplace.Checked := Sender = actQueryReplace;
if (ActiveSynMemo(False) <> nil) or (ActiveGrid <> nil) then
if (ActiveSynMemo(False) <> nil) or (ActiveGrid <> nil) then begin
OldDataLocalNumberFormat := DataLocalNumberFormat;
DataLocalNumberFormat := False;
FSearchReplaceDialog.ShowModal;
DataLocalNumberFormat := OldDataLocalNumberFormat;
end;
end;
@@ -4035,6 +4041,7 @@ procedure TMainForm.actQueryFindAgainExecute(Sender: TObject);
NeedDialog: Boolean;
Editor: TSynMemo;
Grid: TVirtualStringTree;
OldDataLocalNumberFormat: Boolean;
begin
// F3 - search or replace again, using previous settings
NeedDialog := not Assigned(FSearchReplaceDialog);
@@ -4052,8 +4059,11 @@ procedure TMainForm.actQueryFindAgainExecute(Sender: TObject);
if NeedDialog then
actQueryFindReplaceExecute(Sender)
else begin
OldDataLocalNumberFormat := DataLocalNumberFormat;
DataLocalNumberFormat := False;
Exclude(FSearchReplaceDialog.Options, ssoEntireScope);
FSearchReplaceDialog.DoSearchReplace(Sender);
DataLocalNumberFormat := OldDataLocalNumberFormat;
end;
end;

0 comments on commit 0786673

Please sign in to comment.