[Git][wxwidgets/wxwidgets][master] Remove otherwise unused variables which only exist to be passed to GetTextExtent()

2 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
May 8, 2026, 9:20:55 PM (8 days ago) May 8
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 40614f71
    by Paul Cornett at 2026-05-08T17:55:26-07:00
    Remove otherwise unused variables which only exist to be passed to GetTextExtent()
    
    Just pass nullptr instead.
    

19 changed files:

Changes:

  • src/aui/auibar.cpp
    ... ... @@ -264,8 +264,8 @@ void wxAuiGenericToolBarArt::DrawLabel(
    264 264
     
    
    265 265
         // we only care about the text height here since the text
    
    266 266
         // will get cropped based on the width of the item
    
    267
    -    int textWidth = 0, textHeight = 0;
    
    268
    -    dc.GetTextExtent(wxT("ABCDHgj"), &textWidth, &textHeight);
    
    267
    +    int textHeight;
    
    268
    +    dc.GetTextExtent(wxT("ABCDHgj"), nullptr, &textHeight);
    
    269 269
     
    
    270 270
         // set the clipping region
    
    271 271
         wxRect clipRect = rect;
    
    ... ... @@ -291,11 +291,8 @@ void wxAuiGenericToolBarArt::DrawButton(
    291 291
         {
    
    292 292
             dc.SetFont(m_font);
    
    293 293
     
    
    294
    -        int tx, ty;
    
    295
    -
    
    296
    -        dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);
    
    297
    -        textWidth = 0;
    
    298
    -        dc.GetTextExtent(item.GetLabel(), &textWidth, &ty);
    
    294
    +        dc.GetTextExtent(wxT("ABCDHgj"), nullptr, &textHeight);
    
    295
    +        dc.GetTextExtent(item.GetLabel(), &textWidth, nullptr);
    
    299 296
         }
    
    300 297
     
    
    301 298
         int bmpX = 0, bmpY = 0;
    
    ... ... @@ -435,14 +432,12 @@ void wxAuiGenericToolBarArt::DrawDropDownButton(
    435 432
         {
    
    436 433
             dc.SetFont(m_font);
    
    437 434
     
    
    438
    -        int tx, ty;
    
    439 435
             if (m_flags & wxAUI_TB_TEXT)
    
    440 436
             {
    
    441
    -            dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);
    
    442
    -            textWidth = 0;
    
    437
    +            dc.GetTextExtent(wxT("ABCDHgj"), nullptr, &textHeight);
    
    443 438
             }
    
    444 439
     
    
    445
    -        dc.GetTextExtent(item.GetLabel(), &textWidth, &ty);
    
    440
    +        dc.GetTextExtent(item.GetLabel(), &textWidth, nullptr);
    
    446 441
         }
    
    447 442
     
    
    448 443
     
    
    ... ... @@ -558,14 +553,12 @@ void wxAuiGenericToolBarArt::DrawControlLabel(
    558 553
     
    
    559 554
         dc.SetFont(m_font);
    
    560 555
     
    
    561
    -    int tx, ty;
    
    562 556
         if (m_flags & wxAUI_TB_TEXT)
    
    563 557
         {
    
    564
    -        dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);
    
    565
    -        textWidth = 0;
    
    558
    +        dc.GetTextExtent(wxT("ABCDHgj"), nullptr, &textHeight);
    
    566 559
         }
    
    567 560
     
    
    568
    -    dc.GetTextExtent(item.GetLabel(), &textWidth, &ty);
    
    561
    +    dc.GetTextExtent(item.GetLabel(), &textWidth, nullptr);
    
    569 562
     
    
    570 563
         // don't draw the label if it is wider than the item width
    
    571 564
         if (textWidth > rect.width)
    
    ... ... @@ -591,11 +584,11 @@ wxSize wxAuiGenericToolBarArt::GetLabelSize(
    591 584
         dc.SetFont(m_font);
    
    592 585
     
    
    593 586
         // get label's height
    
    594
    -    int width = 0, height = 0;
    
    595
    -    dc.GetTextExtent(wxT("ABCDHgj"), &width, &height);
    
    587
    +    int height;
    
    588
    +    dc.GetTextExtent(wxT("ABCDHgj"), nullptr, &height);
    
    596 589
     
    
    597 590
         // get item's width
    
    598
    -    width = item.GetMinSize().GetWidth();
    
    591
    +    int width = item.GetMinSize().GetWidth();
    
    599 592
     
    
    600 593
         if (width == -1)
    
    601 594
         {
    
    ... ... @@ -2251,16 +2244,15 @@ wxSize wxAuiToolBar::GetLabelSize(const wxString& label)
    2251 2244
     {
    
    2252 2245
         wxInfoDC dc(this);
    
    2253 2246
     
    
    2254
    -    int tx, ty;
    
    2255 2247
         int textWidth = 0, textHeight = 0;
    
    2256 2248
     
    
    2257 2249
         dc.SetFont(m_font);
    
    2258 2250
     
    
    2259 2251
         // get the text height
    
    2260
    -    dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);
    
    2252
    +    dc.GetTextExtent(wxT("ABCDHgj"), nullptr, &textHeight);
    
    2261 2253
     
    
    2262 2254
         // get the text width
    
    2263
    -    dc.GetTextExtent(label, &textWidth, &ty);
    
    2255
    +    dc.GetTextExtent(label, &textWidth, nullptr);
    
    2264 2256
     
    
    2265 2257
         return wxSize(textWidth, textHeight);
    
    2266 2258
     }
    

  • src/aui/barartmsw.cpp
    ... ... @@ -126,11 +126,8 @@ void wxAuiMSWToolBarArt::DrawButton(
    126 126
             {
    
    127 127
                 dc.SetFont(m_font);
    
    128 128
     
    
    129
    -            int tx, ty;
    
    130
    -
    
    131
    -            dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);
    
    132
    -            textWidth = 0;
    
    133
    -            dc.GetTextExtent(item.GetLabel(), &textWidth, &ty);
    
    129
    +            dc.GetTextExtent(wxT("ABCDHgj"), nullptr, &textHeight);
    
    130
    +            dc.GetTextExtent(item.GetLabel(), &textWidth, nullptr);
    
    134 131
             }
    
    135 132
     
    
    136 133
             int bmpX = 0, bmpY = 0;
    
    ... ... @@ -241,14 +238,12 @@ void wxAuiMSWToolBarArt::DrawDropDownButton(
    241 238
             {
    
    242 239
                 dc.SetFont(m_font);
    
    243 240
     
    
    244
    -            int tx, ty;
    
    245 241
                 if ( m_flags & wxAUI_TB_TEXT )
    
    246 242
                 {
    
    247
    -                dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);
    
    248
    -                textWidth = 0;
    
    243
    +                dc.GetTextExtent(wxT("ABCDHgj"), nullptr, &textHeight);
    
    249 244
                 }
    
    250 245
     
    
    251
    -            dc.GetTextExtent(item.GetLabel(), &textWidth, &ty);
    
    246
    +            dc.GetTextExtent(item.GetLabel(), &textWidth, nullptr);
    
    252 247
             }
    
    253 248
     
    
    254 249
             int btnState;
    

  • src/aui/dockart.cpp
    ... ... @@ -166,10 +166,10 @@ static void DrawGradientRectangle(wxDC& dc,
    166 166
     
    
    167 167
     wxString wxAuiChopText(wxDC& dc, const wxString& text, int max_size)
    
    168 168
     {
    
    169
    -    wxCoord x,y;
    
    169
    +    wxCoord x;
    
    170 170
     
    
    171 171
         // first check if the text fits with no problems
    
    172
    -    dc.GetTextExtent(text, &x, &y);
    
    172
    +    dc.GetTextExtent(text, &x, nullptr);
    
    173 173
         if (x <= max_size)
    
    174 174
             return text;
    
    175 175
     
    
    ... ... @@ -180,7 +180,7 @@ wxString wxAuiChopText(wxDC& dc, const wxString& text, int max_size)
    180 180
             wxString s = text.Left(i);
    
    181 181
             s += wxT("...");
    
    182 182
     
    
    183
    -        dc.GetTextExtent(s, &x, &y);
    
    183
    +        dc.GetTextExtent(s, &x, nullptr);
    
    184 184
             if (x > max_size)
    
    185 185
                 break;
    
    186 186
     
    
    ... ... @@ -756,8 +756,8 @@ void wxAuiDefaultDockArt::DrawCaption(wxDC& dc,
    756 756
             dc.SetTextForeground(m_inactiveCaptionTextColour);
    
    757 757
     
    
    758 758
     
    
    759
    -    wxCoord w,h;
    
    760
    -    dc.GetTextExtent(wxT("ABCDEFHXfgkj"), &w, &h);
    
    759
    +    wxCoord h;
    
    760
    +    dc.GetTextExtent(wxT("ABCDEFHXfgkj"), nullptr, &h);
    
    761 761
     
    
    762 762
         wxRect clip_rect = rect;
    
    763 763
         clip_rect.width -= window->FromDIP(3); // text offset
    

  • src/aui/tabart.cpp
    ... ... @@ -1017,7 +1017,7 @@ int wxAuiGenericTabArt::DrawPageTab(
    1017 1017
                                      wxAuiNotebookPage& page,
    
    1018 1018
                                      const wxRect& in_rect)
    
    1019 1019
     {
    
    1020
    -    wxCoord normal_textx, normal_texty;
    
    1020
    +    wxCoord normal_texty;
    
    1021 1021
         wxCoord selected_textx, selected_texty;
    
    1022 1022
         wxCoord texty;
    
    1023 1023
     
    
    ... ... @@ -1030,7 +1030,7 @@ int wxAuiGenericTabArt::DrawPageTab(
    1030 1030
         dc.GetTextExtent(caption, &selected_textx, &selected_texty);
    
    1031 1031
     
    
    1032 1032
         dc.SetFont(m_normalFont);
    
    1033
    -    dc.GetTextExtent(caption, &normal_textx, &normal_texty);
    
    1033
    +    dc.GetTextExtent(caption, nullptr, &normal_texty);
    
    1034 1034
     
    
    1035 1035
         // figure out the size of the tab
    
    1036 1036
         int xExtent = 0;
    
    ... ... @@ -1316,12 +1316,12 @@ wxSize wxAuiGenericTabArt::GetPageTabSize(
    1316 1316
                                           const wxAuiNotebookPage& page,
    
    1317 1317
                                           int* x_extent)
    
    1318 1318
     {
    
    1319
    -    wxCoord measured_textx, measured_texty, tmp;
    
    1319
    +    wxCoord measured_textx, measured_texty;
    
    1320 1320
     
    
    1321 1321
         dc.SetFont(m_measuringFont);
    
    1322
    -    dc.GetTextExtent(page.caption, &measured_textx, &measured_texty);
    
    1322
    +    dc.GetTextExtent(page.caption, &measured_textx, nullptr);
    
    1323 1323
     
    
    1324
    -    dc.GetTextExtent(wxT("ABCDEFXj"), &tmp, &measured_texty);
    
    1324
    +    dc.GetTextExtent(wxT("ABCDEFXj"), nullptr, &measured_texty);
    
    1325 1325
     
    
    1326 1326
         // add padding around the text
    
    1327 1327
         wxCoord tab_width = measured_textx;
    

  • src/aui/tabartgtk.cpp
    ... ... @@ -328,10 +328,10 @@ void wxAuiGtkTabArt::DrawTab(wxDC& dc, wxWindow* wnd, const wxAuiNotebookPage& p
    328 328
             textX += bitmap.GetLogicalWidth() + padding;
    
    329 329
         }
    
    330 330
     
    
    331
    -    wxCoord textW, textH, textY;
    
    331
    +    wxCoord textH, textY;
    
    332 332
     
    
    333 333
         dc.SetFont(m_normalFont);
    
    334
    -    dc.GetTextExtent(page.caption, &textW, &textH);
    
    334
    +    dc.GetTextExtent(page.caption, nullptr, &textH);
    
    335 335
         textY = tab_rect.y + (tab_rect.height - textH) / 2;
    
    336 336
         if(!page.active)
    
    337 337
         {
    

  • src/aui/tabartmsw.cpp
    ... ... @@ -269,11 +269,11 @@ wxSize wxAuiMSWTabArt::GetPageTabSize(wxReadOnlyDC& dc,
    269 269
         if ( !m_closeBtnSize.IsFullySpecified() )
    
    270 270
             InitSizes(wnd, dc);
    
    271 271
     
    
    272
    -    wxCoord textWidth, textHeight, tmp;
    
    272
    +    wxCoord textWidth, textHeight;
    
    273 273
     
    
    274 274
         dc.SetFont(wnd->GetFont());
    
    275
    -    dc.GetTextExtent(page.caption, &textWidth, &tmp);
    
    276
    -    dc.GetTextExtent("ABCDEFXj", &tmp, &textHeight);
    
    275
    +    dc.GetTextExtent(page.caption, &textWidth, nullptr);
    
    276
    +    dc.GetTextExtent("ABCDEFXj", nullptr, &textHeight);
    
    277 277
     
    
    278 278
         wxCoord tabWidth = wxMax(m_tabSize.x, textWidth);
    
    279 279
         wxCoord tabHeight = wxMax(m_tabSize.y, textHeight);
    

  • src/common/graphcmn.cpp
    ... ... @@ -737,9 +737,7 @@ wxGraphicsContext::DoDrawFilledText(const wxString &str,
    737 737
         wxGraphicsPen formerPen = m_pen;
    
    738 738
         wxDouble width;
    
    739 739
         wxDouble height;
    
    740
    -    wxDouble descent;
    
    741
    -    wxDouble externalLeading;
    
    742
    -    GetTextExtent( str , &width, &height, &descent, &externalLeading );
    
    740
    +    GetTextExtent(str, &width, &height);
    
    743 741
         SetBrush( backgroundBrush );
    
    744 742
         // to make sure our 'OffsetToPixelBoundaries' doesn't move the fill shape
    
    745 743
         SetPen( wxNullGraphicsPen );
    
    ... ... @@ -762,9 +760,7 @@ wxGraphicsContext::DoDrawRotatedFilledText(const wxString &str,
    762 760
     
    
    763 761
         wxDouble width;
    
    764 762
         wxDouble height;
    
    765
    -    wxDouble descent;
    
    766
    -    wxDouble externalLeading;
    
    767
    -    GetTextExtent( str , &width, &height, &descent, &externalLeading );
    
    763
    +    GetTextExtent(str, &width, &height);
    
    768 764
         SetBrush( backgroundBrush );
    
    769 765
         // to make sure our 'OffsetToPixelBoundaries' doesn't move the fill shape
    
    770 766
         SetPen( wxNullGraphicsPen );
    

  • src/generic/buttonbar.cpp
    ... ... @@ -146,8 +146,8 @@ bool wxButtonToolBar::Create(wxWindow *parent,
    146 146
         {
    
    147 147
             wxInfoDC dc(this);
    
    148 148
             dc.SetFont(font);
    
    149
    -        int w, h;
    
    150
    -        dc.GetTextExtent(wxT("X"), & w, & h);
    
    149
    +        int h;
    
    150
    +        dc.GetTextExtent(wxT("X"), nullptr, &h);
    
    151 151
             m_labelHeight = h;
    
    152 152
         }
    
    153 153
         return true;
    
    ... ... @@ -409,8 +409,8 @@ void wxButtonToolBar::DoLayout()
    409 409
                         if (!tool->GetShortHelp().empty())
    
    410 410
                         {
    
    411 411
                             wxInfoDC dc(this);
    
    412
    -                        int tw, th;
    
    413
    -                        dc.GetTextExtent(tool->GetShortHelp(), & tw, & th);
    
    412
    +                        int tw;
    
    413
    +                        dc.GetTextExtent(tool->GetShortHelp(), &tw, nullptr);
    
    414 414
     
    
    415 415
                             // If the label is bigger than the icon, the label width
    
    416 416
                             // becomes the new tool width, and we need to centre
    
    ... ... @@ -515,9 +515,6 @@ void wxButtonToolBar::OnPaint(wxPaintEvent& WXUNUSED(event))
    515 515
     
    
    516 516
             if (m_labelHeight > 0 && !tool->GetShortHelp().empty())
    
    517 517
             {
    
    518
    -            int tw, th;
    
    519
    -            dc.GetTextExtent(tool->GetShortHelp(), & tw, & th);
    
    520
    -
    
    521 518
                 int x = tool->m_x;
    
    522 519
                 dc.DrawText(tool->GetShortHelp(), x, tool->m_y + tool->GetButton()->GetSize().y + m_labelMargin);
    
    523 520
             }
    

  • src/generic/filectrlg.cpp
    ... ... @@ -412,20 +412,20 @@ void wxFileListCtrl::ChangeToReportMode()
    412 412
     
    
    413 413
         // do this since WIN32 does mm/dd/yy UNIX does mm/dd/yyyy
    
    414 414
         // don't hardcode since mm/dd is dd/mm elsewhere
    
    415
    -    int w, h;
    
    415
    +    int w;
    
    416 416
         wxDateTime dt(22, wxDateTime::Dec, 2002, 22, 22, 22);
    
    417 417
         wxString txt = dt.FormatDate() + wxT("22") + dt.Format(wxT("%I:%M:%S %p"));
    
    418
    -    GetTextExtent(txt, &w, &h);
    
    418
    +    GetTextExtent(txt, &w, nullptr);
    
    419 419
     
    
    420 420
         InsertColumn( 0, _("Name"), wxLIST_FORMAT_LEFT, w );
    
    421 421
         InsertColumn( 1, _("Size"), wxLIST_FORMAT_RIGHT, w/2 );
    
    422 422
         InsertColumn( 2, _("Type"), wxLIST_FORMAT_LEFT, w/2 );
    
    423 423
         InsertColumn( 3, _("Modified"), wxLIST_FORMAT_LEFT, w );
    
    424 424
     #if defined(__UNIX__)
    
    425
    -    GetTextExtent(wxT("Permissions 2"), &w, &h);
    
    425
    +    GetTextExtent(wxT("Permissions 2"), &w, nullptr);
    
    426 426
         InsertColumn( 4, _("Permissions"), wxLIST_FORMAT_LEFT, w );
    
    427 427
     #elif defined(__WIN32__)
    
    428
    -    GetTextExtent(wxT("Attributes 2"), &w, &h);
    
    428
    +    GetTextExtent(wxT("Attributes 2"), &w, nullptr);
    
    429 429
         InsertColumn( 4, _("Attributes"), wxLIST_FORMAT_LEFT, w );
    
    430 430
     #endif
    
    431 431
     
    

  • src/generic/grideditors.cpp
    ... ... @@ -177,9 +177,8 @@ void wxGridCellEditorEvtHandler::OnChar(wxKeyEvent& event)
    177 177
                 if (!value.empty())
    
    178 178
                 {
    
    179 179
                     // get width of cell CONTENTS (text)
    
    180
    -                int y;
    
    181 180
                     wxFont font = m_grid->GetCellFont(row, col);
    
    182
    -                m_grid->GetTextExtent(value, &textWidth, &y, nullptr, nullptr, &font);
    
    181
    +                m_grid->GetTextExtent(value, &textWidth, nullptr, nullptr, nullptr, &font);
    
    183 182
     
    
    184 183
                     // try to RIGHT align the text by scrolling
    
    185 184
                     int client_right = m_grid->GetGridWindow()->GetClientSize().GetWidth();
    

  • src/generic/odcombo.cpp
    ... ... @@ -740,8 +740,7 @@ void wxVListBoxComboPopup::CalcWidths()
    740 740
                         // have been checked precily.
    
    741 741
                         if ( dirtyHandled < 1024 )
    
    742 742
                         {
    
    743
    -                        wxCoord y;
    
    744
    -                        dc.GetTextExtent(text, &x, &y, nullptr, nullptr);
    
    743
    +                        dc.GetTextExtent(text, &x, nullptr);
    
    745 744
                             x += 4;
    
    746 745
                         }
    
    747 746
                         else
    

  • src/generic/renderg.cpp
    ... ... @@ -508,9 +508,9 @@ int wxRendererGeneric::GetHeaderButtonHeight(wxWindow *win)
    508 508
         const int HEADER_OFFSET_Y = 1;
    
    509 509
         const int EXTRA_HEIGHT = 4;
    
    510 510
     
    
    511
    -    int w=0, h=14, d=0;
    
    511
    +    int h = 14, d = 0;
    
    512 512
         if (win)
    
    513
    -        win->GetTextExtent(wxT("Hg"), &w, &h, &d);
    
    513
    +        win->GetTextExtent(wxT("Hg"), nullptr, &h, &d);
    
    514 514
     
    
    515 515
         return h + d + 2 * HEADER_OFFSET_Y + EXTRA_HEIGHT;
    
    516 516
     }
    

  • src/generic/tabg.cpp
    ... ... @@ -187,8 +187,8 @@ void wxTabControl::OnDraw(wxDC& dc, bool lastInRow)
    187 187
       wxColour col(m_view->GetTextColour());
    
    188 188
       dc.SetTextForeground(col);
    
    189 189
       dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
    
    190
    -  wxCoord textWidth, textHeight;
    
    191
    -  dc.GetTextExtent(GetLabel(), &textWidth, &textHeight);
    
    190
    +  wxCoord textWidth;
    
    191
    +  dc.GetTextExtent(GetLabel(), &textWidth, nullptr);
    
    192 192
     
    
    193 193
       int textX = (int)(tabX + (GetWidth() - textWidth)/2.0);
    
    194 194
       if (textX < (tabX + 2))
    
    ... ... @@ -458,8 +458,8 @@ void wxTabControl::OnDraw(wxDC& dc, bool lastInRow)
    458 458
         wxColour col(m_view->GetTextColour());
    
    459 459
         dc.SetTextForeground(col);
    
    460 460
         dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
    
    461
    -    long textWidth, textHeight;
    
    462
    -    dc.GetTextExtent(GetLabel(), &textWidth, &textHeight);
    
    461
    +    long textWidth;
    
    462
    +    dc.GetTextExtent(GetLabel(), &textWidth, nullptr);
    
    463 463
     
    
    464 464
         float textX = (tabLeft + tabRight - textWidth) / 2;
    
    465 465
         float textY = (tabInc + tabTop + m_view->GetVerticalTabTextSpacing());
    

  • src/osx/listbox_osx.cpp
    ... ... @@ -258,8 +258,8 @@ wxSize wxListBox::DoGetBestSize() const
    258 258
             {
    
    259 259
                 wxString str( GetString( i ) );
    
    260 260
     
    
    261
    -            wxCoord width, height ;
    
    262
    -            dc.GetTextExtent( str , &width, &height);
    
    261
    +            wxCoord width;
    
    262
    +            dc.GetTextExtent(str, &width, nullptr);
    
    263 263
                 lbWidth = wxMax( lbWidth, width );
    
    264 264
             }
    
    265 265
     
    
    ... ... @@ -269,8 +269,8 @@ wxSize wxListBox::DoGetBestSize() const
    269 269
             // And just a bit more
    
    270 270
             int cy = 12;
    
    271 271
     
    
    272
    -        wxCoord width, height ;
    
    273
    -        dc.GetTextExtent( wxT("XX") , &width, &height);
    
    272
    +        wxCoord width;
    
    273
    +        dc.GetTextExtent(wxT("XX"), &width, nullptr);
    
    274 274
             int cx = width ;
    
    275 275
             lbWidth += cx;
    
    276 276
     
    

  • src/propgrid/property.cpp
    ... ... @@ -3021,8 +3021,8 @@ wxString wxPropertyCategory::GetValueAsString(wxPGPropValFormatFlags flags) cons
    3021 3021
     
    
    3022 3022
     static int DoGetTextExtent(const wxWindow* wnd, const wxString& label, const wxFont& font)
    
    3023 3023
     {
    
    3024
    -    int x = 0, y = 0;
    
    3025
    -    wnd->GetTextExtent(label, &x, &y, nullptr, nullptr, &font);
    
    3024
    +    int x;
    
    3025
    +    wnd->GetTextExtent(label, &x, nullptr, nullptr, nullptr, &font);
    
    3026 3026
         return x;
    
    3027 3027
     }
    
    3028 3028
     
    

  • src/propgrid/propgridpagestate.cpp
    ... ... @@ -690,7 +690,7 @@ int wxPropertyGridPageState::GetColumnFitWidth(const wxDC& dc,
    690 690
     {
    
    691 691
         wxPropertyGrid* pg = m_pPropGrid;
    
    692 692
         int maxW = 0;
    
    693
    -    int w, h;
    
    693
    +    int w;
    
    694 694
     
    
    695 695
         for ( unsigned int i = 0; i <pwc->GetChildCount(); i++ )
    
    696 696
         {
    
    ... ... @@ -699,7 +699,7 @@ int wxPropertyGridPageState::GetColumnFitWidth(const wxDC& dc,
    699 699
             {
    
    700 700
                 wxString text;
    
    701 701
                 p->GetDisplayInfo(col, -1, 0, &text, (wxPGCell*)nullptr);
    
    702
    -            dc.GetTextExtent(text, &w, &h);
    
    702
    +            dc.GetTextExtent(text, &w, nullptr);
    
    703 703
                 if ( col == 0 )
    
    704 704
                     w += ( (p->GetDepth()-1) * pg->m_subgroup_extramargin );
    
    705 705
     
    
    ... ... @@ -741,8 +741,7 @@ int wxPropertyGridPageState::GetColumnFitWidth(const wxPGProperty* p, unsigned i
    741 741
             {
    
    742 742
                 wxString text;
    
    743 743
                 pc->GetDisplayInfo(col, -1, 0, &text, (wxPGCell*)nullptr);
    
    744
    -            int h;
    
    745
    -            pg->GetTextExtent(text, &w, &h);
    
    744
    +            pg->GetTextExtent(text, &w, nullptr);
    
    746 745
                 if ( col == 0 )
    
    747 746
                     w += ((pc->GetDepth() - 1) * pg->m_subgroup_extramargin);
    
    748 747
     
    

  • src/richtext/richtextbuffer.cpp
    No preview for this file type
  • src/richtext/richtextprint.cpp
    ... ... @@ -227,8 +227,8 @@ void wxRichTextPrintout::RenderPage(wxDC *dc, int page)
    227 227
             {
    
    228 228
                 SubstituteKeywords(headerTextCentre, GetTitle(), page, m_numPages);
    
    229 229
     
    
    230
    -            int tx, ty;
    
    231
    -            dc->GetTextExtent(headerTextCentre, & tx, & ty);
    
    230
    +            int tx;
    
    231
    +            dc->GetTextExtent(headerTextCentre, &tx, nullptr);
    
    232 232
     
    
    233 233
                 int x = headerRect.GetWidth()/2 - tx/2 + headerRect.GetLeft();
    
    234 234
                 int y = headerRect.GetY();
    
    ... ... @@ -238,8 +238,8 @@ void wxRichTextPrintout::RenderPage(wxDC *dc, int page)
    238 238
             {
    
    239 239
                 SubstituteKeywords(headerTextRight, GetTitle(), page, m_numPages);
    
    240 240
     
    
    241
    -            int tx, ty;
    
    242
    -            dc->GetTextExtent(headerTextRight, & tx, & ty);
    
    241
    +            int tx;
    
    242
    +            dc->GetTextExtent(headerTextRight, &tx, nullptr);
    
    243 243
     
    
    244 244
                 int x = headerRect.GetRight() - tx;
    
    245 245
                 int y = headerRect.GetY();
    
    ... ... @@ -255,8 +255,8 @@ void wxRichTextPrintout::RenderPage(wxDC *dc, int page)
    255 255
             {
    
    256 256
                 SubstituteKeywords(footerTextLeft, GetTitle(), page, m_numPages);
    
    257 257
     
    
    258
    -            int tx, ty;
    
    259
    -            dc->GetTextExtent(footerTextLeft, & tx, & ty);
    
    258
    +            int ty;
    
    259
    +            dc->GetTextExtent(footerTextLeft, nullptr, &ty);
    
    260 260
     
    
    261 261
                 int x = footerRect.GetLeft();
    
    262 262
                 int y = footerRect.GetBottom() - ty;
    

  • src/stc/PlatWX.cpp
    ... ... @@ -745,9 +745,8 @@ void SurfaceImpl::MeasureWidths(Font &font, const char *s, int len, XYPOSITION *
    745 745
     XYPOSITION SurfaceImpl::WidthText(Font &font, const char *s, int len) {
    
    746 746
         SetFont(font);
    
    747 747
         int w;
    
    748
    -    int h;
    
    749 748
     
    
    750
    -    hdc->GetTextExtent(STCString(s, len), &w, &h);
    
    749
    +    hdc->GetTextExtent(STCString(s, len), &w, nullptr);
    
    751 750
         return w;
    
    752 751
     }
    
    753 752
     
    
    ... ... @@ -755,8 +754,8 @@ XYPOSITION SurfaceImpl::WidthText(Font &font, const char *s, int len) {
    755 754
     
    
    756 755
     XYPOSITION SurfaceImpl::Ascent(Font &font) {
    
    757 756
         SetFont(font);
    
    758
    -    int w, h, d, e;
    
    759
    -    hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e);
    
    757
    +    int h, d;
    
    758
    +    hdc->GetTextExtent(EXTENT_TEST, nullptr, &h, &d);
    
    760 759
         const int ascent = h - d;
    
    761 760
         SetAscent(font, ascent);
    
    762 761
         return ascent;
    
    ... ... @@ -764,8 +763,8 @@ XYPOSITION SurfaceImpl::Ascent(Font &font) {
    764 763
     
    
    765 764
     XYPOSITION SurfaceImpl::Descent(Font &font) {
    
    766 765
         SetFont(font);
    
    767
    -    int w, h, d, e;
    
    768
    -    hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e);
    
    766
    +    int d;
    
    767
    +    hdc->GetTextExtent(EXTENT_TEST, nullptr, nullptr, &d);
    
    769 768
         return d;
    
    770 769
     }
    
    771 770
     
    
    ... ... @@ -2838,8 +2837,7 @@ void wxSTCListBox::SetContainerBorderSize(int s)
    2838 2837
     void wxSTCListBox::SetListBoxFont(Font &font)
    
    2839 2838
     {
    
    2840 2839
         SetFont(*((wxFont*)font.GetID()));
    
    2841
    -    int w;
    
    2842
    -    GetTextExtent(EXTENT_TEST, &w, &m_textHeight);
    
    2840
    +    GetTextExtent(EXTENT_TEST, nullptr, &m_textHeight);
    
    2843 2841
         RecalculateItemHeight();
    
    2844 2842
     }
    
    2845 2843
     
    
    ... ... @@ -3000,8 +2998,7 @@ void wxSTCListBox::OnDPIChanged(wxDPIChangedEvent& event)
    3000 2998
         m_textBoxToTextGap = FromDIP(3);
    
    3001 2999
         m_textExtraVerticalPadding = FromDIP(1);
    
    3002 3000
     
    
    3003
    -    int w;
    
    3004
    -    GetTextExtent(EXTENT_TEST, &w, &m_textHeight);
    
    3001
    +    GetTextExtent(EXTENT_TEST, nullptr, &m_textHeight);
    
    3005 3002
     
    
    3006 3003
         RecalculateItemHeight();
    
    3007 3004
     
    


View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help Notification message regarding https://gitlab.com/wxwidgets/wxwidgets/-/commit/40614f71260008d07a9bf8f546c060a3b3bab3aa at 1778289647

Reply all
Reply to author
Forward
0 new messages