-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sat, 12 Feb 2000, sam th wrote:
> This patch uses css to implement proper display of breaks between
> paragrahs. Also, it uses CSS instead of <u> and <strike> and adds export
> of overline to html. If people have objections to use of CSS in our
> exported html, they should speak now, or I will start implementing more
> feature in css instead of html. ha ha ha.
>
>
> sam th
> [EMAIL PROTECTED]
>
> ------------ Output from gpg ------------
> gpg: Good signature from "Sam Tobin-Hochstadt <[EMAIL PROTECTED]>"
>
I seem to have a problem remembering to include the patch.
sam th
[EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE4pjtct+kM0Mq9M/wRAuxpAKCSlA725l/SiBNYeCJmQlaFvmTeogCfYCBI
EvWzmIsRssQzbBOhrtdSkPk=
=7euZ
-----END PGP SIGNATURE-----
diff -ru -x CVS abi/src/wp/impexp/xp/ie_exp_HTML.cpp
abi-mod/src/wp/impexp/xp/ie_exp_HTML.cpp
--- abi/src/wp/impexp/xp/ie_exp_HTML.cpp Sat Feb 12 22:48:00 2000
+++ abi-mod/src/wp/impexp/xp/ie_exp_HTML.cpp Sat Feb 12 22:08:39 2000
@@ -161,10 +161,10 @@
return;
}
- // if(m_iBlockType == BT_NORMAL)
- // m_pie->write("</p>\n");
+ if(m_iBlockType == BT_NORMAL)
+ m_pie->write("</p>\n");
- if(m_iBlockType == BT_HEADING1)
+ else if(m_iBlockType == BT_HEADING1)
m_pie->write("</h1>\n");
else if(m_iBlockType == BT_HEADING2)
@@ -182,7 +182,7 @@
// Add "catchall" for now
else
- m_pie->write("<br />\n");
+ m_pie->write("</p>\n");
m_bInBlock = UT_FALSE;
return;
@@ -259,8 +259,9 @@
// <p style="<anything else!>"> ...
- // m_iBlockType = BT_NORMAL;
- // m_pie->write("<p");
+ m_iBlockType = BT_NORMAL;
+ m_pie->write("<p class=\"norm\"");
+ wasWritten = UT_TRUE;
}
}
else
@@ -268,8 +269,9 @@
// <p> with no style attribute ...
- //m_iBlockType = BT_NORMAL;
- //m_pie->write("<p");
+ m_iBlockType = BT_NORMAL;
+ m_pie->write("<p class=\"norm\"");
+ wasWritten = UT_TRUE;
}
/* Assumption: never get property set with h1-h3, block text, plain
text. Probably true. */
@@ -278,7 +280,7 @@
m_iBlockType == BT_NORMAL && (pAP->getProperty("text-align",
szValue))
)
{
- m_pie->write(" ALIGN=\"");
+ m_pie->write(" align=\"");
m_pie->write(szValue);
m_pie->write("\"");
}
@@ -288,8 +290,9 @@
// <p> with no style attribute, and no properties either
- //m_iBlockType = BT_NORMAL;
- //m_pie->write("<p");
+ m_iBlockType = BT_NORMAL;
+ m_pie->write("<p class=\"norm\"");
+ wasWritten = UT_TRUE;
}
if (wasWritten)
m_pie->write(">");
@@ -394,6 +397,8 @@
{
m_pie->write("<i>");
}
+
+ UT_Bool startSpan = UT_FALSE;
if (
(pAP->getProperty("text-decoration", szValue))
@@ -414,7 +419,15 @@
{
if (0 == UT_stricmp(q, "underline"))
{
- m_pie->write("<u>");
+ if (!startSpan)
+ {
+ m_pie->write("<span style=\"text-decoration:
+underline");
+ startSpan = UT_TRUE;
+ }
+ else
+ {
+ m_pie->write(" underline");
+ }
}
q = strtok(NULL, " ");
@@ -442,7 +455,15 @@
{
if (0 == UT_stricmp(q, "line-through"))
{
- m_pie->write("<s>"); // is it <s> or
<strike> ? TODO
+ if (!startSpan)
+ {
+ m_pie->write("<span style=\"text-decoration:
+line-through");
+ startSpan = UT_TRUE;
+ }
+ else
+ {
+ m_pie->write(" line-through");
+ }
}
q = strtok(NULL, " ");
@@ -451,6 +472,45 @@
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 (!startSpan)
+ {
+ m_pie->write("<span style=\"text-decoration:
+overline");
+ startSpan = UT_TRUE;
+ }
+ else
+ {
+ m_pie->write(" overline");
+ }
+ }
+
+ q = strtok(NULL, " ");
+ }
+
+ free(p);
+ }
+
+ if (startSpan)
+ m_pie->write("\">");
+
if (pAP->getProperty("text-position", szValue))
{
if (!UT_stricmp("superscript", szValue))
@@ -480,7 +540,7 @@
m_pie->write("<font");
if (pszColor)
{
- m_pie->write(" COLOR=\"");
+ m_pie->write(" color=\"");
char szColor[16];
_convertColor(szColor, pszColor);
m_pie->write(szColor);
@@ -489,14 +549,14 @@
if (pszFontFamily)
{
- m_pie->write(" FACE=\"");
+ m_pie->write(" face=\"");
m_pie->write(pszFontFamily);
m_pie->write("\"");
}
if (pszFontSize)
{
- m_pie->write(" SIZE=\"");
+ m_pie->write(" size=\"");
char szSize[16];
_convertFontSize(szSize, pszFontSize);
m_pie->write(szSize);
@@ -547,56 +607,7 @@
(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("</s>"); // is it <s> or
<strike> ? 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("</u>");
- }
-
- q = strtok(NULL, " ");
- }
-
- free(p);
+ m_pie->write("</span>");
}
if (
@@ -763,9 +774,13 @@
m_pie->write("\n");
+ m_pie->write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
+\"DTD/xhtml1-strict.dtd\">\n");
m_pie->write("<html>\n");
m_pie->write("<head>\n");
m_pie->write("<title>AbiWord Document</title>\n");
+ m_pie->write("<style type=\"text/css\">\n");
+ m_pie->write("<!-- \n P.norm { margin-top: 0pt; margin-bottom: 0pt } \n
+-->\n");
+ m_pie->write("</style>\n");
m_pie->write("</head>\n");
m_pie->write("<body>\n");