Index: ie_imp_XHTML.cpp =================================================================== RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_imp_XHTML.cpp,v retrieving revision 1.31 diff -u -r1.31 ie_imp_XHTML.cpp --- ie_imp_XHTML.cpp 2001/10/24 16:23:47 1.31 +++ ie_imp_XHTML.cpp 2001/12/18 22:14:16 @@ -217,6 +217,7 @@ { m_iListID = 0; m_iNewListID = 0; + m_bFirstDiv = true; } IE_Imp_XHTML::~IE_Imp_XHTML() @@ -520,7 +521,6 @@ X_EatIfAlreadyError(); // xml parser keeps running until buffer consumed // this just avoids all the processing if there is an error - #define NEW_ATTR_SZ 3 const XML_Char *new_atts[NEW_ATTR_SZ]; XML_Char * sz = NULL; @@ -543,13 +543,21 @@ case TT_BODY: //UT_DEBUGMSG(("Doc %d\n", m_parseState)); X_VerifyParseState(_PS_Doc); + m_parseState = _PS_Sec; + X_CheckError(getDoc()->appendStrux(PTX_Section,NULL)); return; case TT_DIV: //UT_DEBUGMSG(("B %d\n", m_parseState)); - X_VerifyParseState(_PS_Doc); - m_parseState = _PS_Sec; - X_CheckError(getDoc()->appendStrux(PTX_Section,NULL)); + X_VerifyParseState(_PS_Sec); + if( !m_bFirstDiv ) + { + X_CheckError(getDoc()->appendStrux(PTX_Section,NULL)); + } + else + { + m_bFirstDiv = false; + } return; case TT_Q: @@ -916,14 +924,13 @@ case TT_BODY: //UT_DEBUGMSG(("Doc %d\n", m_parseState)); - X_VerifyParseState(_PS_Doc); + X_VerifyParseState(_PS_Sec); m_parseState = _PS_Doc; return; case TT_DIV: //UT_DEBUGMSG(("B %d\n", m_parseState)); X_VerifyParseState(_PS_Sec); - m_parseState = _PS_Doc; return; case TT_OL: Index: ie_imp_XHTML.h =================================================================== RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_imp_XHTML.h,v retrieving revision 1.12 diff -u -r1.12 ie_imp_XHTML.h --- ie_imp_XHTML.h 2001/10/18 14:00:08 1.12 +++ ie_imp_XHTML.h 2001/12/18 22:14:16 @@ -59,6 +59,7 @@ protected: enum listType {L_NONE = 0, L_OL = 1, L_UL = 2 } m_listType; + bool m_bFirstDiv; UT_uint16 m_iListID; UT_uint16 m_iNewListID; Index: ie_imp_XML.cpp =================================================================== RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_imp_XML.cpp,v retrieving revision 1.30 diff -u -r1.30 ie_imp_XML.cpp --- ie_imp_XML.cpp 2001/11/06 16:32:59 1.30 +++ ie_imp_XML.cpp 2001/12/18 22:14:17 @@ -170,6 +170,15 @@ // with the wrong values return; } + + + case _PS_Sec: + { + // Sets a block Strux and falls through. + // Hack to work around the need for
etc to enter data + // from HTML. + X_CheckError(getDoc()->appendStrux(PTX_Block,NULL)); + } case _PS_Block: case _PS_IgnoredWordsItem: @@ -288,6 +297,7 @@ switch (m_parseState) { + case _PS_Sec: case _PS_Block: X_CheckError(getDoc()->appendSpan(buf.ucs_str(), buf.size())); break;