Speeded up image saving to XML (WriteHex).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67303 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -10417,8 +10417,13 @@ bool wxRichTextImageBlock::Load(wxImage& image)
|
||||
// Write data in hex to a stream
|
||||
bool wxRichTextImageBlock::WriteHex(wxOutputStream& stream)
|
||||
{
|
||||
const int bufSize = 512;
|
||||
char buf[bufSize+1];
|
||||
if (m_dataSize == 0)
|
||||
return true;
|
||||
|
||||
int bufSize = 100000;
|
||||
if (int(m_dataSize+1) < bufSize)
|
||||
bufSize = m_dataSize+1;
|
||||
char* buf = new char[bufSize+1];
|
||||
|
||||
int left = m_dataSize;
|
||||
int n, i, j;
|
||||
@@ -10444,6 +10449,7 @@ bool wxRichTextImageBlock::WriteHex(wxOutputStream& stream)
|
||||
buf[n] = 0;
|
||||
stream.Write((const char*) buf, n);
|
||||
}
|
||||
delete[] buf;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user