/////////////////////////////////////////////////////////////////////////////
-// Name: richtext/richtextxml.cpp
+// Name: src/richtext/richtextxml.cpp
// Purpose: XML and HTML I/O for wxRichTextCtrl
// Author: Julian Smart
// Modified by:
#include "wx/wxprec.h"
#ifdef __BORLANDC__
- #pragma hdrstop
+ #pragma hdrstop
#endif
#if wxUSE_RICHTEXT && wxUSE_XML
#include "wx/richtext/richtextxml.h"
#ifndef WX_PRECOMP
- #include "wx/wx.h"
+ #include "wx/intl.h"
+ #include "wx/module.h"
#endif
#include "wx/filename.h"
#include "wx/clipbrd.h"
#include "wx/wfstream.h"
#include "wx/sstream.h"
-#include "wx/module.h"
#include "wx/txtstrm.h"
#include "wx/xml/xml.h"
-#include "wx/intl.h"
IMPLEMENT_DYNAMIC_CLASS(wxRichTextXMLHandler, wxRichTextFileHandler)
wxString text2 = textChild->GetContent();
// Strip whitespace from end
- if (text2.Length() > 0 && text2[text2.Length()-1] == wxT('\n'))
- text2 = text2.Mid(0, text2.Length()-1);
+ if (!text2.empty() && text2[text2.length()-1] == wxT('\n'))
+ text2 = text2.Mid(0, text2.length()-1);
- if (text2.Length() > 0 && text2[0] == wxT('"'))
+ if (!text2.empty() && text2[0] == wxT('"'))
text2 = text2.Mid(1);
- if (text2.Length() > 0 && text2[text2.Length()-1] == wxT('"'))
- text2 = text2.Mid(0, text2.Length() - 1);
+ if (!text2.empty() && text2[text2.length()-1] == wxT('"'))
+ text2 = text2.Mid(0, text2.length() - 1);
text += text2;
}
wxStringInputStream strStream(data);
- imageObj->GetImageBlock().ReadHex(strStream, data.Length(), imageType);
+ imageObj->GetImageBlock().ReadHex(strStream, data.length(), imageType);
}
}
child = child->GetNext();
for (i = 0; i < len; i++)
{
c = str.GetChar(i);
-
+
// Original code excluded "&" but we _do_ want to convert
// the ampersand beginning & because otherwise when read in,
// the original "&" becomes "&".
#endif
// If SetEncoding has been called, change the output encoding.
- if (!m_encoding.IsEmpty() && m_encoding.Lower() != fileEncoding.Lower())
+ if (!m_encoding.empty() && m_encoding.Lower() != fileEncoding.Lower())
{
if (m_encoding == wxT("<System>"))
{
}
// GetSystemEncodingName may not have returned a name
- if (fileEncoding.IsEmpty())
+ if (fileEncoding.empty())
#if wxUSE_UNICODE
fileEncoding = wxT("UTF-8");
#else
if (deleteConvFile)
delete convFile;
-
+
return success;
}
OutputString(stream, style + wxT(">"), convMem, convFile);
wxString str = text.GetText();
- if (str.Length() > 0 && (str[0] == wxT(' ') || str[str.Length()-1] == wxT(' ')))
+ if (!str.empty() && (str[0] == wxT(' ') || str[str.length()-1] == wxT(' ')))
{
OutputString(stream, wxT("\""), convMem, convFile);
OutputStringEnt(stream, str, convMem, convFile);
#endif
// wxUSE_STREAMS
-
+
#endif
// wxUSE_RICHTEXT && wxUSE_XML