From 6268b5c619ac7bd7479c0912275bce89d67d1f23 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 12 May 2022 21:00:01 +0200 Subject: [PATCH] Fix building font sample in STL mode after recent breakage The changes of adb8bbab4d (Sort font names in the dialog showing them in the font sample, 2022-05-12) didn't compile with wxUSE_STL==1 because wxSortedArrayString doesn't inherit from wxArrayString in this case. Fix this by using wxArrayString and its Sort() method instead. --- samples/font/font.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/font/font.cpp b/samples/font/font.cpp index cbe28f8051..f7f7b6d509 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -648,12 +648,15 @@ bool MyFrame::DoEnumerateFamilies(bool fixedWidthOnly, else { // let the user choose - wxSortedArrayString facenames; + wxArrayString facenames; facenames.Alloc(nFacenames); int n; for ( n = 0; n < nFacenames; n++ ) facenames.Add(fontEnumerator.GetFacenames().Item(n)); + // it's more convenient to see the fonts in alphabetical order + facenames.Sort(); + n = wxGetSingleChoiceIndex ( "Choose a facename",