"),
left_indent.c_str(), //Document-Wide Left Indent
right_indent.c_str()); //Document-Wide Right Indent
-
+
str << wxT(" | ");
*/
-
+
str << wxT("");
-
- str << wxString::Format(wxT(""),
- currentParaStyle.GetFont().GetFaceName().c_str(), Pt_To_Size( currentParaStyle.GetFont().GetPointSize() ),
- currentParaStyle.GetTextColour().Red(), currentParaStyle.GetTextColour().Green(),
- currentParaStyle.GetTextColour().Blue());
-
+
+ str << wxString::Format(wxT(""),
+ currentParaStyle.GetFont().GetFaceName().c_str(), Pt_To_Size( currentParaStyle.GetFont().GetPointSize() ),
+ currentParaStyle.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX).c_str());
+
//wxString align = GetAlignment( currentParaStyle.GetAlignment() );
//str << wxString::Format(wxT(" "), align );
-
+
m_font = false;
m_indent = 0;
m_list = false;
-
+
wxRichTextObjectList::compatibility_iterator node = buffer->GetChildren().GetFirst();
while (node)
{
wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph);
wxASSERT (para != NULL);
-
+
if (para)
{
OutputParagraphFormatting(currentParaStyle, para->GetAttributes(), stream);
-
+
wxRichTextObjectList::compatibility_iterator node2 = para->GetChildren().GetFirst();
while (node2)
{
@@ -110,32 +108,33 @@ bool wxRichTextHTMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream&
if (textObj && !textObj->IsEmpty())
{
BeginCharacterFormatting(currentCharStyle, obj->GetAttributes(), stream);
-
+
str << textObj->GetText();
-
+
EndCharacterFormatting(currentCharStyle, obj->GetAttributes(), stream);
}
-
+
wxRichTextImage* image = wxDynamicCast(obj, wxRichTextImage);
if( image && !image->IsEmpty())
Image_to_Base64( image, stream );
-
+
node2 = node2->GetNext();
}
+ str << wxT("\n");
//OutputParagraphFormatting(currentParaStyle, para->GetAttributes(), stream, false);
}
node = node->GetNext();
}
-
+
str << wxT(" | \n");
-
+
return true;
}
void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, wxOutputStream& stream)
{
wxTextOutputStream str(stream);
-
+
//Is the item bulleted one?
if( thisStyle.GetBulletStyle() != wxTEXT_ATTR_BULLET_STYLE_NONE )
{
@@ -143,7 +142,7 @@ void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxTextAttrEx& current
if( m_list )
{
//Yes there is
-
+
//Is the item among the previous ones
//Is the item one of the previous list tag's child items
if( (thisStyle.GetLeftIndent() == (m_indent + 100)) || (thisStyle.GetLeftIndent() < 100) )
@@ -151,14 +150,14 @@ void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxTextAttrEx& current
else
{
//No it isn't
-
+
//So we should close the list tag
str << (m_is_ul ? wxT("") : wxT(""));
-
+
//And renavigate to new list's horizontal position
NavigateToListPosition(thisStyle, str);
//Ok it's done
-
+
//Get the appropriate tag, an ol for numerical values, an ul for dot, square etc.
wxString tag;
TypeOfList(thisStyle, tag);
@@ -168,29 +167,29 @@ void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxTextAttrEx& current
else
{
//No there isn't a list
-
+
//navigate to new list's horizontal position(indent)
- NavigateToListPosition(thisStyle, str);
-
+ NavigateToListPosition(thisStyle, str);
+
//Get the appropriate tag, an ol for numerical values, an ul for dot, square etc.
wxString tag;
TypeOfList(thisStyle, tag);
str << tag << wxT("");
-
+
//Now we have a list, mark it.
m_list = true;
- }
+ }
}
else if( m_list )
{
- //The item is not bulleted and there is a list what should be closed now.
+ //The item is not bulleted and there is a list what should be closed now.
//So close the list
str << (m_is_ul ? wxT("") : wxT(""));
//And mark as there is no an opened list
m_list = false;
}
-
+
// does the item have an indentation ?
if( thisStyle.GetLeftIndent() )
{
@@ -223,7 +222,7 @@ void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxTextAttrEx& current
Indent(thisStyle, str);
m_indent = thisStyle.GetLeftIndent() + thisStyle.GetLeftSubIndent();
m_indents.Add( m_indent );
-
+
break;
}
else if( m_indent == (thisStyle.GetLeftIndent() + thisStyle.GetLeftSubIndent()) )
@@ -237,9 +236,9 @@ void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxTextAttrEx& current
else
{
str << wxT(" |