From: Vadim Zeitlin Date: Wed, 20 Jun 2012 17:54:42 +0000 (+0000) Subject: Add missing c_str() and similar calls to samples in STL build. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7e3ea54f47679cb9ecd0f635b7abf32c87c40c09?hp=9597d39a2e3105f36db089936fc39375a83c1520 Add missing c_str() and similar calls to samples in STL build. Don't rely on implicit conversion of wxString to char*/wxChar*, it doesn't exist in STL build. Add explicit c_str(), wc_str() or t_str() calls. Closes #14420. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71820 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/regtest/regtest.cpp b/samples/regtest/regtest.cpp index a1147cad06..a12d6f28b7 100644 --- a/samples/regtest/regtest.cpp +++ b/samples/regtest/regtest.cpp @@ -1193,7 +1193,7 @@ const wxChar *RegTreeCtrl::TreeNode::FullName() const s_strName = Parent()->FullName(); s_strName << wxT('\\') << m_strName; - return s_strName; + return s_strName.t_str(); } } diff --git a/samples/uiaction/uiaction.cpp b/samples/uiaction/uiaction.cpp index 3e0a7fd7b5..6fd518e299 100644 --- a/samples/uiaction/uiaction.cpp +++ b/samples/uiaction/uiaction.cpp @@ -213,7 +213,7 @@ void MyFrame::OnSimulateText(wxCommandEvent& WXUNUSED(event)) wxUIActionSimulator sim; m_text->SetFocus(); - sim.Text(s_text); + sim.Text(s_text.c_str()); } void MyFrame::OnButtonPressed(wxCommandEvent& WXUNUSED(event)) diff --git a/tests/benchmarks/htmlparser/htmlpars.cpp b/tests/benchmarks/htmlparser/htmlpars.cpp index 3bc1dea94a..7cb3b22362 100644 --- a/tests/benchmarks/htmlparser/htmlpars.cpp +++ b/tests/benchmarks/htmlparser/htmlpars.cpp @@ -295,7 +295,7 @@ void wx28HtmlParser::DoParsing(int begin_pos, int end_pos) // Add text: AddText(GetEntitiesParser()->Parse( m_Source.Mid(pieces[m_CurTextPiece].m_pos, - pieces[m_CurTextPiece].m_lng))); + pieces[m_CurTextPiece].m_lng)).t_str()); begin_pos = pieces[m_CurTextPiece].m_pos + pieces[m_CurTextPiece].m_lng; m_CurTextPiece++; diff --git a/tests/benchmarks/strings.cpp b/tests/benchmarks/strings.cpp index b1ee26936d..6ea1f53e86 100644 --- a/tests/benchmarks/strings.cpp +++ b/tests/benchmarks/strings.cpp @@ -315,28 +315,28 @@ BENCHMARK_FUNC(StrcmpA) { const wxString& s = GetTestAsciiString(); - return wxCRT_StrcmpA(s, s) == 0; + return wxCRT_StrcmpA(s.c_str(), s.c_str()) == 0; } BENCHMARK_FUNC(StrcmpW) { const wxString& s = GetTestAsciiString(); - return wxCRT_StrcmpW(s, s) == 0; + return wxCRT_StrcmpW(s.wc_str(), s.wc_str()) == 0; } BENCHMARK_FUNC(StricmpA) { const wxString& s = GetTestAsciiString(); - return wxCRT_StricmpA(s, s) == 0; + return wxCRT_StricmpA(s.c_str(), s.c_str()) == 0; } BENCHMARK_FUNC(StricmpW) { const wxString& s = GetTestAsciiString(); - return wxCRT_StricmpW(s, s) == 0; + return wxCRT_StricmpW(s.wc_str(), s.wc_str()) == 0; } BENCHMARK_FUNC(StringCmp)