Use wxString::clear() instead of assignment to wxEmptyString
This commit is contained in:
parent
7d039a2e0b
commit
98cd5a6b20
@ -6412,7 +6412,7 @@ wxAccStatus wxDataViewCtrlAccessible::GetHelpText(int childId, wxString* helpTex
|
||||
}
|
||||
else
|
||||
{
|
||||
*helpText = wxEmptyString;
|
||||
helpText->clear();
|
||||
}
|
||||
}
|
||||
return wxACC_OK;
|
||||
|
@ -465,7 +465,7 @@ void wxGenericDirCtrl::Init()
|
||||
{
|
||||
m_showHidden = false;
|
||||
m_currentFilter = 0;
|
||||
m_currentFilterStr = wxEmptyString; // Default: any file
|
||||
m_currentFilterStr.clear(); // Default: any file
|
||||
m_treeCtrl = NULL;
|
||||
m_filterListCtrl = NULL;
|
||||
}
|
||||
|
@ -674,7 +674,7 @@ void wxFileListCtrl::GoToParentDir()
|
||||
if (!m_dirName.empty())
|
||||
{
|
||||
if (m_dirName.Last() == wxT('.'))
|
||||
m_dirName = wxEmptyString;
|
||||
m_dirName.clear();
|
||||
}
|
||||
#elif defined(__UNIX__)
|
||||
if (m_dirName.empty())
|
||||
@ -927,7 +927,7 @@ bool wxGenericFileCtrl::Create( wxWindow *parent,
|
||||
if ( ( len > 1 ) && ( wxEndsWithPathSeparator( m_dir ) ) )
|
||||
m_dir.Remove( len - 1, 1 );
|
||||
|
||||
m_filterExtension = wxEmptyString;
|
||||
m_filterExtension.clear();
|
||||
|
||||
// layout
|
||||
|
||||
|
@ -187,7 +187,7 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
|
||||
if ((len > 1) && (wxEndsWithPathSeparator(m_dir)))
|
||||
m_dir.Remove( len-1, 1 );
|
||||
|
||||
m_filterExtension = wxEmptyString;
|
||||
m_filterExtension.clear();
|
||||
|
||||
// layout
|
||||
|
||||
|
@ -1311,7 +1311,7 @@ void wxGridStringTable::Clear()
|
||||
{
|
||||
for ( col = 0; col < numCols; col++ )
|
||||
{
|
||||
m_data[row][col] = wxEmptyString;
|
||||
m_data[row][col].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ bool wxExtHelpController::KeywordSearch(const wxString& k,
|
||||
// choices[idx] = (**i).doc.Contains((**i).doc.Before(WXEXTHELP_COMMENTCHAR));
|
||||
//if (choices[idx].empty()) // didn't contain the ';'
|
||||
// choices[idx] = (**i).doc;
|
||||
choices[idx] = wxEmptyString;
|
||||
choices[idx].clear();
|
||||
for (int j=0; ; j++)
|
||||
{
|
||||
wxChar targetChar = entry->doc.c_str()[j];
|
||||
|
@ -68,7 +68,7 @@ void wxVListBoxComboPopup::Init()
|
||||
m_value = -1;
|
||||
m_itemHover = -1;
|
||||
m_clientDataItemsType = wxClientData_None;
|
||||
m_partialCompletionString = wxEmptyString;
|
||||
m_partialCompletionString.clear();
|
||||
}
|
||||
|
||||
bool wxVListBoxComboPopup::Create(wxWindow* parent)
|
||||
@ -224,7 +224,7 @@ void wxVListBoxComboPopup::DismissWithEvent()
|
||||
if ( selection != wxNOT_FOUND )
|
||||
m_stringValue = m_strings[selection];
|
||||
else
|
||||
m_stringValue = wxEmptyString;
|
||||
m_stringValue.clear();
|
||||
|
||||
if ( m_stringValue != m_combo->GetValue() )
|
||||
m_combo->SetValueByUser(m_stringValue);
|
||||
@ -388,7 +388,7 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar keychar
|
||||
// stop partial completion
|
||||
void wxVListBoxComboPopup::StopPartialCompletion()
|
||||
{
|
||||
m_partialCompletionString = wxEmptyString;
|
||||
m_partialCompletionString.clear();
|
||||
#if wxUSE_TIMER
|
||||
m_partialCompletionTimer.Stop();
|
||||
#endif // wxUSE_TIMER
|
||||
@ -685,7 +685,7 @@ void wxVListBoxComboPopup::SetSelection( int item )
|
||||
if ( item >= 0 )
|
||||
m_stringValue = m_strings[item];
|
||||
else
|
||||
m_stringValue = wxEmptyString;
|
||||
m_stringValue.clear();
|
||||
|
||||
if ( IsCreated() )
|
||||
wxVListBox::SetSelection(item);
|
||||
|
@ -714,7 +714,8 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH")
|
||||
{
|
||||
m_Table = NULL;
|
||||
m_enclosingContainer = NULL;
|
||||
m_tAlign = m_rAlign = wxEmptyString;
|
||||
m_tAlign.clear();
|
||||
m_rAlign.clear();
|
||||
}
|
||||
|
||||
|
||||
|
@ -587,7 +587,7 @@ void wxFontDialog::ChangeFont()
|
||||
|
||||
wxFontFamily family = FontFamilyStringToInt(facename);
|
||||
if (family != wxFONTFAMILY_DEFAULT)
|
||||
facename = wxEmptyString;
|
||||
facename.clear();
|
||||
|
||||
m_dialogFont = wxFontInfo(size)
|
||||
.Family(family).FaceName(facename)
|
||||
|
@ -3453,7 +3453,7 @@ void wxDataViewColumn::SetBitmap(const wxBitmap& bitmap)
|
||||
{
|
||||
// bitmaps and titles cannot exist at the same time - if the bitmap is set
|
||||
// the title is removed:
|
||||
m_title = wxEmptyString;
|
||||
m_title.clear();
|
||||
wxDataViewColumnBase::SetBitmap(bitmap);
|
||||
[[m_NativeDataPtr->GetNativeColumnPtr() headerCell] setImage:bitmap.GetNSImage()];
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ int wxDirDialog::ShowModal()
|
||||
|
||||
wxCFStringRef dir( m_path );
|
||||
|
||||
m_path = wxEmptyString;
|
||||
m_path.clear();
|
||||
|
||||
int returnCode = -1;
|
||||
|
||||
|
@ -494,7 +494,7 @@ int wxFileDialog::ShowModal()
|
||||
wxCFStringRef dir( m_dir );
|
||||
wxCFStringRef file( m_fileName );
|
||||
|
||||
m_path = wxEmptyString;
|
||||
m_path.clear();
|
||||
m_fileNames.Clear();
|
||||
m_paths.Clear();
|
||||
|
||||
|
@ -540,7 +540,7 @@ bool wxMimeTypesManagerImpl::GetMimeType(const wxString& uti, wxString *mimeType
|
||||
|
||||
if( itr == m_utiMap.end() || itr->second.mimeTypes.GetCount() < 1 )
|
||||
{
|
||||
*mimeType = wxEmptyString;
|
||||
mimeType->clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -582,7 +582,7 @@ bool wxMimeTypesManagerImpl::GetDescription(const wxString& uti, wxString *desc)
|
||||
|
||||
if( itr == m_utiMap.end() || itr->second.description.empty() )
|
||||
{
|
||||
*desc = wxEmptyString;
|
||||
desc->clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2815,7 +2815,7 @@ wxRichTextRange wxRichTextParagraphLayoutBox::AddParagraphs(const wxString& text
|
||||
AppendChild(para);
|
||||
|
||||
lastPara = para;
|
||||
line = wxEmptyString;
|
||||
line.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -4757,7 +4757,7 @@ bool wxRichTextParagraphLayoutBox::FindNextParagraphNumber(wxRichTextParagraph*
|
||||
text = text.Mid(0, text.Length() - pos - 1);
|
||||
}
|
||||
else
|
||||
text = wxEmptyString;
|
||||
text.clear();
|
||||
if (!text.IsEmpty())
|
||||
text += wxT(".");
|
||||
text += wxString::Format(wxT("%d"), nextNumber);
|
||||
@ -6297,7 +6297,7 @@ wxRichTextObject* wxRichTextParagraph::FindObjectAtPosition(long position)
|
||||
/// The resulting string may be shorter than the range given.
|
||||
bool wxRichTextParagraph::GetContiguousPlainText(wxString& text, const wxRichTextRange& range, bool fromStart)
|
||||
{
|
||||
text = wxEmptyString;
|
||||
text.clear();
|
||||
|
||||
if (fromStart)
|
||||
{
|
||||
@ -13623,7 +13623,7 @@ void wxTextBoxAttr::Reset()
|
||||
m_whitespaceMode = wxTEXT_BOX_ATTR_WHITESPACE_NONE;
|
||||
m_collapseMode = wxTEXT_BOX_ATTR_COLLAPSE_NONE;
|
||||
m_verticalAlignment = wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT_NONE;
|
||||
m_boxStyleName = wxEmptyString;
|
||||
m_boxStyleName.clear();
|
||||
|
||||
m_margins.Reset();
|
||||
m_padding.Reset();
|
||||
|
@ -744,7 +744,7 @@ void wxRichTextHeaderFooterData::Clear()
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 12; i++)
|
||||
m_text[i] = wxEmptyString;
|
||||
m_text[i].clear();
|
||||
}
|
||||
|
||||
#endif // wxUSE_RICHTEXT & wxUSE_PRINTING_ARCHITECTURE
|
||||
|
@ -605,7 +605,7 @@ void wxSymbolPickerDialog::ShowAtSubset()
|
||||
void wxSymbolPickerDialog::OnFontCtrlSelected( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
if (m_fontCtrl->GetSelection() == 0)
|
||||
m_fontName = wxEmptyString;
|
||||
m_fontName.clear();
|
||||
else
|
||||
m_fontName = m_fontCtrl->GetStringSelection();
|
||||
|
||||
@ -619,13 +619,9 @@ void wxSymbolPickerDialog::OnSymbolSelected( wxCommandEvent& event )
|
||||
return;
|
||||
|
||||
int sel = event.GetSelection();
|
||||
if (sel == wxNOT_FOUND)
|
||||
m_symbol = wxEmptyString;
|
||||
else
|
||||
{
|
||||
m_symbol = wxEmptyString;
|
||||
m_symbol.clear();
|
||||
if (sel != wxNOT_FOUND)
|
||||
m_symbol << (wxChar) sel;
|
||||
}
|
||||
|
||||
#if defined(__UNICODE__)
|
||||
if (sel != -1 && m_fromUnicode)
|
||||
|
@ -1083,7 +1083,7 @@ void wxRichTextXMLHelper::Clear()
|
||||
m_convMem = NULL;
|
||||
m_deleteConvFile = false;
|
||||
#endif
|
||||
m_fileEncoding = wxEmptyString;
|
||||
m_fileEncoding.clear();
|
||||
}
|
||||
|
||||
void wxRichTextXMLHelper::SetupForSaving(const wxString& enc)
|
||||
|
@ -548,8 +548,8 @@ void ScintillaWX::Paste() {
|
||||
|
||||
#if wxUSE_UNICODE
|
||||
// free up the old character buffer in case the text is real big
|
||||
data.SetText(wxEmptyString);
|
||||
text = wxEmptyString;
|
||||
text.clear();
|
||||
data.SetText(text);
|
||||
#endif
|
||||
const size_t len = buf.length();
|
||||
SelectionPosition selStart = sel.IsRectangular() ?
|
||||
|
Loading…
Reference in New Issue
Block a user