- // 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();
- }