@@ -14,7 +14,7 @@ interface
1414 Types, LCLType, EditBtn, FileUtil, LMessages, jsonconf, DelphiCompat,
1515 LazStringUtils, dbconnection, dbstructures, dbstructures.mysql, generic_types,
1616 apphelpers, extra_controls, createdatabase, SynEditMarkupBracket,
17- searchreplace, ImgList, IniFiles, LazFileUtils, tabletools,
17+ searchreplace, ImgList, IniFiles, LazFileUtils, LazUTF8, tabletools,
1818 lazaruscompat, extfiledialog;
1919
2020
@@ -2781,10 +2781,7 @@ procedure TMainForm.actClearEditorExecute(Sender: TObject);
27812781 m := SynMemoFilter;
27822782 editFilterSearch.Clear;
27832783 end;
2784- m.SelectAll;
2785- m.SelText := '';
2786- m.SelStart := 0;
2787- m.SelEnd := 0;
2784+ m.ClearAll;
27882785 if Sender = actClearQueryEditor then begin
27892786 QueryTabs.ActiveTab.MemoFilename := '';
27902787 QueryTabs.ActiveTab.Memo.Modified := False;
@@ -5272,7 +5269,7 @@ procedure TMainForm.actDataInsertExecute(Sender: TObject);
52725269 if (Sender = actDataDuplicateRowWithoutKeys) or (Sender = actDataDuplicateRowWithKeys) then
52735270 DupeNode := Grid.FocusedNode;
52745271 RowNum := Results.InsertRow;
5275- NewNode := Grid.InsertNode(Grid.FocusedNode, amInsertAfter, PInt64( RowNum) );
5272+ NewNode := Grid.InsertNode(Grid.FocusedNode, amInsertAfter, @ RowNum);
52765273 SelectNode(Grid, NewNode);
52775274 if Assigned(DupeNode) then begin
52785275 // Copy values from source row, ensure we have whole cell data
@@ -5629,7 +5626,8 @@ procedure TMainForm.AnyGridAdvancedHeaderDraw(Sender: TVTHeader;
56295626 var PaintInfo: THeaderPaintInfo; const Elements: THeaderPaintElements);
56305627var
56315628 PaintArea, TextArea, IconArea, SortArea: TRect;
5632- SortText, ColCaption, ColIndex: WideString;
5629+ SortText, ColCaptionW, ColIndex: WideString;
5630+ ColCaption: String;
56335631 TextSpace, ColSortIndex, NumCharTop: Integer;
56345632 ColSortDirection: laz.VirtualTrees.TSortDirection;
56355633 TextSize: TSize;
@@ -5670,13 +5668,13 @@ procedure TMainForm.AnyGridAdvancedHeaderDraw(Sender: TVTHeader;
56705668 PaintArea := PaintInfo.PaintRectangle;
56715669 PaintArea.Inflate(-PaintInfo.Column.Margin, 0);
56725670 DeviceContext := PaintInfo.TargetCanvas.Handle;
5671+ DrawFormat := DT_TOP or DT_NOPREFIX or DT_LEFT;
56735672
56745673 // Draw column name. Code taken from TVirtualTreeColumns.DrawButtonText and modified for our needs
56755674 if hpeText in Elements then begin
56765675
56775676 TextArea := PaintArea;
56785677 SetBkMode(DeviceContext, TRANSPARENT);
5679- DrawFormat := DT_TOP or DT_NOPREFIX or DT_LEFT;
56805678
56815679 if AppSettings.ReadBool(asShowRowId) and (PaintInfo.Column.Index > 0) then begin
56825680 // Paint gray column number left to its caption
@@ -5711,7 +5709,8 @@ procedure TMainForm.AnyGridAdvancedHeaderDraw(Sender: TVTHeader;
57115709 end;
57125710
57135711 SetTextColor(DeviceContext, ColorToRGB(clWindowText));
5714- DrawTextW(DeviceContext, PWideChar(ColCaption), Length(ColCaption), TextArea, DrawFormat);
5712+ ColCaptionW := UTF8ToUTF16(ColCaption);
5713+ DrawTextW(DeviceContext, PWideChar(ColCaptionW), Length(ColCaption), TextArea, DrawFormat);
57155714 end;
57165715
57175716 // Draw image, if any
0 commit comments