Remove useless initializations

wxObject-derived types and wxString are null/empty by default.
This commit is contained in:
Paul Cornett
2018-08-22 09:19:15 -07:00
parent 41d534ac0d
commit f4bcb12709
10 changed files with 7 additions and 20 deletions

View File

@@ -3998,7 +3998,7 @@ void wxAuiManager::OnSetCursor(wxSetCursorEvent& event)
{ {
// determine cursor // determine cursor
wxAuiDockUIPart* part = HitTest(event.GetX(), event.GetY()); wxAuiDockUIPart* part = HitTest(event.GetX(), event.GetY());
wxCursor cursor = wxNullCursor; wxCursor cursor;
if (part) if (part)
{ {

View File

@@ -86,7 +86,6 @@ wxIMPLEMENT_CLASS(wxPostScriptPrintNativeData, wxPrintNativeDataBase);
wxPostScriptPrintNativeData::wxPostScriptPrintNativeData() wxPostScriptPrintNativeData::wxPostScriptPrintNativeData()
{ {
m_previewCommand = wxEmptyString;
#ifdef __VMS__ #ifdef __VMS__
m_printerCommand = wxT("print"); m_printerCommand = wxT("print");
m_printerOptions = wxT("/nonotify/queue=psqueue"); m_printerOptions = wxT("/nonotify/queue=psqueue");
@@ -95,14 +94,11 @@ wxPostScriptPrintNativeData::wxPostScriptPrintNativeData()
#ifdef __WXMSW__ #ifdef __WXMSW__
m_printerCommand = wxT("print"); m_printerCommand = wxT("print");
m_printerOptions = wxEmptyString;
m_afmPath = wxT("c:\\windows\\system\\"); m_afmPath = wxT("c:\\windows\\system\\");
#endif #endif
#if !defined(__VMS__) && !defined(__WXMSW__) #if !defined(__VMS__) && !defined(__WXMSW__)
m_printerCommand = wxT("lpr"); m_printerCommand = wxT("lpr");
m_printerOptions = wxEmptyString;
m_afmPath = wxEmptyString;
#endif #endif
m_printerScaleX = 1.0; m_printerScaleX = 1.0;

View File

@@ -3516,7 +3516,6 @@ void wxGenericTreeCtrl::OnRenameCancelled(wxGenericTreeItem *item)
{ {
// let owner know that the edit was cancelled // let owner know that the edit was cancelled
wxTreeEvent le(wxEVT_TREE_END_LABEL_EDIT, this, item); wxTreeEvent le(wxEVT_TREE_END_LABEL_EDIT, this, item);
le.m_label = wxEmptyString;
le.m_editCancelled = true; le.m_editCancelled = true;
GetEventHandler()->ProcessEvent( le ); GetEventHandler()->ProcessEvent( le );

View File

@@ -782,8 +782,6 @@ private:
wxChmFSHandler::wxChmFSHandler() : wxFileSystemHandler() wxChmFSHandler::wxChmFSHandler() : wxFileSystemHandler()
{ {
m_lasterror=0; m_lasterror=0;
m_pattern=wxEmptyString;
m_found=wxEmptyString;
m_chm=NULL; m_chm=NULL;
} }

View File

@@ -151,7 +151,6 @@ class HP_TagHandler : public wxHtmlTagHandler
{ {
m_data = NULL; m_data = NULL;
m_book = b; m_book = b;
m_name = m_page = wxEmptyString;
m_level = 0; m_level = 0;
m_id = wxID_ANY; m_id = wxID_ANY;
m_count = 0; m_count = 0;
@@ -656,10 +655,10 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
wxString title = _("noname"), wxString title = _("noname"),
safetitle, safetitle,
start = wxEmptyString, start,
contents = wxEmptyString, contents,
index = wxEmptyString, index,
charset = wxEmptyString; charset;
fi = fsys.OpenFile(book); fi = fsys.OpenFile(book);
if (fi == NULL) if (fi == NULL)

View File

@@ -638,7 +638,6 @@ wxHtmlContainerCell::wxHtmlContainerCell(wxHtmlContainerCell *parent) : wxHtmlCe
m_AlignVer = wxHTML_ALIGN_BOTTOM; m_AlignVer = wxHTML_ALIGN_BOTTOM;
m_IndentLeft = m_IndentRight = m_IndentTop = m_IndentBottom = 0; m_IndentLeft = m_IndentRight = m_IndentTop = m_IndentBottom = 0;
m_WidthFloat = 100; m_WidthFloatUnits = wxHTML_UNITS_PERCENT; m_WidthFloat = 100; m_WidthFloatUnits = wxHTML_UNITS_PERCENT;
m_BkColour = wxNullColour;
m_Border = 0; m_Border = 0;
m_MinHeight = 0; m_MinHeight = 0;
m_MinHeightAlign = wxHTML_ALIGN_TOP; m_MinHeightAlign = wxHTML_ALIGN_TOP;

View File

@@ -612,7 +612,6 @@ wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxWindow *parentWin
m_Name = name; m_Name = name;
m_PrintData = NULL; m_PrintData = NULL;
m_PageSetupData = new wxPageSetupDialogData; m_PageSetupData = new wxPageSetupDialogData;
m_Headers[0] = m_Headers[1] = m_Footers[0] = m_Footers[1] = wxEmptyString;
m_PageSetupData->EnableMargins(true); m_PageSetupData->EnableMargins(true);
m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25)); m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25));

View File

@@ -65,7 +65,6 @@ wxHtmlWinParser::wxHtmlWinParser(wxHtmlWindowInterface *wndIface)
for (m = 0; m < 7; m++) for (m = 0; m < 7; m++)
{ {
m_FontsTable[i][j][k][l][m] = NULL; m_FontsTable[i][j][k][l][m] = NULL;
m_FontsFacesTable[i][j][k][l][m] = wxEmptyString;
#if !wxUSE_UNICODE #if !wxUSE_UNICODE
m_FontsEncTable[i][j][k][l][m] = wxFONTENCODING_DEFAULT; m_FontsEncTable[i][j][k][l][m] = wxFONTENCODING_DEFAULT;
#endif #endif

View File

@@ -77,7 +77,7 @@ void wxRibbonBar::AddPage(wxRibbonPage *page)
wxString label; wxString label;
if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS) if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS)
label = page->GetLabel(); label = page->GetLabel();
wxBitmap icon = wxNullBitmap; wxBitmap icon;
if(m_flags & wxRIBBON_BAR_SHOW_PAGE_ICONS) if(m_flags & wxRIBBON_BAR_SHOW_PAGE_ICONS)
icon = page->GetIcon(); icon = page->GetIcon();
m_art->GetBarTabWidth(dcTemp, this, label, icon, m_art->GetBarTabWidth(dcTemp, this, label, icon,
@@ -177,7 +177,7 @@ bool wxRibbonBar::Realize()
wxString label; wxString label;
if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS) if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS)
label = info.page->GetLabel(); label = info.page->GetLabel();
wxBitmap icon = wxNullBitmap; wxBitmap icon;
if(m_flags & wxRIBBON_BAR_SHOW_PAGE_ICONS) if(m_flags & wxRIBBON_BAR_SHOW_PAGE_ICONS)
icon = info.page->GetIcon(); icon = info.page->GetIcon();
m_art->GetBarTabWidth(dcTemp, this, label, icon, m_art->GetBarTabWidth(dcTemp, this, label, icon,

View File

@@ -839,8 +839,6 @@ bool wxRichTextImage::ExportXML(wxXmlNode* parent, wxRichTextXMLHandler* handler
strData = wxString((const char*) data, wxConvUTF8, size); strData = wxString((const char*) data, wxConvUTF8, size);
delete[] data; delete[] data;
} }
else
strData = wxEmptyString;
} }
} }