Minor changes to wxTreeCtrl's horiz size,
Text stream now can write Mac/Unix/Dos EOL on resp. other platforms, Fixed return value of wxBufferedOutputStream::GetSize() and ::TellO() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5036 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -323,15 +323,41 @@ wxTextInputStream& wxTextInputStream::operator>>(float& f)
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxTextOutputStream::wxTextOutputStream(wxOutputStream& s)
|
||||
wxTextOutputStream::wxTextOutputStream(wxOutputStream& s, wxEOL mode)
|
||||
: m_output(s)
|
||||
{
|
||||
m_mode = mode;
|
||||
if (m_mode == wxEOL_NATIVE)
|
||||
{
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
m_mode = wxEOL_DOS;
|
||||
#elif defined(__WXMAC__)
|
||||
m_mode = wxEOL_MAC;
|
||||
#else
|
||||
m_mode = wxEOL_UNIX;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
wxTextOutputStream::~wxTextOutputStream()
|
||||
{
|
||||
}
|
||||
|
||||
void wxTextOutputStream::SetMode( wxEOL mode = wxEOL_NATIVE )
|
||||
{
|
||||
m_mode = mode;
|
||||
if (m_mode == wxEOL_NATIVE)
|
||||
{
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
m_mode = wxEOL_DOS;
|
||||
#elif defined(__WXMAC__)
|
||||
m_mode = wxEOL_MAC;
|
||||
#else
|
||||
m_mode = wxEOL_UNIX;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextOutputStream::Write32(wxUint32 i)
|
||||
{
|
||||
wxString str;
|
||||
@@ -371,25 +397,22 @@ void wxTextOutputStream::WriteString(const wxString& string)
|
||||
wxChar c = string[i];
|
||||
if (c == wxT('\n'))
|
||||
{
|
||||
#if defined(__WINDOWS__)
|
||||
c = wxT('\r');
|
||||
m_output.Write( (const void*)(&c), sizeof(wxChar) );
|
||||
c = wxT('\n');
|
||||
m_output.Write( (const void*)(&c), sizeof(wxChar) );
|
||||
#elif defined(__UNIX__)
|
||||
c = wxT('\n');
|
||||
m_output.Write( (const void*)(&c), sizeof(wxChar) );
|
||||
#elif defined(__WXMAC__)
|
||||
c = wxT('\r');
|
||||
m_output.Write( (const void*)(&c), sizeof(wxChar) );
|
||||
#elif defined(__OS2__)
|
||||
c = wxT('\r');
|
||||
m_output.Write( (const void*)(&c), sizeof(wxChar) );
|
||||
c = wxT('\n');
|
||||
m_output.Write( (const void*)(&c), sizeof(wxChar) );
|
||||
#else
|
||||
#error "wxTextOutputStream: unsupported platform."
|
||||
#endif
|
||||
if (m_mode == wxEOL_DOS)
|
||||
{
|
||||
c = wxT('\r');
|
||||
m_output.Write( (const void*)(&c), sizeof(wxChar) );
|
||||
c = wxT('\n');
|
||||
m_output.Write( (const void*)(&c), sizeof(wxChar) );
|
||||
} else
|
||||
if (m_mode == wxEOL_MAC)
|
||||
{
|
||||
c = wxT('\r');
|
||||
m_output.Write( (const void*)(&c), sizeof(wxChar) );
|
||||
} else
|
||||
{
|
||||
c = wxT('\n');
|
||||
m_output.Write( (const void*)(&c), sizeof(wxChar) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user