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
wxAuiDockUIPart* part = HitTest(event.GetX(), event.GetY());
wxCursor cursor = wxNullCursor;
wxCursor cursor;
if (part)
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -77,7 +77,7 @@ void wxRibbonBar::AddPage(wxRibbonPage *page)
wxString label;
if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS)
label = page->GetLabel();
wxBitmap icon = wxNullBitmap;
wxBitmap icon;
if(m_flags & wxRIBBON_BAR_SHOW_PAGE_ICONS)
icon = page->GetIcon();
m_art->GetBarTabWidth(dcTemp, this, label, icon,
@@ -177,7 +177,7 @@ bool wxRibbonBar::Realize()
wxString label;
if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS)
label = info.page->GetLabel();
wxBitmap icon = wxNullBitmap;
wxBitmap icon;
if(m_flags & wxRIBBON_BAR_SHOW_PAGE_ICONS)
icon = info.page->GetIcon();
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);
delete[] data;
}
else
strData = wxEmptyString;
}
}