Use clear() instead of assignment to wxEmptyString

This commit is contained in:
Paul Cornett
2018-08-22 09:45:20 -07:00
parent f4bcb12709
commit 86ab6de0c1
7 changed files with 21 additions and 15 deletions

View File

@@ -480,7 +480,7 @@ bool DXFRenderer::ParseEntities(wxInputStream& stream)
else else
p->colour = GetLayerColour(layer); p->colour = GetLayerColour(layer);
m_entities.Append(p); m_entities.Append(p);
colour = -1; layer = wxEmptyString; colour = -1; layer.clear();
v[0] = v[1] = v[2] = v[3] = DXFVector(); v[0] = v[1] = v[2] = v[3] = DXFVector();
state = 0; state = 0;
} }
@@ -494,7 +494,7 @@ bool DXFRenderer::ParseEntities(wxInputStream& stream)
else else
p->colour = GetLayerColour(layer); p->colour = GetLayerColour(layer);
m_entities.Append(p); m_entities.Append(p);
colour = -1; layer = wxEmptyString; colour = -1; layer.clear();
v[0] = v[1] = v[2] = v[3] = DXFVector(); v[0] = v[1] = v[2] = v[3] = DXFVector();
state = 0; state = 0;
} }

View File

@@ -987,19 +987,19 @@ void MyApp::DoByteOrderDemo(wxCommandEvent& WXUNUSED(event))
wxString text; wxString text;
wxInt32 var = 0xF1F2F3F4; wxInt32 var = 0xF1F2F3F4;
text = wxEmptyString; text.clear();
text.Printf( wxT("Value of wxInt32 is now: %#x.\n\n"), var ); text.Printf( wxT("Value of wxInt32 is now: %#x.\n\n"), var );
textCtrl.WriteText( text ); textCtrl.WriteText( text );
text = wxEmptyString; text.clear();
text.Printf( wxT("Value of swapped wxInt32 is: %#x.\n\n"), wxINT32_SWAP_ALWAYS( var ) ); text.Printf( wxT("Value of swapped wxInt32 is: %#x.\n\n"), wxINT32_SWAP_ALWAYS( var ) );
textCtrl.WriteText( text ); textCtrl.WriteText( text );
text = wxEmptyString; text.clear();
text.Printf( wxT("Value of wxInt32 swapped on little endian is: %#x.\n\n"), wxINT32_SWAP_ON_LE( var ) ); text.Printf( wxT("Value of wxInt32 swapped on little endian is: %#x.\n\n"), wxINT32_SWAP_ON_LE( var ) );
textCtrl.WriteText( text ); textCtrl.WriteText( text );
text = wxEmptyString; text.clear();
text.Printf( wxT("Value of wxInt32 swapped on big endian is: %#x.\n\n"), wxINT32_SWAP_ON_BE( var ) ); text.Printf( wxT("Value of wxInt32 swapped on big endian is: %#x.\n\n"), wxINT32_SWAP_ON_BE( var ) );
textCtrl.WriteText( text ); textCtrl.WriteText( text );
} }

View File

@@ -569,7 +569,7 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
wxStringTokenizer tok2( tmp, wxT(" ") ); wxStringTokenizer tok2( tmp, wxT(" ") );
tmp = tok2.GetNextToken(); // "printer" tmp = tok2.GetNextToken(); // "printer"
tmp = tok2.GetNextToken(); // "hp_deskjet930c" tmp = tok2.GetNextToken(); // "hp_deskjet930c"
tmp = wxEmptyString; tmp.clear();
while (tok2.HasMoreTokens()) while (tok2.HasMoreTokens())
{ {
tmp += tok2.GetNextToken(); tmp += tok2.GetNextToken();

View File

@@ -58,7 +58,7 @@ void wxHtmlHelpController::Init(int style)
m_helpDialog = NULL; m_helpDialog = NULL;
#if wxUSE_CONFIG #if wxUSE_CONFIG
m_Config = NULL; m_Config = NULL;
m_ConfigRoot = wxEmptyString; m_ConfigRoot.clear();
#endif // wxUSE_CONFIG #endif // wxUSE_CONFIG
m_titleFormat = _("Help: %s"); m_titleFormat = _("Help: %s");
m_FrameStyle = style; m_FrameStyle = style;

View File

@@ -185,7 +185,8 @@ bool HP_TagHandler::HandleTag(const wxHtmlTag& tag)
} }
else if (tag.GetName() == wxT("OBJECT")) else if (tag.GetName() == wxT("OBJECT"))
{ {
m_name = m_page = wxEmptyString; m_name.clear();
m_page.clear();
ParseInner(tag); ParseInner(tag);
#if 0 #if 0
@@ -845,7 +846,7 @@ bool wxHtmlSearchStatus::Search()
return false; return false;
} }
m_Name = wxEmptyString; m_Name.clear();
m_CurItem = NULL; m_CurItem = NULL;
thepage = m_Data->m_contents[i].page; thepage = m_Data->m_contents[i].page;

View File

@@ -268,7 +268,7 @@ void wxHtmlHelpWindow::Init(wxHtmlHelpData* data)
#if wxUSE_CONFIG #if wxUSE_CONFIG
m_Config = NULL; m_Config = NULL;
m_ConfigRoot = wxEmptyString; m_ConfigRoot.clear();
#endif // wxUSE_CONFIG #endif // wxUSE_CONFIG
m_Cfg.x = m_Cfg.y = wxDefaultCoord; m_Cfg.x = m_Cfg.y = wxDefaultCoord;
@@ -278,7 +278,8 @@ void wxHtmlHelpWindow::Init(wxHtmlHelpData* data)
m_Cfg.navig_on = true; m_Cfg.navig_on = true;
m_NormalFonts = m_FixedFonts = NULL; m_NormalFonts = m_FixedFonts = NULL;
m_NormalFace = m_FixedFace = wxEmptyString; m_NormalFace.clear();
m_FixedFace.clear();
#ifdef __WXMSW__ #ifdef __WXMSW__
m_FontSize = 10; m_FontSize = 10;
#else #else

View File

@@ -310,7 +310,9 @@ void wxHtmlWindow::Init()
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR
m_RelatedFrame = NULL; m_RelatedFrame = NULL;
m_TitleFormat = wxT("%s"); m_TitleFormat = wxT("%s");
m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString; m_OpenedPage.clear();
m_OpenedAnchor.clear();
m_OpenedPageTitle.clear();
m_Cell = NULL; m_Cell = NULL;
m_Parser = new wxHtmlWinParser(this); m_Parser = new wxHtmlWinParser(this);
m_Parser->SetFS(m_FS); m_Parser->SetFS(m_FS);
@@ -433,7 +435,9 @@ void wxHtmlWindow::SetStandardFonts(int size,
bool wxHtmlWindow::SetPage(const wxString& source) bool wxHtmlWindow::SetPage(const wxString& source)
{ {
m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString; m_OpenedPage.clear();
m_OpenedAnchor.clear();
m_OpenedPageTitle.clear();
return DoSetPage(source); return DoSetPage(source);
} }
@@ -853,7 +857,7 @@ bool wxHtmlWindow::HistoryForward()
if (m_HistoryPos == -1) return false; if (m_HistoryPos == -1) return false;
if (m_HistoryPos >= (int)m_History->GetCount() - 1)return false; if (m_HistoryPos >= (int)m_History->GetCount() - 1)return false;
m_OpenedPage = wxEmptyString; // this will disable adding new entry into history in LoadPage() m_OpenedPage.clear(); // this will disable adding new entry into history in LoadPage()
m_HistoryPos++; m_HistoryPos++;
l = (*m_History)[m_HistoryPos].GetPage(); l = (*m_History)[m_HistoryPos].GetPage();