- wxTextOutputStream str(stream);
-
- // Is the item a bulleted one?
- if ( paraStyle.GetBulletStyle() != wxTEXT_ATTR_BULLET_STYLE_NONE )
- {
- // Is there any opened list?
- 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 ((paraStyle.GetLeftIndent() == (m_indent + 100)) || (paraStyle.GetLeftIndent() < 100))
- str << wxT("<li>"); //Yes it is
- else
- {
- // No it isn't, so we should close the list tag
- str << (m_is_ul ? wxT("</ul>") : wxT("</ol>"));
-
- // And renavigate to new list's horizontal position
- NavigateToListPosition(paraStyle, str);
-
- // Get the appropriate tag, an ol for numerical values, an ul for dot, square etc.
- wxString tag;
- TypeOfList(paraStyle, tag);
- str << tag << wxT("<li>");
- }
- }
- else
- {
- // No there isn't a list.
- // navigate to new list's horizontal position(indent)
- NavigateToListPosition(paraStyle, str);
-
- // Get the appropriate tag, an ol for numerical values, an ul for dot, square etc.
- wxString tag;
- TypeOfList(paraStyle, tag);
- str << tag << wxT("<li>");
-
- // 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.
- // So close the list
-
- str << (m_is_ul ? wxT("</ul>") : wxT("</ol>"));
-
- // And mark as there is no an opened list
- m_list = false;
- }
-
- // does the item have an indentation ?
- if( paraStyle.GetLeftIndent() )
- {
- if (paraStyle.GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_NONE)
- {
- if (m_indent)
- {
- if ((paraStyle.GetLeftIndent() + paraStyle.GetLeftSubIndent()) == m_indent)
- {
- if (paraStyle.GetLeftSubIndent() < 0)
- {
- str << SymbolicIndent(~paraStyle.GetLeftSubIndent());
- }
- }
- else
- {
- if (paraStyle.GetLeftIndent() + paraStyle.GetLeftSubIndent() > m_indent)
- {
- Indent(paraStyle, str);
- m_indent = paraStyle.GetLeftIndent() + paraStyle.GetLeftSubIndent();
- m_indents.Add( m_indent );
- }
- else
- {
- int i = m_indents.size() - 1;
- for (; i > -1; i--)
- {
- if (m_indent < (paraStyle.GetLeftIndent() + paraStyle.GetLeftSubIndent()))
- {
- Indent(paraStyle, str);
- m_indent = paraStyle.GetLeftIndent() + paraStyle.GetLeftSubIndent();
- m_indents.Add( m_indent );
-
- break;
- }
- else if (m_indent == (paraStyle.GetLeftIndent() + paraStyle.GetLeftSubIndent()))
- {
- if (paraStyle.GetLeftSubIndent() < 0)
- {
- str << SymbolicIndent(~paraStyle.GetLeftSubIndent());
- }
- break;
- }
- else
- {
- str << wxT("</td></tr></table>");
-
- m_indents.RemoveAt(i);
-
- if(i < 1)
- {
- m_indent=0; break;
- }
- m_indent = m_indents[i-1];
- }
- }
- }
- }
- }
- else
- {
- Indent(paraStyle, str);
- m_indent = paraStyle.GetLeftIndent() + paraStyle.GetLeftSubIndent();
- m_indents.Add( m_indent );
- }
- }
- }
- else if (m_indent)
- {
- // The item is not indented and there is a table(s) that should be closed now.
-
- for (unsigned int i = 0; i < m_indents.size(); i++)
- str << wxT("</td></tr></table>");
-
- m_indent = 0;
- m_indents.Clear();
- }
-
-