Skip to content

Commit bdea494

Browse files
committed
fix: quick filter prompts on numbers break WHERE clause through local formatting
Refs #2488
1 parent da5e781 commit bdea494

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

source/main.pas

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7497,6 +7497,7 @@ procedure TMainForm.QuickFilterClick(Sender: TObject);
74977497
Item: TMenuItem;
74987498
Conn: TDBConnection;
74997499
ShiftKeyPressed: Boolean;
7500+
OldDataLocalNumberFormat: Boolean;
75007501
begin
75017502
// Set filter for "where..."-clause
75027503
if (PageControlMain.ActivePage <> tabData) or (DataGrid.FocusedColumn = NoColumn) then
@@ -7519,7 +7520,10 @@ procedure TMainForm.QuickFilterClick(Sender: TObject);
75197520
and (Conn.Parameters.NetTypeGroup = ngPgSQL) then begin
75207521
Col := Col + '::text';
75217522
end;
7523+
OldDataLocalNumberFormat := DataLocalNumberFormat;
7524+
DataLocalNumberFormat := False;
75227525
Val := DataGrid.Text[DataGrid.FocusedNode, DataGrid.FocusedColumn];
7526+
DataLocalNumberFormat := OldDataLocalNumberFormat;
75237527
if InputQuery(_('Specify filter-value...'), Act.Caption, Val) then begin
75247528
if Act = actQuickFilterPrompt1 then
75257529
Filter := Col + ' = ' + Conn.EscapeString(Val, TableCol.DataType)
@@ -12282,11 +12286,11 @@ procedure TMainForm.actCopyFormattedExecute(Sender: TObject);
1228212286
Exporter.Highlighter := SynMemo.Highlighter;
1228312287
Exporter.ExportAsText := False;
1228412288
Clipboard.Open;
12285-
Clipboard.TryAsText := SynMemo.SelText;
12286-
Exporter.ExportAll(Explode(SLineBreak, SynMemo.SelText));
12287-
Exporter.CopyToClipboard;
12288-
Clipboard.Close;
12289-
finally
12289+
Clipboard.TryAsText := SynMemo.SelText;
12290+
Exporter.ExportAll(Explode(SLineBreak, SynMemo.SelText));
12291+
Exporter.CopyToClipboard;
12292+
Clipboard.Close;
12293+
finally
1229012294
Exporter.Free;
1229112295
end;
1229212296
end;

0 commit comments

Comments
 (0)