[Git][wxwidgets/wxwidgets][master] 7 commits: Replace strncpy with wxStrlcpy in wxSTC

2 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Mar 7, 2026, 11:12:47 AM (2 days ago) Mar 7
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 60bbf702
    by Filip Hejsek at 2026-03-06T23:33:46+01:00
    Replace strncpy with wxStrlcpy in wxSTC
    
  • a977b7a8
    by Filip Hejsek at 2026-03-06T23:35:09+01:00
    Remove duplicate line in src/stc/gen_iface.py
    
  • c7f8d59d
    by Filip Hejsek at 2026-03-07T00:46:01+01:00
    Use wxScopedCharBuffer instead of wxCharBuffer in wxSTC Direct2D code
    
  • 654d784b
    by Vadim Zeitlin at 2026-03-07T16:00:56+01:00
    Fix assert when clipboard atom names are not ASCII strings
    
    Although atom names are usually ASCII-only, this is not always the case,
    especially when considering MIME type names using extra parameters which
    may contain arbitrary and even user-provided data (e.g. LibreOffice uses
    the file name as one of the parameters for the data it puts on
    clipboard).
    
    Assume the string is in UTF-8 instead, as this seems to be the only
    reasonable thing to do, but also account for the possibility that it
    might not be a valid UTF-8 string by using MAP_INVALID_UTF8_TO_PUA
    fallback flag to wxMBConvUTF8.
    
    Closes #26263.
    
  • 47f7c611
    by Vadim Zeitlin at 2026-03-07T16:01:19+01:00
    Update project version to 3.3.3 in Doxygen docs
    
    This wasn't committed before due to an operator mistake.
    
  • dec96a43
    by Quin Gillespie at 2026-03-07T16:02:57+01:00
    Remove mnemonics from accessible labels of controls
    
    Strip '&' accelerator markers from the label returned by
    wxWindowAccessible::GetName() by using wxControl::GetLabelText() instead
    of assigning the raw label directly.
    
    This is an extra bug fix on top of 85c436dcc4 (Fix accessible label of
    checkboxes broken by recent changes, 2026-03-06).
    
    See #26184, #26187, #26270.
    
    Closes #26275.
    
  • 5d63efc9
    by Vadim Zeitlin at 2026-03-07T16:05:01+01:00
    Merge branch 'stc_cleanup' of github.com:filip-hejsek/wxWidgets
    
    Minor STC cleanup.
    
    See #26273.
    

5 changed files:

Changes:

  • docs/doxygen/Doxyfile
    ... ... @@ -6,7 +6,7 @@
    6 6
     
    
    7 7
     DOXYFILE_ENCODING      = UTF-8
    
    8 8
     PROJECT_NAME           = wxWidgets
    
    9
    -PROJECT_NUMBER         = 3.3.1
    
    9
    +PROJECT_NUMBER         = 3.3.3
    
    10 10
     PROJECT_BRIEF          =
    
    11 11
     PROJECT_LOGO           = logo.png
    
    12 12
     OUTPUT_DIRECTORY       = out
    

  • src/common/wincmn.cpp
    ... ... @@ -3891,7 +3891,7 @@ wxAccStatus wxWindowAccessible::GetName(int childId, wxString* name)
    3891 3891
     
    
    3892 3892
         if (!title.empty())
    
    3893 3893
         {
    
    3894
    -        *name = title;
    
    3894
    +        *name = wxStripMenuCodes(title, wxStrip_Mnemonics);
    
    3895 3895
             return wxACC_OK;
    
    3896 3896
         }
    
    3897 3897
         else
    

  • src/gtk/dataobj.cpp
    ... ... @@ -140,7 +140,11 @@ wxDataFormatId wxDataFormat::GetType() const
    140 140
     wxString wxDataFormat::GetId() const
    
    141 141
     {
    
    142 142
         wxGtkString atom_name(gdk_atom_name(m_format));
    
    143
    -    return wxString::FromAscii(atom_name);
    
    143
    +
    
    144
    +    // In practice atom name is always in UTF-8, but don't lose the name
    
    145
    +    // entirely if it isn't.
    
    146
    +    wxMBConvUTF8 conv(wxMBConvUTF8::MAP_INVALID_UTF8_TO_PUA);
    
    147
    +    return wxString(conv.cMB2WX(atom_name.c_str()));
    
    144 148
     }
    
    145 149
     
    
    146 150
     void wxDataFormat::SetId( NativeFormat format )
    

  • src/stc/PlatWX.cpp
    ... ... @@ -2920,8 +2920,7 @@ void wxSTCListBox::Select(int n)
    2920 2920
     
    
    2921 2921
     void wxSTCListBox::GetValue(int n, char *value, int len) const
    
    2922 2922
     {
    
    2923
    -    strncpy(value, m_labels[n].utf8_str(), len);
    
    2924
    -    value[len-1] = '\0';
    
    2923
    +    wxStrlcpy(value, m_labels[n].utf8_str(), len);
    
    2925 2924
     }
    
    2926 2925
     
    
    2927 2926
     void wxSTCListBox::SetDelegate(IListBoxDelegate* lbDelegate)
    
    ... ... @@ -3226,7 +3225,7 @@ public:
    3226 3225
             // characters from the end of the label until it's short enough.
    
    3227 3226
             wxString ellipsizedLabel = label;
    
    3228 3227
     
    
    3229
    -        wxCharBuffer buffer = ellipsizedLabel.utf8_str();
    
    3228
    +        wxScopedCharBuffer buffer = ellipsizedLabel.utf8_str();
    
    3230 3229
             int curWidth = surface.WidthText(tempFont, buffer.data(), buffer.length());
    
    3231 3230
     
    
    3232 3231
             for ( int i = label.length(); curWidth > rect.GetWidth() && i; --i )
    

  • src/stc/gen_iface.py
    ... ... @@ -590,7 +590,6 @@ methodOverrideMap = {
    590 590
         'AutoCGetMaxWidth'      : ('AutoCompGetMaxWidth', 0, 0),
    
    591 591
         'AutoCSetMaxHeight'     : ('AutoCompSetMaxHeight', 0, 0),
    
    592 592
         'AutoCGetMaxHeight'     : ('AutoCompGetMaxHeight', 0, 0),
    
    593
    -    'AutoCGetMaxHeight'     : ('AutoCompGetMaxHeight', 0, 0),
    
    594 593
         'AutoCSetCaseInsensitiveBehaviour'     : ('AutoCompSetCaseInsensitiveBehaviour', 0, 0),
    
    595 594
         'AutoCGetCaseInsensitiveBehaviour'     : ('AutoCompGetCaseInsensitiveBehaviour', 0, 0),
    
    596 595
         'AutoCSetMulti'         : ('AutoCompSetMulti', 0, 0),
    

Reply all
Reply to author
Forward
0 new messages