Warning fix about assigning unused value + little source cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -127,11 +127,11 @@ bool wxXmlNode::HasProp(const wxString& propName) const
|
|||||||
|
|
||||||
while (prop)
|
while (prop)
|
||||||
{
|
{
|
||||||
if (prop->GetName() == propName) return TRUE;
|
if (prop->GetName() == propName) return true;
|
||||||
prop = prop->GetNext();
|
prop = prop->GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxXmlNode::GetPropVal(const wxString& propName, wxString *value) const
|
bool wxXmlNode::GetPropVal(const wxString& propName, wxString *value) const
|
||||||
@@ -143,12 +143,12 @@ bool wxXmlNode::GetPropVal(const wxString& propName, wxString *value) const
|
|||||||
if (prop->GetName() == propName)
|
if (prop->GetName() == propName)
|
||||||
{
|
{
|
||||||
*value = prop->GetValue();
|
*value = prop->GetValue();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
prop = prop->GetNext();
|
prop = prop->GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxXmlNode::GetPropVal(const wxString& propName, const wxString& defaultVal) const
|
wxString wxXmlNode::GetPropVal(const wxString& propName, const wxString& defaultVal) const
|
||||||
@@ -194,13 +194,13 @@ void wxXmlNode::InsertChild(wxXmlNode *child, wxXmlNode *before_node)
|
|||||||
bool wxXmlNode::RemoveChild(wxXmlNode *child)
|
bool wxXmlNode::RemoveChild(wxXmlNode *child)
|
||||||
{
|
{
|
||||||
if (m_children == NULL)
|
if (m_children == NULL)
|
||||||
return FALSE;
|
return false;
|
||||||
else if (m_children == child)
|
else if (m_children == child)
|
||||||
{
|
{
|
||||||
m_children = child->m_next;
|
m_children = child->m_next;
|
||||||
child->m_parent = NULL;
|
child->m_parent = NULL;
|
||||||
child->m_next = NULL;
|
child->m_next = NULL;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -212,11 +212,11 @@ bool wxXmlNode::RemoveChild(wxXmlNode *child)
|
|||||||
ch->m_next = child->m_next;
|
ch->m_next = child->m_next;
|
||||||
child->m_parent = NULL;
|
child->m_parent = NULL;
|
||||||
child->m_next = NULL;
|
child->m_next = NULL;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
ch = ch->m_next;
|
ch = ch->m_next;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ bool wxXmlNode::DeleteProperty(const wxString& name)
|
|||||||
wxXmlProperty *prop;
|
wxXmlProperty *prop;
|
||||||
|
|
||||||
if (m_properties == NULL)
|
if (m_properties == NULL)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
else if (m_properties->GetName() == name)
|
else if (m_properties->GetName() == name)
|
||||||
{
|
{
|
||||||
@@ -250,7 +250,7 @@ bool wxXmlNode::DeleteProperty(const wxString& name)
|
|||||||
m_properties = prop->GetNext();
|
m_properties = prop->GetNext();
|
||||||
prop->SetNext(NULL);
|
prop->SetNext(NULL);
|
||||||
delete prop;
|
delete prop;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -264,11 +264,11 @@ bool wxXmlNode::DeleteProperty(const wxString& name)
|
|||||||
p->SetNext(prop->GetNext());
|
p->SetNext(prop->GetNext());
|
||||||
prop->SetNext(NULL);
|
prop->SetNext(NULL);
|
||||||
delete prop;
|
delete prop;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
p = p->GetNext();
|
p = p->GetNext();
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,11 +431,11 @@ static void TextHnd(void *userData, const char *s, int len)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool whiteOnly = TRUE;
|
bool whiteOnly = true;
|
||||||
for (char *c = buf; *c != '\0'; c++)
|
for (char *c = buf; *c != '\0'; c++)
|
||||||
if (*c != ' ' && *c != '\t' && *c != '\n' && *c != '\r')
|
if (*c != ' ' && *c != '\t' && *c != '\n' && *c != '\r')
|
||||||
{
|
{
|
||||||
whiteOnly = FALSE;
|
whiteOnly = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!whiteOnly)
|
if (!whiteOnly)
|
||||||
@@ -569,9 +569,9 @@ bool wxXmlDocument::Load(wxInputStream& stream, const wxString& encoding)
|
|||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
if (!ctx.version.IsEmpty())
|
if (!ctx.version.empty())
|
||||||
SetVersion(ctx.version);
|
SetVersion(ctx.version);
|
||||||
if (!ctx.encoding.IsEmpty())
|
if (!ctx.encoding.empty())
|
||||||
SetFileEncoding(ctx.encoding);
|
SetFileEncoding(ctx.encoding);
|
||||||
SetRoot(ctx.root);
|
SetRoot(ctx.root);
|
||||||
}
|
}
|
||||||
@@ -605,7 +605,7 @@ inline static void OutputString(wxOutputStream& stream, const wxString& str,
|
|||||||
#endif
|
#endif
|
||||||
wxMBConv *convFile)
|
wxMBConv *convFile)
|
||||||
{
|
{
|
||||||
if (str.IsEmpty()) return;
|
if (str.empty()) return;
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
const wxWX2MBbuf buf(str.mb_str(*(convFile ? convFile : &wxConvUTF8)));
|
const wxWX2MBbuf buf(str.mb_str(*(convFile ? convFile : &wxConvUTF8)));
|
||||||
stream.Write((const char*)buf, strlen((const char*)buf));
|
stream.Write((const char*)buf, strlen((const char*)buf));
|
||||||
@@ -734,14 +734,16 @@ static void OutputNode(wxOutputStream& stream, wxXmlNode *node, int indent,
|
|||||||
bool wxXmlDocument::Save(wxOutputStream& stream) const
|
bool wxXmlDocument::Save(wxOutputStream& stream) const
|
||||||
{
|
{
|
||||||
if ( !IsOk() )
|
if ( !IsOk() )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
wxString s;
|
wxString s;
|
||||||
|
|
||||||
wxMBConv *convMem = NULL, *convFile = NULL;
|
wxMBConv *convMem = NULL;
|
||||||
|
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
convFile = new wxCSConv(GetFileEncoding());
|
wxMBConv *convFile = new wxCSConv(GetFileEncoding());
|
||||||
#else
|
#else
|
||||||
|
wxMBConv *convFile = NULL;
|
||||||
if ( GetFileEncoding() != GetEncoding() )
|
if ( GetFileEncoding() != GetEncoding() )
|
||||||
{
|
{
|
||||||
convFile = new wxCSConv(GetFileEncoding());
|
convFile = new wxCSConv(GetFileEncoding());
|
||||||
@@ -761,7 +763,7 @@ bool wxXmlDocument::Save(wxOutputStream& stream) const
|
|||||||
if ( convMem )
|
if ( convMem )
|
||||||
delete convMem;
|
delete convMem;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_XML
|
#endif // wxUSE_XML
|
||||||
|
Reference in New Issue
Block a user