[Git][wxwidgets/wxwidgets][3.2] 14 commits: Clarify wxLog::SetActiveTarget()

0 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Nov 1, 2025, 11:49:54 AMNov 1
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch 3.2 at wxWidgets / wxWidgets

Commits:

  • ed76f502
    by Blake-Madden at 2025-10-03T09:48:27+02:00
    Clarify wxLog::SetActiveTarget()
    
    See #25852.
    
    (cherry picked from commit 5de9ceb603ab608bbcba563f584b854ac68bcaf8)
    
  • 46cfa36c
    by Václav Slavík at 2025-10-07T15:03:19+02:00
    Fix nested markup conversion to NSAttributedString
    
    wxMarkupToAttrStringBase implementation of markup parsing failed to
    correctly apply nested attributes: in e.g. <i><b>foo</b></i>, only the
    outer attribute was in effect.
    
    This was due to applying - and overwriting - attributes to a span in
    OnAttrEnd(), which is called first for the inner span, and then for the
    outer one, overwriting all inner changes.
    
    Instead, apply the currently effective attributes to text in OnText(),
    similarly to how wxMarkupParserRenderOutput does it. As a side effect,
    this also eliminates the need to apply default font to the entire range
    first.
    
    See #25864.
    
    (cherry picked from commit ca05aee2f8134dcae53aecd1a952d2a57f51b223)
    
  • f2cff7f4
    by Federico Perini at 2025-10-10T10:07:11+02:00
    Avoid using already destroyed timers in wxOSX
    
    Check that the timer is still valid before using the associated object.
    
    This is necessary because already queued timer events are still
    delivered, even if wxTimer is destroyed.
    
    See #25871.
    
    (cherry picked from commit f25aec1b38bf208a34e0aabefae5e05ca265ecd3)
    
  • addef36a
    by Blake-Madden at 2025-10-15T22:13:38+02:00
    Fix harmless unused parameter warning in wxOSX
    
    Add missing WXUNUSED().
    
    See #25880.
    
    (cherry picked from commit 33b289bb9ba39c3ce207d172fdf3a6e33fdec16f)
    
  • 978e2a24
    by Blake-Madden at 2025-10-15T22:21:28+02:00
    Check that wxRibbonBar tab icon is valid before using it
    
    Using invalid item resulted in an assert, avoid it by checking if it is
    valid before using it.
    
    Also avoid calling GetIcon() and GetLogicalWidth() twice in a row by
    storing the result in a variable.
    
    See #25881.
    
    (cherry picked from commit 3f9d34b4a161cb1aeeba04017691a48bb8889d60)
    
    Co-authored-by: Vadim Zeitlin <va...@wxwidgets.org>
    
  • 9de810e2
    by Václav Slavík at 2025-10-15T22:23:53+02:00
    Improve padding when using HiDPI in generic wxDataViewCtrl
    
    It looked almost non-existent at 200%, so scale it with DPI to improve
    the control appearance.
    
    Closes #25882.
    
    (cherry picked from commit 450aa484afd242d1ba9e43fe0d7a00b0b3b273af)
    
  • eb8287f2
    by Václav Slavík at 2025-10-15T22:25:11+02:00
    Fix compilation with wxUSE_OWNER_DRAWN==0
    
    Add missing wxUSE_OWNER_DRAWN check to wxMenuItem code.
    
    Closes #25883.
    
    (cherry picked from commit 7d91e361eb6fae730434df8f6f3abc4c17d91650)
    
  • 1a1a6838
    by DietmarSchwertberger at 2025-10-15T22:29:35+02:00
    Fix selecting individual columns with Ctrl-Click in wxGrid
    
    This didn't work correctly because the check if the column was already
    selected in wxGridColumnOperations::IsLineInSelection() used incorrect
    parameter order when calling IsInSelection().
    
    See #25884.
    
    (cherry picked from commit c7e5734797078dd293cf05ba683bcd7603eebf53)
    
  • 04bd8091
    by Blake-Madden at 2025-10-19T16:01:44+02:00
    Fix bitmap position in wxDC::DrawLabel() in high DPI
    
    Use bitmap size in logical, not physical, pixels to position it
    correctly.
    
    See #25888.
    
    (cherry picked from commit 23083720a9f8d134c6d7b481d567e133d9384621)
    
  • 707cb8ef
    by Vadim Zeitlin at 2025-10-20T00:58:44+02:00
    Revert to using FreeBSD 14.2 for Cirrus CI builds
    
    FreeBSD 15 seems to support inotify() too now, but our tests still don't
    pass when using it, probably because it is still implemented in terms of
    kqueue() internally. Until this can be fixed, use the same FreeBSD 14.2
    as in master.
    
  • 925aaa5e
    by Vadim Zeitlin at 2025-10-22T20:12:30+02:00
    Fix fatal assert when using box indicators in wxStyledTextCtrl
    
    This assert, generated from wxEVT_PAINT handler, happened because
    SurfaceImpl class unconditionally casts its wxDC to wxMemoryDC before
    creating wxGraphicsContext from it, but the actual wxDC was a wxPaintDC,
    created in wxStyledTextCtrl::OnPaint(), and not a wxMemoryDC.
    
    Fix this by creating wxBufferedPaintDC, which is a wxMemoryDC, instead.
    
    Note that it is not clear how could this work before as OnPaint()
    created wxPaintDC since always, and SurfaceImpl seems to have always
    needed wxMemoryDC too. It would also be better to avoid casting wxDC to
    wxMemoryDC in the first place, as this forces us to use wxMemoryDC even
    on platforms using double-buffering, i.e. effectively unnecessarily
    triple-buffering drawing here.
    
    (cherry picked from commit e92f57b421938e00f0ad944c281c2e353eee2ab8)
    
    See #25917.
    
  • 9317d44a
    by Stefan Csomor at 2025-10-25T17:44:33+02:00
    Fix handling filters in wxFileDialog in wxOSX
    
    As allowedTypes were restricted to the first filter expression, choosing
    another filter only showed the files conforming to both expressions
    instead of only applying the selected filter.
    
    This commit is best viewed ignoring whitespace-only changes.
    
    Fixes wxWidgets/Phoenix/issues#2806
    
    See #25918, #25922.
    
    (cherry picked from commit b153aafee9d74ecfaef7b1447b79012e6e60c11a)
    
  • 2ec9a3c7
    by Vadim Zeitlin at 2025-10-25T23:47:01+02:00
    Recalculate wxGenericTreeCtrl line height after font change
    
    This ensures that the items always consume as much space as they need
    vertically and not more.
    
    See #16428.
    
    (cherry picked from commit 3e937bbd19aaa500fdfd9593cd9cf79d0ef36d15)
    
  • 33d52db8
    by Vadim Zeitlin at 2025-10-31T14:59:58+01:00
    Fix compilation problem due to memset_s() when using PCH
    
    Define __STDC_WANT_LIB_EXT1__ in wx/platform.h, which is included before
    the standard headers even when using PCH, to make sure memset_s()
    declaration is available in this case too.
    
    See #24687.
    
    (cherry picked from commit e913e9eba4815d5b2fe8148ed9b8b61e0441160f)
    

16 changed files:

Changes:

  • .cirrus.yml
    ... ... @@ -11,7 +11,7 @@ task:
    11 11
       skip: "changesIncludeOnly('appveyor.yml','CMakeLists.txt','.circleci/**','.github/**','docs/**','interface/**','include/wx/{msw,osx,qt}/**','src/{msw,osx,qt}/**','build/{cmake,msw,osx}/**')"
    
    12 12
       name: Cirrus CI / FreeBSD wxGTK 3
    
    13 13
       freebsd_instance:
    
    14
    -    image_family: freebsd-15-0-snap
    
    14
    +    image_family: freebsd-14-2
    
    15 15
     
    
    16 16
       before_script: |
    
    17 17
         echo LD_LIBRARY_PATH=`pwd`/lib >> $CIRRUS_ENV
    

  • docs/changes.txt
    ... ... @@ -263,8 +263,11 @@ All (GUI):
    263 263
     
    
    264 264
     - Respect menu path style in wxFileHistory::AddFilesToMenu() (Bill Su, #25451).
    
    265 265
     - Don't assert in wxGridSizer::Calc{Cols,Rows}() if sizer is empty (#25641).
    
    266
    +- Fix bitmap position in wxDC::DrawLabel() in high DPI (Blake Madden, #25888).
    
    266 267
     - Fix calling wxDataViewCtrl::Collapse() from event handler (#25631).
    
    268
    +- Fix selecting columns in wxGrid with mouse (Dietmar Schwertberger, #25884).
    
    267 269
     - Improve wxActivityIndicator dots colour contrast with background (#25405).
    
    270
    +- Update wxGenericTreeCtrl item height after changing its font (#16428).
    
    268 271
     
    
    269 272
     wxGTK:
    
    270 273
     
    
    ... ... @@ -293,6 +296,10 @@ wxOSX:
    293 296
     - Fix memory leak in wxColour::Set() (#25569).
    
    294 297
     - Fix regression with configure build under macOS < 12 (#25675).
    
    295 298
     - Fix build under macOS 26 Tahoe (#25798).
    
    299
    +- Fix build problem with memset_s() with PCH enabled (#24687).
    
    300
    +- Fix nested markup attributes handling (Václav Slavík, #25864).
    
    301
    +- Fix possible use of already destroyed wxTimers (Federico Perini, #25871).
    
    302
    +- Fix handling of multiple filters in wxFileDialog (#25918).
    
    296 303
     
    
    297 304
     
    
    298 305
     3.2.8.1: (released 2025-05-25)
    

  • include/wx/generic/private/grid.h
    ... ... @@ -917,7 +917,7 @@ public:
    917 917
             { grid->DeselectCol(line); }
    
    918 918
     
    
    919 919
         virtual bool IsLineInSelection(wxGrid *grid, int line) const wxOVERRIDE
    
    920
    -        { return grid->m_selection->IsInSelection(line, 0); }
    
    920
    +        { return grid->m_selection->IsInSelection(0, line); }
    
    921 921
     
    
    922 922
         virtual wxGrid::EventResult SendEvent(wxGrid *grid, wxEventType eventType,
    
    923 923
             int line, const wxMouseEvent& event) const wxOVERRIDE
    

  • include/wx/osx/cocoa/private/markuptoattr.h
    ... ... @@ -27,7 +27,7 @@ protected:
    27 27
               m_attrString(NULL)
    
    28 28
         {}
    
    29 29
     
    
    30
    -    void Parse(const wxFont& font, const wxString& markup)
    
    30
    +    void Parse(const wxFont& WXUNUSED(font), const wxString& markup)
    
    31 31
         {
    
    32 32
             const wxCFStringRef label(PrepareText(wxMarkupParser::Strip(markup)));
    
    33 33
             m_attrString = [[NSMutableAttributedString alloc]
    
    ... ... @@ -37,12 +37,6 @@ protected:
    37 37
     
    
    38 38
             [m_attrString beginEditing];
    
    39 39
     
    
    40
    -        // First thing we do is change the default string font: as mentioned in
    
    41
    -        // Apple documentation, attributed strings use "Helvetica 12" font by
    
    42
    -        // default which is different from the system "Lucida Grande" font. So
    
    43
    -        // we need to explicitly change the font for the entire string.
    
    44
    -        ApplyFont(font, NSMakeRange(0, [m_attrString length]));
    
    45
    -
    
    46 40
             // Now translate the markup tags to corresponding attributes.
    
    47 41
             wxMarkupParser parser(*this);
    
    48 42
             parser.Parse(markup);
    
    ... ... @@ -56,27 +50,6 @@ protected:
    56 50
                 [m_attrString release];
    
    57 51
         }
    
    58 52
     
    
    59
    -    void ApplyFont(const wxFont& font, const NSRange& range)
    
    60
    -    {
    
    61
    -        [m_attrString addAttribute:NSFontAttributeName
    
    62
    -                      value:font.OSXGetNSFont()
    
    63
    -                      range:range];
    
    64
    -
    
    65
    -        if ( font.GetStrikethrough() )
    
    66
    -        {
    
    67
    -            [m_attrString addAttribute:NSStrikethroughStyleAttributeName
    
    68
    -                                 value:@(NSUnderlineStyleSingle)
    
    69
    -                                 range:range];
    
    70
    -        }
    
    71
    -
    
    72
    -        if ( font.GetUnderlined() )
    
    73
    -        {
    
    74
    -            [m_attrString addAttribute:NSUnderlineStyleAttributeName
    
    75
    -                                 value:@(NSUnderlineStyleSingle)
    
    76
    -                                 range:range];
    
    77
    -        }
    
    78
    -    }
    
    79
    -
    
    80 53
         // prepare text chunk for display, e.g. strip mnemonics from it
    
    81 54
         virtual wxString PrepareText(const wxString& text) = 0;
    
    82 55
     
    
    ... ... @@ -89,53 +62,42 @@ public:
    89 62
             return m_attrString;
    
    90 63
         }
    
    91 64
     
    
    92
    -
    
    93 65
         // Implement base class pure virtual methods to process markup tags.
    
    94 66
         virtual void OnText(const wxString& text)
    
    95 67
         {
    
    96
    -        m_pos += PrepareText(text).length();
    
    97
    -    }
    
    68
    +        const Attr& attr = GetAttr();
    
    98 69
     
    
    99
    -    virtual void OnAttrStart(const Attr& WXUNUSED(attr))
    
    100
    -    {
    
    101
    -        // Just remember the starting position of the range, we can't really
    
    102
    -        // set the attribute until we find the end of it.
    
    103
    -        m_rangeStarts.push(m_pos);
    
    104
    -    }
    
    70
    +        NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    
    105 71
     
    
    106
    -    virtual void OnAttrEnd(const Attr& attr)
    
    107
    -    {
    
    108
    -        unsigned start = m_rangeStarts.top();
    
    109
    -        m_rangeStarts.pop();
    
    110
    -
    
    111
    -        const NSRange range = NSMakeRange(start, m_pos - start);
    
    112
    -
    
    113
    -        ApplyFont(attr.font, range);
    
    114
    -
    
    115
    -        if ( attr.foreground.IsOk() )
    
    116
    -        {
    
    117
    -            [m_attrString addAttribute:NSForegroundColorAttributeName
    
    118
    -                          value:attr.foreground.OSXGetNSColor()
    
    119
    -                          range:range];
    
    120
    -        }
    
    121
    -
    
    122
    -        if ( attr.background.IsOk() )
    
    123
    -        {
    
    124
    -            [m_attrString addAttribute:NSBackgroundColorAttributeName
    
    125
    -                          value:attr.background.OSXGetNSColor()
    
    126
    -                          range:range];
    
    127
    -        }
    
    72
    +        dict[NSFontAttributeName] = attr.effectiveFont.OSXGetNSFont();
    
    73
    +        if ( attr.effectiveFont.GetStrikethrough() )
    
    74
    +            dict[NSStrikethroughStyleAttributeName] = @(NSUnderlineStyleSingle);
    
    75
    +        if ( attr.effectiveFont.GetUnderlined() )
    
    76
    +            dict[NSUnderlineStyleAttributeName] = @(NSUnderlineStyleSingle);
    
    77
    +
    
    78
    +        if ( attr.effectiveForeground.IsOk() )
    
    79
    +            dict[NSForegroundColorAttributeName] = attr.effectiveForeground.OSXGetNSColor();
    
    80
    +
    
    81
    +        if ( attr.effectiveBackground.IsOk() )
    
    82
    +            dict[NSBackgroundColorAttributeName] = attr.effectiveBackground.OSXGetNSColor();
    
    83
    +
    
    84
    +        const unsigned len = PrepareText(text).length();
    
    85
    +
    
    86
    +        [m_attrString addAttributes:dict range:NSMakeRange(m_pos, len)];
    
    87
    +
    
    88
    +        m_pos += len;
    
    128 89
         }
    
    129 90
     
    
    91
    +    virtual void OnAttrStart(const Attr& WXUNUSED(attr)) {}
    
    92
    +
    
    93
    +    virtual void OnAttrEnd(const Attr& WXUNUSED(attr)) {}
    
    94
    +
    
    130 95
     private:
    
    131 96
         // The attributed string we're building.
    
    132 97
         NSMutableAttributedString *m_attrString;
    
    133 98
     
    
    134 99
         // The current position in the output string.
    
    135 100
         unsigned m_pos;
    
    136
    -
    
    137
    -    // The positions of starting ranges.
    
    138
    -    wxStack<unsigned> m_rangeStarts;
    
    139 101
     };
    
    140 102
     
    
    141 103
     
    

  • include/wx/platform.h
    ... ... @@ -286,6 +286,12 @@
    286 286
     #        if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
    
    287 287
     #            define wxSIZE_T_IS_ULONG
    
    288 288
     #        endif
    
    289
    +
    
    290
    +        /* Define this as soon as possible and before string.h is included to
    
    291
    +           get memset_s() declaration from it if available. */
    
    292
    +#       ifndef __STDC_WANT_LIB_EXT1__
    
    293
    +#           define __STDC_WANT_LIB_EXT1__ 1
    
    294
    +#       endif
    
    289 295
     #    endif
    
    290 296
     
    
    291 297
     /*
    

  • interface/wx/log.h
    ... ... @@ -306,6 +306,10 @@ public:
    306 306
             active log target is set to @NULL a new default log target will be
    
    307 307
             created when logging occurs.
    
    308 308
     
    
    309
    +        @note The logging system will take ownership of the target you pass
    
    310
    +        in here. However, it is your responsibility to delete the target you
    
    311
    +        are replacing (i.e., the return value of this function).
    
    312
    +
    
    309 313
             @see SetThreadActiveTarget()
    
    310 314
         */
    
    311 315
         static wxLog* SetActiveTarget(wxLog* logtarget);
    

  • src/common/dcbase.cpp
    ... ... @@ -1202,8 +1202,8 @@ void wxDC::DrawLabel(const wxString& text,
    1202 1202
         wxCoord width, height;
    
    1203 1203
         if ( bitmap.IsOk() )
    
    1204 1204
         {
    
    1205
    -        width = widthText + bitmap.GetWidth();
    
    1206
    -        height = bitmap.GetHeight();
    
    1205
    +        width = widthText + wxRound(bitmap.GetLogicalWidth());
    
    1206
    +        height = wxRound(bitmap.GetLogicalHeight());
    
    1207 1207
         }
    
    1208 1208
         else // no bitmap
    
    1209 1209
         {
    
    ... ... @@ -1246,7 +1246,7 @@ void wxDC::DrawLabel(const wxString& text,
    1246 1246
         {
    
    1247 1247
             DrawBitmap(bitmap, x, y, true /* use mask */);
    
    1248 1248
     
    
    1249
    -        wxCoord offset = bitmap.GetWidth() + 4;
    
    1249
    +        wxCoord offset = wxRound(bitmap.GetLogicalWidth()) + 4;
    
    1250 1250
             x += offset;
    
    1251 1251
             width -= offset;
    
    1252 1252
     
    

  • src/generic/datavgen.cpp
    ... ... @@ -2507,7 +2507,7 @@ wxBitmap wxDataViewMainWindow::CreateItemBitmap( unsigned int row, int &indent )
    2507 2507
             if ( cell->PrepareForItem(model, item, column->GetModelColumn()) )
    
    2508 2508
             {
    
    2509 2509
                 wxRect item_rect(x, 0, width, height);
    
    2510
    -            item_rect.Deflate(PADDING_RIGHTLEFT, 0);
    
    2510
    +            item_rect.Deflate(FromDIP(PADDING_RIGHTLEFT), 0);
    
    2511 2511
     
    
    2512 2512
                 // dc.SetClippingRegion( item_rect );
    
    2513 2513
                 cell->WXCallRender(item_rect, &dc, 0);
    
    ... ... @@ -2932,7 +2932,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
    2932 2932
                 }
    
    2933 2933
     
    
    2934 2934
                 wxRect item_rect = cell_rect;
    
    2935
    -            item_rect.Deflate(PADDING_RIGHTLEFT, 0);
    
    2935
    +            item_rect.Deflate(FromDIP(PADDING_RIGHTLEFT), 0);
    
    2936 2936
     
    
    2937 2937
                 // account for the tree indent (harmless if we're not indented)
    
    2938 2938
                 item_rect.x += indent;
    
    ... ... @@ -6156,7 +6156,7 @@ unsigned int wxDataViewCtrl::GetBestColumnWidth(int idx) const
    6156 6156
     
    
    6157 6157
         int max_width = calculator.GetMaxWidth();
    
    6158 6158
         if ( max_width > 0 )
    
    6159
    -        max_width += 2 * PADDING_RIGHTLEFT;
    
    6159
    +        max_width += 2 * FromDIP(PADDING_RIGHTLEFT);
    
    6160 6160
     
    
    6161 6161
         const_cast<wxDataViewCtrl*>(this)->m_colsBestWidths[idx].width = max_width;
    
    6162 6162
         return max_width;
    

  • src/generic/treectlg.cpp
    ... ... @@ -1336,6 +1336,8 @@ bool wxGenericTreeCtrl::SetFont( const wxFont &font )
    1336 1336
         m_normalFont = font;
    
    1337 1337
         m_boldFont = m_normalFont.Bold();
    
    1338 1338
     
    
    1339
    +    CalculateLineHeight();
    
    1340
    +
    
    1339 1341
         if (m_anchor)
    
    1340 1342
             m_anchor->RecursiveResetTextSize();
    
    1341 1343
     
    

  • src/msw/menuitem.cpp
    ... ... @@ -761,12 +761,14 @@ void wxMenuItem::DoSetBitmap(const wxBitmapBundle& bmpNew, bool bChecked)
    761 761
     
    
    762 762
     void wxMenuItem::SetupBitmaps()
    
    763 763
     {
    
    764
    +#if wxUSE_OWNER_DRAWN
    
    764 765
         // Owner-drawn items must not return valid bitmaps even if they have them,
    
    765 766
         // this somehow breaks the item measuring logic and the menu may not become
    
    766 767
         // wide enough to accommodate the items text, so just don't do anything at
    
    767 768
         // all for them here.
    
    768 769
         if ( IsOwnerDrawn() )
    
    769 770
             return;
    
    771
    +#endif // wxUSE_OWNER_DRAWN
    
    770 772
     
    
    771 773
         const int itemPos = MSGetMenuItemPos();
    
    772 774
         if ( itemPos == -1 )
    

  • src/osx/cocoa/filedlg.mm
    ... ... @@ -261,7 +261,7 @@ void wxFileDialog::ShowWindowModal()
    261 261
     
    
    262 262
         wxCHECK_RET(parentWindow, "Window modal display requires parent.");
    
    263 263
     
    
    264
    -    NSArray* types = GetTypesFromFilter( m_wildCard, m_filterNames, m_filterExtensions, m_currentExtensions ) ;
    
    264
    +    NSArray* allTypes = GetTypesFromFilter( m_wildCard, m_filterNames, m_filterExtensions, m_currentExtensions ) ;
    
    265 265
     
    
    266 266
         m_useFileTypeFilter = m_filterExtensions.GetCount() > 1;
    
    267 267
     
    
    ... ... @@ -287,7 +287,6 @@ void wxFileDialog::ShowWindowModal()
    287 287
         else if ( m_useFileTypeFilter )
    
    288 288
         {
    
    289 289
           m_firstFileTypeFilter = GetMatchingFilterExtension(m_fileName);
    
    290
    -      types = GetTypesFromExtension(m_filterExtensions[m_firstFileTypeFilter], m_currentExtensions);
    
    291 290
         }
    
    292 291
     
    
    293 292
         if ( HasFlag(wxFD_SAVE) )
    
    ... ... @@ -303,7 +302,7 @@ void wxFileDialog::ShowWindowModal()
    303 302
             // be able to pass this in
    
    304 303
             [sPanel setTreatsFilePackagesAsDirectories:NO];
    
    305 304
             [sPanel setCanSelectHiddenExtension:YES];
    
    306
    -        [sPanel setAllowedFileTypes:types];
    
    305
    +        [sPanel setAllowedFileTypes:allTypes];
    
    307 306
             [sPanel setAllowsOtherFileTypes:NO];
    
    308 307
             [sPanel setShowsHiddenFiles: HasFlag(wxFD_SHOW_HIDDEN) ? YES : NO];
    
    309 308
     
    
    ... ... @@ -317,14 +316,17 @@ void wxFileDialog::ShowWindowModal()
    317 316
              */
    
    318 317
             if(m_firstFileTypeFilter > 0)
    
    319 318
             {
    
    320
    -          DoOnFilterSelected(m_firstFileTypeFilter);
    
    319
    +            DoOnFilterSelected(m_firstFileTypeFilter);
    
    321 320
             }
    
    322 321
             else
    
    323 322
             {
    
    324
    -          if ( m_delegate )
    
    325
    -            [(wxOpenSavePanelDelegate*) m_delegate setAllowedExtensions: m_currentExtensions];
    
    326
    -          else
    
    327
    -            [sPanel setAllowedFileTypes: types];
    
    323
    +            NSArray* types = GetTypesFromExtension(m_filterExtensions[m_firstFileTypeFilter], m_currentExtensions);
    
    324
    +            if ( m_delegate )
    
    325
    +                [(wxOpenSavePanelDelegate*) m_delegate setAllowedExtensions: m_currentExtensions];
    
    326
    +            else
    
    327
    +            {
    
    328
    +                [sPanel setAllowedFileTypes: types];
    
    329
    +            }
    
    328 330
             }
    
    329 331
     
    
    330 332
             NSWindow* nativeParent = parentWindow->GetWXWindow();
    
    ... ... @@ -352,7 +354,7 @@ void wxFileDialog::ShowWindowModal()
    352 354
             [oPanel setCanChooseFiles:YES];
    
    353 355
             [oPanel setMessage:cf.AsNSString()];
    
    354 356
             [oPanel setAllowsMultipleSelection: (HasFlag(wxFD_MULTIPLE) ? YES : NO )];
    
    355
    -        [oPanel setAllowedFileTypes:types];
    
    357
    +        [oPanel setAllowedFileTypes:allTypes];
    
    356 358
             [oPanel setAllowsOtherFileTypes:NO];
    
    357 359
             [oPanel setShowsHiddenFiles: HasFlag(wxFD_SHOW_HIDDEN) ? YES : NO];
    
    358 360
     
    
    ... ... @@ -368,8 +370,6 @@ void wxFileDialog::ShowWindowModal()
    368 370
             {
    
    369 371
               if ( m_delegate )
    
    370 372
                 [(wxOpenSavePanelDelegate*) m_delegate setAllowedExtensions: m_currentExtensions];
    
    371
    -          else
    
    372
    -            [oPanel setAllowedFileTypes: types];
    
    373 373
             }
    
    374 374
     
    
    375 375
             NSWindow* nativeParent = parentWindow->GetWXWindow();
    
    ... ... @@ -464,7 +464,9 @@ void wxFileDialog::DoOnFilterSelected(int index)
    464 464
             [panel validateVisibleColumns];
    
    465 465
         }
    
    466 466
         else
    
    467
    +    {
    
    467 468
             [panel setAllowedFileTypes:types];
    
    469
    +    }
    
    468 470
     
    
    469 471
         m_currentlySelectedFilterIndex = index;
    
    470 472
     
    
    ... ... @@ -579,7 +581,7 @@ int wxFileDialog::ShowModal()
    579 581
     
    
    580 582
         int returnCode = -1;
    
    581 583
     
    
    582
    -    NSArray* types = GetTypesFromFilter( m_wildCard, m_filterNames, m_filterExtensions, m_currentExtensions ) ;
    
    584
    +    NSArray* allTypes = GetTypesFromFilter( m_wildCard, m_filterNames, m_filterExtensions, m_currentExtensions ) ;
    
    583 585
     
    
    584 586
         m_useFileTypeFilter = m_filterExtensions.GetCount() > 1;
    
    585 587
     
    
    ... ... @@ -605,7 +607,6 @@ int wxFileDialog::ShowModal()
    605 607
         else if ( m_useFileTypeFilter )
    
    606 608
         {
    
    607 609
             m_firstFileTypeFilter = GetMatchingFilterExtension(m_fileName);
    
    608
    -        types = GetTypesFromExtension(m_filterExtensions[m_firstFileTypeFilter], m_currentExtensions);
    
    609 610
         }
    
    610 611
     
    
    611 612
         OSXBeginModalDialog();
    
    ... ... @@ -623,7 +624,7 @@ int wxFileDialog::ShowModal()
    623 624
             // be able to pass this in
    
    624 625
             [sPanel setTreatsFilePackagesAsDirectories:NO];
    
    625 626
             [sPanel setCanSelectHiddenExtension:YES];
    
    626
    -        [sPanel setAllowedFileTypes:types];
    
    627
    +        [sPanel setAllowedFileTypes:allTypes];
    
    627 628
             [sPanel setAllowsOtherFileTypes:NO];
    
    628 629
             [sPanel setShowsHiddenFiles: HasFlag(wxFD_SHOW_HIDDEN) ? YES : NO];
    
    629 630
     
    
    ... ... @@ -645,10 +646,11 @@ int wxFileDialog::ShowModal()
    645 646
             }
    
    646 647
             else
    
    647 648
             {
    
    648
    -          if ( m_delegate )
    
    649
    -            [(wxOpenSavePanelDelegate*) m_delegate setAllowedExtensions: m_currentExtensions];
    
    650
    -          else
    
    651
    -            [sPanel setAllowedFileTypes: types];
    
    649
    +            NSArray* types = GetTypesFromExtension(m_filterExtensions[m_firstFileTypeFilter], m_currentExtensions);
    
    650
    +            if ( m_delegate )
    
    651
    +                [(wxOpenSavePanelDelegate*) m_delegate setAllowedExtensions: m_currentExtensions];
    
    652
    +            else
    
    653
    +                [sPanel setAllowedFileTypes: types];
    
    652 654
             }
    
    653 655
     
    
    654 656
             if ( !m_dir.IsEmpty() )
    
    ... ... @@ -677,7 +679,7 @@ int wxFileDialog::ShowModal()
    677 679
             [oPanel setCanChooseFiles:YES];
    
    678 680
             [oPanel setMessage:cf.AsNSString()];
    
    679 681
             [oPanel setAllowsMultipleSelection: (HasFlag(wxFD_MULTIPLE) ? YES : NO )];
    
    680
    -        [oPanel setAllowedFileTypes:types];
    
    682
    +        [oPanel setAllowedFileTypes:allTypes];
    
    681 683
             [oPanel setAllowsOtherFileTypes:NO];
    
    682 684
             [oPanel setShowsHiddenFiles: HasFlag(wxFD_SHOW_HIDDEN) ? YES : NO];
    
    683 685
     
    
    ... ... @@ -693,9 +695,9 @@ int wxFileDialog::ShowModal()
    693 695
             {
    
    694 696
                 if ( m_delegate )
    
    695 697
                     [(wxOpenSavePanelDelegate*) m_delegate setAllowedExtensions: m_currentExtensions];
    
    696
    -            else
    
    697
    -                [oPanel setAllowedFileTypes: types];
    
    698 698
             }
    
    699
    +
    
    700
    +
    
    699 701
             if ( !m_dir.IsEmpty() )
    
    700 702
                 [oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString() 
    
    701 703
                                                    isDirectory:YES]];
    

  • src/osx/core/timer.cpp
    ... ... @@ -25,11 +25,17 @@ struct wxOSXTimerInfo
    25 25
         CFRunLoopTimerRef   m_timerRef;
    
    26 26
     };
    
    27 27
     
    
    28
    -void wxProcessTimer(CFRunLoopTimerRef WXUNUSED(theTimer), void *data)
    
    28
    +void wxProcessTimer(CFRunLoopTimerRef theTimer, void *data)
    
    29 29
     {
    
    30 30
         if ( data == NULL )
    
    31 31
             return;
    
    32 32
     
    
    33
    +    // CFRunLoop can fire timer callbacks after CFRunLoopTimerInvalidate()
    
    34
    +    // has been called (e.g., if the callback was already queued when Stop() was called).
    
    35
    +    // Verify the timer is still valid before proceeding to avoid crashes.
    
    36
    +    if ( !CFRunLoopTimerIsValid(theTimer) )
    
    37
    +        return;
    
    38
    +
    
    33 39
         wxOSXTimerImpl* timer = (wxOSXTimerImpl*)data;
    
    34 40
     
    
    35 41
         if ( timer->IsOneShot() )
    

  • src/ribbon/art_msw.cpp
    ... ... @@ -1478,8 +1478,13 @@ void wxRibbonMSWArtProvider::DrawTab(
    1478 1478
                 int x = tab.rect.x + 3;
    
    1479 1479
                 if(m_flags & wxRIBBON_BAR_SHOW_PAGE_ICONS)
    
    1480 1480
                 {
    
    1481
    -                x += 3 + tab.page->GetIcon().GetLogicalWidth();
    
    1482
    -                width -= 3 + tab.page->GetIcon().GetLogicalWidth();
    
    1481
    +                const wxBitmap& icon = tab.page->GetIcon();
    
    1482
    +                if (icon.IsOk())
    
    1483
    +                {
    
    1484
    +                    const int iconWidth = icon.GetLogicalWidth();
    
    1485
    +                    x += 3 + iconWidth;
    
    1486
    +                    width -= 3 + iconWidth;
    
    1487
    +                }
    
    1483 1488
                 }
    
    1484 1489
                 int y = tab.rect.y + (tab.rect.height - text_height) / 2;
    
    1485 1490
     
    

  • src/stc/stc.cpp
    ... ... @@ -5194,7 +5194,9 @@ void wxStyledTextCtrl::StartStyling(int start, int unused)
    5194 5194
     // Event handlers
    
    5195 5195
     
    
    5196 5196
     void wxStyledTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(evt)) {
    
    5197
    -    wxPaintDC dc(this);
    
    5197
    +    // This _must_ be a wxMemoryDC because the code in SurfaceImpl (see
    
    5198
    +    // PlatWX.cpp) unconditionally casts it to wxMemoryDC currently.
    
    5199
    +    wxBufferedPaintDC dc(this);
    
    5198 5200
         m_swx->DoPaint(&dc, GetUpdateRegion().GetBox());
    
    5199 5201
     }
    
    5200 5202
     
    

  • src/stc/stc.cpp.in
    ... ... @@ -721,7 +721,9 @@ void wxStyledTextCtrl::StartStyling(int start, int unused)
    721 721
     // Event handlers
    
    722 722
     
    
    723 723
     void wxStyledTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(evt)) {
    
    724
    -    wxPaintDC dc(this);
    
    724
    +    // This _must_ be a wxMemoryDC because the code in SurfaceImpl (see
    
    725
    +    // PlatWX.cpp) unconditionally casts it to wxMemoryDC currently.
    
    726
    +    wxBufferedPaintDC dc(this);
    
    725 727
         m_swx->DoPaint(&dc, GetUpdateRegion().GetBox());
    
    726 728
     }
    
    727 729
     
    

  • src/unix/utilsunx.cpp
    ... ... @@ -18,10 +18,6 @@
    18 18
     // for compilers that support precompilation, includes "wx.h".
    
    19 19
     #include "wx/wxprec.h"
    
    20 20
     
    
    21
    -// Define this as soon as possible and before string.h is included to get
    
    22
    -// memset_s() declaration from it if available.
    
    23
    -#define __STDC_WANT_LIB_EXT1__ 1
    
    24
    -
    
    25 21
     #include "wx/utils.h"
    
    26 22
     
    
    27 23
     #if !defined(HAVE_SETENV) && defined(HAVE_PUTENV)
    

Reply all
Reply to author
Forward
0 new messages