*************** *** 161,170 **** return; } - // if(m_iBlockType == BT_NORMAL) - // m_pie->write("

\n"); - if(m_iBlockType == BT_HEADING1) m_pie->write("\n"); else if(m_iBlockType == BT_HEADING2) --- 161,170 ---- return; } + if(m_iBlockType == BT_NORMAL) + m_pie->write("

\n"); + else if(m_iBlockType == BT_HEADING1) m_pie->write("\n"); else if(m_iBlockType == BT_HEADING2) *************** *** 182,188 **** // Add "catchall" for now else - m_pie->write("
\n"); m_bInBlock = UT_FALSE; return; --- 182,188 ---- // Add "catchall" for now else + m_pie->write("

\n"); m_bInBlock = UT_FALSE; return; *************** *** 259,266 **** //

... - // m_iBlockType = BT_NORMAL; - // m_pie->write(" ... + m_iBlockType = BT_NORMAL; + m_pie->write("

with no style attribute ... - //m_iBlockType = BT_NORMAL; - //m_pie->write(" with no style attribute ... + m_iBlockType = BT_NORMAL; + m_pie->write("

getProperty("text-align", szValue)) ) { - m_pie->write(" ALIGN=\""); m_pie->write(szValue); m_pie->write("\""); } --- 280,286 ---- m_iBlockType == BT_NORMAL && (pAP->getProperty("text-align", szValue)) ) { + m_pie->write(" align=\""); m_pie->write(szValue); m_pie->write("\""); } *************** *** 288,295 **** //

with no style attribute, and no properties either - //m_iBlockType = BT_NORMAL; - //m_pie->write("write(">"); --- 290,298 ---- //

with no style attribute, and no properties either + m_iBlockType = BT_NORMAL; + m_pie->write("

write(">"); *************** *** 374,379 **** const PP_AttrProp * pAP = NULL; UT_Bool bHaveProp = m_pDocument->getAttrProp(api,&pAP); if (bHaveProp && pAP) { --- 377,385 ---- const PP_AttrProp * pAP = NULL; UT_Bool bHaveProp = m_pDocument->getAttrProp(api,&pAP); + + bool span = UT_FALSE; + bool textD = UT_FALSE; if (bHaveProp && pAP) { *************** *** 384,390 **** && !UT_stricmp(szValue, "bold") ) { - m_pie->write(""); } if ( --- 390,404 ---- && !UT_stricmp(szValue, "bold") ) { + if (!span) + { + m_pie->write("write("; font-weight: bold"); + } } if ( *************** *** 392,399 **** && !UT_stricmp(szValue, "italic") ) { - m_pie->write(""); } if ( (pAP->getProperty("text-decoration", szValue)) --- 406,422 ---- && !UT_stricmp(szValue, "italic") ) { + if (!span) + { + m_pie->write("write("; font-style: italic"); + } } + if ( (pAP->getProperty("text-decoration", szValue)) *************** *** 414,420 **** { if (0 == UT_stricmp(q, "underline")) { - m_pie->write(""); } q = strtok(NULL, " "); --- 437,456 ---- { if (0 == UT_stricmp(q, "underline")) { + if (!span) + { + m_pie->write("write("; text-decoration: underline"); + textD = UT_TRUE; + } + else + { + m_pie->write(" underline"); + } } q = strtok(NULL, " "); *************** *** 442,448 **** { if (0 == UT_stricmp(q, "line-through")) { - m_pie->write(""); // is it or ? TODO } q = strtok(NULL, " "); --- 478,538 ---- { if (0 == UT_stricmp(q, "line-through")) { + if (!span) + { + m_pie->write("write("; text-decoration: line-through"); + textD = UT_TRUE; + } + else + { + m_pie->write(" line-through"); + } + } + + q = strtok(NULL, " "); + } + + free(p); + } + + if ( + (pAP->getProperty("text-decoration", szValue)) + ) + { + const XML_Char* pszDecor = szValue; + + XML_Char* p; + if (!UT_cloneString((char *&)p, pszDecor)) + { + // TODO outofmem + } + + UT_ASSERT(p || !pszDecor); + XML_Char* q = strtok(p, " "); + + while (q) + { + if (0 == UT_stricmp(q, "overline")) + { + if (!span) + { + m_pie->write("write("; text-decoration: overline"); + textD = UT_TRUE; + } + else + { + m_pie->write(" overline"); + } } q = strtok(NULL, " "); *************** *** 451,456 **** free(p); } if (pAP->getProperty("text-position", szValue)) { if (!UT_stricmp("superscript", szValue)) --- 541,549 ---- free(p); } + if (span) + m_pie->write("\">"); + if (pAP->getProperty("text-position", szValue)) { if (!UT_stricmp("superscript", szValue)) *************** *** 480,486 **** m_pie->write("write(" COLOR=\""); char szColor[16]; _convertColor(szColor, pszColor); m_pie->write(szColor); --- 573,579 ---- m_pie->write("write(" color=\""); char szColor[16]; _convertColor(szColor, pszColor); m_pie->write(szColor); *************** *** 489,502 **** if (pszFontFamily) { - m_pie->write(" FACE=\""); m_pie->write(pszFontFamily); m_pie->write("\""); } if (pszFontSize) { - m_pie->write(" SIZE=\""); char szSize[16]; _convertFontSize(szSize, pszFontSize); m_pie->write(szSize); --- 582,595 ---- if (pszFontFamily) { + m_pie->write(" face=\""); m_pie->write(pszFontFamily); m_pie->write("\""); } if (pszFontSize) { + m_pie->write(" size=\""); char szSize[16]; _convertFontSize(szSize, pszFontSize); m_pie->write(szSize); *************** *** 543,602 **** } } - if ( - (pAP->getProperty("text-decoration", szValue)) - ) - { - const XML_Char* pszDecor = szValue; - - XML_Char* p; - if (!UT_cloneString((char *&)p, pszDecor)) - { - // TODO outofmem - } - - UT_ASSERT(p || !pszDecor); - XML_Char* q = strtok(p, " "); - - while (q) - { - if (0 == UT_stricmp(q, "line-through")) - { - m_pie->write(""); // is it or ? TODO - } - - q = strtok(NULL, " "); - } - - free(p); - } if ( (pAP->getProperty("text-decoration", szValue)) ) { - const XML_Char* pszDecor = szValue; - - XML_Char* p; - if (!UT_cloneString((char *&)p, pszDecor)) - { - // TODO outofmem - } - - UT_ASSERT(p || !pszDecor); - XML_Char* q = strtok(p, " "); - - while (q) - { - if (0 == UT_stricmp(q, "underline")) - { - m_pie->write(""); - } - - q = strtok(NULL, " "); - } - - free(p); } if ( --- 636,649 ---- } } + UT_Bool closeSpan = UT_FALSE; if ( (pAP->getProperty("text-decoration", szValue)) + && UT_stricmp(szValue, "none") ) { + closeSpan = UT_TRUE; } if ( *************** *** 604,610 **** && !UT_stricmp(szValue, "italic") ) { - m_pie->write(""); } if ( --- 651,657 ---- && !UT_stricmp(szValue, "italic") ) { + closeSpan = UT_TRUE; } if ( *************** *** 612,620 **** && !UT_stricmp(szValue, "bold") ) { - m_pie->write(""); } m_pAP_Span = NULL; } --- 659,672 ---- && !UT_stricmp(szValue, "bold") ) { + closeSpan = UT_TRUE; } + if (closeSpan) + { + m_pie->write(""); + } + m_pAP_Span = NULL; } *************** *** 763,771 **** m_pie->write("\n"); m_pie->write("\n"); m_pie->write("\n"); m_pie->write("AbiWord Document\n"); m_pie->write("\n"); m_pie->write("\n"); --- 815,827 ---- m_pie->write("\n"); + m_pie->write("\n"); m_pie->write("\n"); m_pie->write("\n"); m_pie->write("AbiWord Document\n"); + m_pie->write("\n"); m_pie->write("\n"); m_pie->write("\n");