From 4c0e272589667c7cf57407d99f1810e2e83348e4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 6 Jul 2016 18:51:10 +0200 Subject: [PATCH] Don't pass parameters to wxSizerXmlHandler::GetGB{Pos,Span}() This doesn't make sense, these functions can only be ever used with a single parameter ("cellpos" for the former and "cellspan" for the latter), so just hard-code it inside the functions themselves. No real changes, just make the code less confusing. --- include/wx/xrc/xh_sizer.h | 4 ++-- src/xrc/xh_sizer.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/wx/xrc/xh_sizer.h b/include/wx/xrc/xh_sizer.h index 648b22f57c..594106ac87 100644 --- a/include/wx/xrc/xh_sizer.h +++ b/include/wx/xrc/xh_sizer.h @@ -52,8 +52,8 @@ private: bool ValidateGridSizerChildren(); void SetFlexibleMode(wxFlexGridSizer* fsizer); void SetGrowables(wxFlexGridSizer* fsizer, const wxChar* param, bool rows); - wxGBPosition GetGBPos(const wxString& param); - wxGBSpan GetGBSpan(const wxString& param); + wxGBPosition GetGBPos(); + wxGBSpan GetGBSpan(); wxSizerItem* MakeSizerItem(); void SetSizerItemAttributes(wxSizerItem* sitem); void AddSizerItem(wxSizerItem* sitem); diff --git a/src/xrc/xh_sizer.cpp b/src/xrc/xh_sizer.cpp index 4c38078acc..8a91eb91e9 100644 --- a/src/xrc/xh_sizer.cpp +++ b/src/xrc/xh_sizer.cpp @@ -512,17 +512,17 @@ void wxSizerXmlHandler::SetGrowables(wxFlexGridSizer* sizer, } -wxGBPosition wxSizerXmlHandler::GetGBPos(const wxString& param) +wxGBPosition wxSizerXmlHandler::GetGBPos() { - wxSize sz = GetPairInts(param); + wxSize sz = GetPairInts(wxS("cellpos")); if (sz.x < 0) sz.x = 0; if (sz.y < 0) sz.y = 0; return wxGBPosition(sz.x, sz.y); } -wxGBSpan wxSizerXmlHandler::GetGBSpan(const wxString& param) +wxGBSpan wxSizerXmlHandler::GetGBSpan() { - wxSize sz = GetPairInts(param); + wxSize sz = GetPairInts(wxS("cellspan")); if (sz.x < 1) sz.x = 1; if (sz.y < 1) sz.y = 1; return wxGBSpan(sz.x, sz.y); @@ -863,8 +863,8 @@ void wxSizerXmlHandler::SetSizerItemAttributes(wxSizerItem* sitem) if (m_isGBS) { wxGBSizerItem* gbsitem = (wxGBSizerItem*)sitem; - gbsitem->SetPos(GetGBPos(wxT("cellpos"))); - gbsitem->SetSpan(GetGBSpan(wxT("cellspan"))); + gbsitem->SetPos(GetGBPos()); + gbsitem->SetSpan(GetGBSpan()); } // record the id of the item, if any, for use by XRCSIZERITEM()