Image objects should load and save attributes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -200,6 +200,7 @@ bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node)
|
|||||||
if (!data.empty())
|
if (!data.empty())
|
||||||
{
|
{
|
||||||
wxRichTextImage* imageObj = new wxRichTextImage(para);
|
wxRichTextImage* imageObj = new wxRichTextImage(para);
|
||||||
|
GetStyle(imageObj->GetAttributes(), child, false);
|
||||||
para->AppendChild(imageObj);
|
para->AppendChild(imageObj);
|
||||||
|
|
||||||
wxStringInputStream strStream(data);
|
wxStringInputStream strStream(data);
|
||||||
@@ -720,6 +721,8 @@ bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem,
|
|||||||
{
|
{
|
||||||
wxRichTextImage& imageObj = (wxRichTextImage&) obj;
|
wxRichTextImage& imageObj = (wxRichTextImage&) obj;
|
||||||
|
|
||||||
|
wxString style = CreateStyle(obj.GetAttributes(), false);
|
||||||
|
|
||||||
if (imageObj.GetImage().Ok() && !imageObj.GetImageBlock().Ok())
|
if (imageObj.GetImage().Ok() && !imageObj.GetImageBlock().Ok())
|
||||||
imageObj.MakeBlock();
|
imageObj.MakeBlock();
|
||||||
|
|
||||||
@@ -728,11 +731,11 @@ bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem,
|
|||||||
if (!imageObj.GetImageBlock().Ok())
|
if (!imageObj.GetImageBlock().Ok())
|
||||||
{
|
{
|
||||||
// No data
|
// No data
|
||||||
OutputString(stream, wxT(">"), convMem, convFile);
|
OutputString(stream, style + wxT(">"), convMem, convFile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OutputString(stream, wxString::Format(wxT(" imagetype=\"%d\">"), (int) imageObj.GetImageBlock().GetImageType()));
|
OutputString(stream, wxString::Format(wxT(" imagetype=\"%d\"") + style + wxT(">"), (int) imageObj.GetImageBlock().GetImageType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputIndentation(stream, indent+1);
|
OutputIndentation(stream, indent+1);
|
||||||
|
Reference in New Issue
Block a user