rpms/abiword/FC-3 abiword-2.0.12.libwpd.patch,1.4,1.5

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Oct 17 11:54:28 UTC 2005


Author: caolanm

Update of /cvs/dist/rpms/abiword/FC-3
In directory cvs.devel.redhat.com:/tmp/cvs-serv25312

Modified Files:
	abiword-2.0.12.libwpd.patch 
Log Message:
try harder

abiword-2.0.12.libwpd.patch:
 abiword-2.0.12.hacked/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.cpp | 1061 +++++-----
 abiword-2.0.12.hacked/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.h   |  128 -
 abiword-2.0.12/abi/ac-helpers/abi-plugins.m4                                          |    2 
 abiword-2.0.12/abi/configure                                                          |   16 
 abiword-2.0.12/abiword-plugins/acinclude.m4                                           |    4 
 abiword-2.0.12/abiword-plugins/aclocal.m4                                             |    4 
 abiword-2.0.12/abiword-plugins/configure                                              |   16 
 abiword-2.0.12/abiword-plugins/wp/impexp/wordperfect/plugin.m4                        |    4 
 8 files changed, 641 insertions(+), 594 deletions(-)

Index: abiword-2.0.12.libwpd.patch
===================================================================
RCS file: /cvs/dist/rpms/abiword/FC-3/abiword-2.0.12.libwpd.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- abiword-2.0.12.libwpd.patch	17 Oct 2005 09:35:37 -0000	1.4
+++ abiword-2.0.12.libwpd.patch	17 Oct 2005 11:54:24 -0000	1.5
@@ -157,3 +157,1592 @@
  	abi_plugin_disable=yes
  ])
  if test $abi_plugin_disable = no; then
+diff -ruN abiword-2.0.12/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.cpp abiword-2.0.12.hacked/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.cpp
+--- abiword-2.0.12/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.cpp	2004-06-25 15:24:46.000000000 +0100
++++ abiword-2.0.12.hacked/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.cpp	2005-10-17 12:39:38.000000000 +0100
+@@ -1,7 +1,7 @@
+ /* AbiWord
+  * Copyright (C) 2001 AbiSource, Inc.
+  * Copyright (C) 2002-2004 Marc Maurer (j.m.maurer at student.utwente.nl)
+- * Copyright (C) 2002-2003 William Lachance (william.lachance at sympatico.ca)
++ * Copyright (C) 2002-2005 William Lachance (william.lachance at sympatico.ca)
+  * 
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+@@ -32,6 +32,7 @@
+ #include <gsf/gsf-utils.h>
+ #include <gsf/gsf-input-memory.h>
+ #include <gsf/gsf-input-stdio.h>
++#include <libwpd/GSFStream.h>
+ 
+ #include "ut_types.h"
+ #include "ut_string.h"
+@@ -60,44 +61,43 @@
+ // This should probably be defined in pt_Types.h
+ static const UT_uint32 PT_MAX_ATTRIBUTES = 8;
+ 
+-
+ ABI_ListDefinition::ABI_ListDefinition(int iOutlineHash) :
+-    m_iOutlineHash(iOutlineHash)
++	m_iOutlineHash(iOutlineHash)
+ {
+-    for(int i=0; i<WP6_NUM_LIST_LEVELS; i++) 
+-    {
++	for(int i=0; i<WP6_NUM_LIST_LEVELS; i++) 
++	{
+ 		m_iListIDs[i] = 0;
+ 		m_listTypes[i] = BULLETED_LIST;
+ 		m_iListNumbers[i] = 0;
+-    }
++	}
+ }
+ 
+-void ABI_ListDefinition::setListType(const int level, const WPXNumberingType type)
+-{
+-    switch (type)
+-    {
+-		case ARABIC:
+-			m_listTypes[level-1] = NUMBERED_LIST;
+-			break;
+-		case LOWERCASE:
+-			m_listTypes[level-1] = LOWERCASE_LIST;
+-			break;
+-		case UPPERCASE:
+-			m_listTypes[level-1] = UPPERCASE_LIST;
+-			break;
+-		case LOWERCASE_ROMAN:
+-			m_listTypes[level-1] = LOWERROMAN_LIST;
+-			break;
+-		case UPPERCASE_ROMAN:
+-			m_listTypes[level-1] = UPPERROMAN_LIST;
+-			break;
+-    }
++void ABI_ListDefinition::setListType(const int level, const char type)
++{	
++	switch (type)
++	{
++	case '1':
++		m_listTypes[level-1] = NUMBERED_LIST;
++		break;
++	case 'a':
++		m_listTypes[level-1] = LOWERCASE_LIST;
++		break;
++	case 'A':
++		m_listTypes[level-1] = UPPERCASE_LIST;
++		break;
++	case 'i':
++		m_listTypes[level-1] = LOWERROMAN_LIST;
++		break;
++	case 'I':
++		m_listTypes[level-1] = UPPERROMAN_LIST;
++		break;
++	}
+ }
+ 
+ #define X_CheckDocumentError(v) if (!v) { UT_DEBUGMSG(("X_CheckDocumentError: %d\n", __LINE__)); }
+ 
+ IE_Imp_WordPerfect_Sniffer::IE_Imp_WordPerfect_Sniffer()
+-    : IE_ImpSniffer(IE_MIME_WP_6)
++	: IE_ImpSniffer(IE_MIME_WP_6)
+ {
+ }
+ 
+@@ -108,9 +108,13 @@
+ UT_Confidence_t IE_Imp_WordPerfect_Sniffer::recognizeContents (const char * szBuf, 
+ 							       UT_uint32 iNumbytes)
+ {
+-	GsfInput * input = GSF_INPUT(gsf_input_memory_new(reinterpret_cast<const guint8*>(szBuf), iNumbytes, false));
+-	
+-	WPDConfidence confidence = WPDocument::isFileFormatSupported(input, true);
++	GsfInput * input = GSF_INPUT(gsf_input_memory_new(reinterpret_cast<const guint8*>(szBuf), iNumbytes, false));	
++	GSFInputStream gsfInput(input);
++
++	WPDConfidence confidence = WPDocument::isFileFormatSupported(&gsfInput, true);
++
++	g_object_unref(input);
++
+ 	switch (confidence)
+ 	{
+ 		case WPD_CONFIDENCE_NONE:
+@@ -132,27 +136,27 @@
+ 
+ UT_Confidence_t IE_Imp_WordPerfect_Sniffer::recognizeSuffix (const char * szSuffix)
+ {
+-    // We recognize both word documents and their template versions
+-    if (!UT_stricmp(szSuffix,".wpd") || !UT_stricmp(szSuffix, ".wp"))
++	// We recognize both word documents and their template versions
++	if (!UT_stricmp(szSuffix,".wpd") || !UT_stricmp(szSuffix, ".wp"))
+ 		return UT_CONFIDENCE_PERFECT;
+-    return UT_CONFIDENCE_ZILCH;
++	return UT_CONFIDENCE_ZILCH;
+ }
+ 
+ UT_Error IE_Imp_WordPerfect_Sniffer::constructImporter (PD_Document * pDocument,
+ 							IE_Imp ** ppie)
+ {
+-    *ppie = new IE_Imp_WordPerfect(pDocument);
+-    return UT_OK;
++	*ppie = new IE_Imp_WordPerfect(pDocument);
++	return UT_OK;
+ }
+ 
+ bool IE_Imp_WordPerfect_Sniffer::getDlgLabels  (const char ** pszDesc,
+ 						const char ** pszSuffixList,
+ 						IEFileType * ft)
+ {
+-    *pszDesc = "WordPerfect (.wpd, .wp)";
+-    *pszSuffixList = "*.wpd; *.wp";
+-    *ft = getFileType();
+-    return true;
++	*pszDesc = "WordPerfect (.wpd, .wp)";
++	*pszSuffixList = "*.wpd; *.wp";
++	*ft = getFileType();
++	return true;
+ }
+ 
+ /****************************************************************************/
+@@ -174,83 +178,99 @@
+ 	m_pCurrentListDefinition(NULL),
+ 	m_iCurrentListLevel(0),
+ 	m_bInCell(false),
++	m_iNumCoveredTableCellsInRow(0),
+ 	m_bHdrFtrOpenCount(0)
+ {
+ }
+ 
+ IE_Imp_WordPerfect::~IE_Imp_WordPerfect()
+ {
+-    //UT_HASH_PURGEDATA(ABI_ListDefinition *,&m_listStylesHash,delete); 
++	//UT_HASH_PURGEDATA(ABI_ListDefinition *,&m_listStylesHash,delete); 
+ }
+ 
+ UT_Error IE_Imp_WordPerfect::importFile(const char * szFilename)
+ {
+-    gsf_init ();
++	gsf_init ();
+ 
+-    GError *err;
+-    GsfInput * input;
+-    input = GSF_INPUT(gsf_input_stdio_new (szFilename, &err));
+-    if (input == NULL) 
+-    {
++	GError *err;
++	GsfInput * input;
++	input = GSF_INPUT(gsf_input_stdio_new (szFilename, &err));
++	if (input == NULL) 
++	{
+ 		g_return_val_if_fail (err != NULL, 1);
+ 		
+ 		g_warning ("'%s' error: %s", szFilename, err->message);
+ 		g_error_free (err);
+ 		return 1;
+-    }
+-	
+-	try
+-	{
+-		WPDocument::parse(input, static_cast<WPXHLListenerImpl *>(this));
+ 	}
+-	catch (FileException)
++
++	GSFInputStream gsfInput(input);
++	WPDResult error = WPDocument::parse(&gsfInput, static_cast<WPXHLListenerImpl *>(this));
++
++	gsf_shutdown();
++
++	if (error != WPD_OK)
+ 	{
+-		UT_DEBUGMSG(("AbiWordPerfect: ERROR: File Exception!\n"));
++		UT_DEBUGMSG(("AbiWordPerfect: ERROR: %i!\n", (int)error));
+ 		return UT_IE_IMPORTERROR;
+ 	}
+ 
+-    gsf_shutdown();
+-    
+-    return UT_OK;
++	return UT_OK;
+ }
+ 
+ void IE_Imp_WordPerfect::pasteFromBuffer (PD_DocumentRange *, 
+ 					  unsigned char *, unsigned int, const char *)
+ {
+-    // nada
++	// nada
+ }
+ 
+-void IE_Imp_WordPerfect::setDocumentMetaData(const UCSString &author, const UCSString &subject,
+- 					 const UCSString &publisher, const UCSString &category,
+- 					 const UCSString &keywords, const UCSString &language,
+- 					 const UCSString &abstract, const UCSString &descriptiveName,
+-					 const UCSString &descriptiveType)
+-{
+-    getDoc()->setMetaDataProp(PD_META_KEY_CREATOR, UT_String(UTF8String(author).getUTF8()));
+-    getDoc()->setMetaDataProp(PD_META_KEY_SUBJECT, UT_String(UTF8String(subject).getUTF8()));
+-    getDoc()->setMetaDataProp(PD_META_KEY_PUBLISHER, UT_String(UTF8String(publisher).getUTF8()));
+-    getDoc()->setMetaDataProp(PD_META_KEY_TYPE, UT_String(UTF8String(category).getUTF8()));
+-    getDoc()->setMetaDataProp(PD_META_KEY_KEYWORDS, UT_String(UTF8String(keywords).getUTF8()));
+-    getDoc()->setMetaDataProp(PD_META_KEY_LANGUAGE, UT_String(UTF8String(language).getUTF8()));
+-    getDoc()->setMetaDataProp(PD_META_KEY_DESCRIPTION, UT_String(UTF8String(abstract).getUTF8()));
++void IE_Imp_WordPerfect::setDocumentMetaData(const WPXPropertyList &propList)
++{
++	if (propList["dc:author"])
++		getDoc()->setMetaDataProp(PD_META_KEY_CREATOR, 
++			UT_UTF8String(propList["dc:author"]->getStr().cstr()));
++	if (propList["dc:subject"])
++		getDoc()->setMetaDataProp(PD_META_KEY_SUBJECT, 
++			UT_UTF8String(propList["dc:subject"]->getStr().cstr()));
++	if (propList["dc:publisher"])
++		getDoc()->setMetaDataProp(PD_META_KEY_PUBLISHER, 
++			UT_UTF8String(propList["dc:publisher"]->getStr().cstr()));
++	if (propList["dc:type"])
++		getDoc()->setMetaDataProp(PD_META_KEY_TYPE, 
++			UT_UTF8String(propList["dc:category"]->getStr().cstr()));
++	if (propList["libwpd:keywords"])
++		getDoc()->setMetaDataProp(PD_META_KEY_KEYWORDS, 
++			UT_UTF8String(propList["libwpd:keywords"]->getStr().cstr()));
++	if (propList["dc:language"])
++		getDoc()->setMetaDataProp(PD_META_KEY_LANGUAGE, 
++			UT_UTF8String(propList["dc:language"]->getStr().cstr()));
++	if (propList["libwpd:abstract"])
++		getDoc()->setMetaDataProp(PD_META_KEY_DESCRIPTION, 
++			UT_UTF8String(propList["libwpd:abstract"]->getStr().cstr()));
+ }
+ 
+ void IE_Imp_WordPerfect::startDocument()
+ {
+-    UT_DEBUGMSG(("AbiWordPerfect: startDocument\n"));
++	UT_DEBUGMSG(("AbiWordPerfect: startDocument\n"));
+ }
+ 
+ void IE_Imp_WordPerfect::endDocument()
+ {
+-    UT_DEBUGMSG(("AbiWordPerfect: endDocument\n"));
++	UT_DEBUGMSG(("AbiWordPerfect: endDocument\n"));
+ }
+ 
+-void IE_Imp_WordPerfect::openPageSpan(const int span, const bool isLastPageSpan,
+-				  const float marginLeft, const float marginRight,
+-				  const float marginTop, const float marginBottom)
++void IE_Imp_WordPerfect::openPageSpan(const WPXPropertyList &propList)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
++	UT_DEBUGMSG(("AbiWordPerfect: openPageSpan\n"));
+ 	
++	float marginLeft = 0.0f, marginRight = 0.0f;
++
++	if (propList["fo:margin-left"])
++		marginLeft = propList["fo:margin-left"]->getFloat();
++	if (propList["fo:margin-right"])
++		marginRight = propList["fo:margin-right"]->getFloat();
++
+ 	if (
+ 		marginLeft != m_leftMargin ||
+ 		marginRight != m_rightMargin //||
+@@ -266,8 +286,7 @@
+ 	}
+ }
+ 
+-void IE_Imp_WordPerfect::openHeaderFooter(const WPXHeaderFooterType headerFooterType, 
+-				  const WPXHeaderFooterOccurence headerFooterOccurence)
++void IE_Imp_WordPerfect::openHeader(const WPXPropertyList &propList)
+ {
+ 	m_bHdrFtrOpenCount++;
+ 	
+@@ -299,248 +318,416 @@
+ 	m_bInSection = true;
+ 	m_bSectionChanged = false;*/
+ }
+-				  
+-void IE_Imp_WordPerfect::closeHeaderFooter(const WPXHeaderFooterType headerFooterType, 
+-				  const WPXHeaderFooterOccurence headerFooterOccurence)
++
++void IE_Imp_WordPerfect::closeHeader()
+ {
+ 	m_bHdrFtrOpenCount--;
+ 	/*
+ 	TODO: THIS CODE IS NOT!!!! USEFULL! - DON'T TOUCH IT - MARCM
+ 	m_nextFreeId++;
+ 	*/
+-}		  
++}
+ 
+-void IE_Imp_WordPerfect::openParagraph(const guint8 paragraphJustification, const guint32 textAttributeBits,
+-				   const float marginLeftOffset, const float marginRightOffset,
+-				   const gchar *fontName, const float fontSize, 
+-				   const float lineSpacing, 
+-				   const bool isColumnBreak, const bool isPageBreak)
++void IE_Imp_WordPerfect::openFooter(const WPXPropertyList &propList)
+ {
+-	if (m_bHdrFtrOpenCount) return; // HACK
+-    UT_DEBUGMSG(("AbiWordPerfect: openParagraph(paragraphJustification: %d, textAttributeBits: %d)\n", paragraphJustification, textAttributeBits));
++	m_bHdrFtrOpenCount++;
++	// see above comments re: openHeader
++}
+ 
++void IE_Imp_WordPerfect::closeFooter()
++{
++	m_bHdrFtrOpenCount--;
++	// see above comments re: closeHeader
++}
++
++void IE_Imp_WordPerfect::openParagraph(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops)
++{
++	if (m_bHdrFtrOpenCount) return; // HACK
++	UT_DEBUGMSG(("AbiWordPerfect: openParagraph()\n"));
+ 	// for now, we always append these options
+-	m_leftMarginOffset = marginLeftOffset;
+-	m_rightMarginOffset = marginRightOffset;
++	float marginTop = 0.0f, marginBottom = 0.0f;
++	float marginLeft = 0.0f, marginRight = 0.0f, textIndent = 0.0f;
++	if (propList["fo:margin-top"])
++	    marginTop = propList["fo:margin-top"]->getFloat();
++	if (propList["fo:margin-bottom"])
++	    marginBottom = propList["fo:margin-bottom"]->getFloat();
++	if (propList["fo:margin-left"])
++	    marginLeft = propList["fo:margin-left"]->getFloat();
++	if (propList["fo:margin-right"])
++	    marginRight = propList["fo:margin-right"]->getFloat();
++	if (propList["fo:text-indent"])
++	    textIndent = propList["fo:text-indent"]->getFloat();
++
++	m_topMargin = marginTop;
++	m_bottomMargin = marginBottom;
++	m_leftMarginOffset = marginLeft;
++	m_rightMarginOffset = marginRight;
++	m_textIndent = textIndent;
+ 
+-	if (isPageBreak)
+-	{
+-		UT_UCS4Char ucs = UCS_FF;
+-		X_CheckDocumentError(appendSpan(&ucs,1));			
+-	}
+-	else if (isColumnBreak)
++	UT_String propBuffer;
++	propBuffer += "text-align:";
++	if (propList["fo:text-align"])
+ 	{
+-		UT_UCS4Char ucs = UCS_VTAB;
+-		X_CheckDocumentError(appendSpan(&ucs,1));
++		// AbiWord follows xsl:fo, except here, for some reason..
++		if (propList["fo:text-align"]->getStr() == "end")
++			propBuffer += "right";
++		else
++			propBuffer += propList["fo:text-align"]->getStr().cstr();
+ 	}
+ 	else
++		propBuffer += "left";
++
++	float lineSpacing = 1.0f;
++	if (propList["fo:line-height"])
++		lineSpacing = propList["fo:line-height"]->getFloat();
++	
++	UT_String tmpBuffer;
++	UT_String_sprintf(tmpBuffer, "; margin-top:%.4fin; margin-bottom:%.4fin; margin-left:%.4fin; margin-right:%.4fin; text-indent:%.4fin; line-height:%.4f",
++		m_topMargin, m_bottomMargin, m_leftMarginOffset, m_rightMarginOffset, m_textIndent, lineSpacing);
++	propBuffer += tmpBuffer;
++
++	UT_DEBUGMSG(("AbiWordPerfect: Appending paragraph properties: %s\n", propBuffer.c_str()));
++	const XML_Char* propsArray[3];
++	propsArray[0] = "props";
++	propsArray[1] = propBuffer.c_str();
++	propsArray[2] = NULL;
++	X_CheckDocumentError(appendStrux(PTX_Block, propsArray));
++
++	if (propList["fo:break-before"])
+ 	{
+-		_appendParagraph(paragraphJustification, textAttributeBits, fontName, fontSize, lineSpacing);
++		if (strcmp(propList["fo:break-before"]->getStr().cstr(), "page") == 0)
++		{
++			UT_UCS4Char ucs = UCS_FF;
++			X_CheckDocumentError(appendSpan(&ucs,1));			
++		}
++		else if (strcmp(propList["fo:break-before"]->getStr().cstr(), "column") == 0)
++		{
++			UT_UCS4Char ucs = UCS_VTAB;
++			X_CheckDocumentError(appendSpan(&ucs,1));
++		}
+ 	}
+ }
+ 
+-void IE_Imp_WordPerfect::openSpan(const guint32 textAttributeBits, const gchar *fontName, const float fontSize)
++void IE_Imp_WordPerfect::openSpan(const WPXPropertyList &propList)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-   UT_DEBUGMSG(("AbiWordPerfect: openSpan(textAttributeBits: %d)\n", textAttributeBits));
+-   
+-   _appendSpan(textAttributeBits, fontName, fontSize);
++	UT_DEBUGMSG(("AbiWordPerfect: Appending current text properties\n"));
++	
++	XML_Char* pProps = "props";
++	UT_String propBuffer;
++	UT_String tempBuffer;
++	
++	// bold
++	propBuffer += "font-weight:";
++	propBuffer += (propList["fo:font-weight"] ? propList["fo:font-weight"]->getStr().cstr() : "normal");
++	
++	// italic
++	propBuffer += "; font-style:";
++	propBuffer += (propList["fo:font-style"] ? propList["fo:font-style"]->getStr().cstr() : "normal");
++	
++	// superscript or subscript
++	if (propList["style:text-position"])
++	{
++		propBuffer += "; text-position:";
++		if (strncmp(propList["style:text-position"]->getStr().cstr(), "super", 5) == 0)
++			propBuffer += "superscript"; 
++		else 
++			propBuffer += "subscript";
++	}
++
++	if (propList["style:text-underline"] || propList["style:text-crossing-out"])
++	{
++		propBuffer += "; text-decoration:";
++		if (propList["style:text-underline"])
++			propBuffer += "underline ";
++		if (propList["style:text-crossing-out"])
++			propBuffer += "line-through";
++
++	}
++	
++	if (propList["style:font-name"])
++	{
++		propBuffer += "; font-family:";
++		propBuffer += propList["style:font-name"]->getStr().cstr();
++	}
++
++	// font face
++	if (propList["fo:font-size"])
++	{
++		propBuffer += "; font-size:";
++		propBuffer += propList["fo:font-size"]->getStr().cstr();
++	}
++
++	if (propList["fo:color"])
++	{
++		propBuffer += "; color:";
++		propBuffer += propList["fo:color"]->getStr().cstr();
++	}
++
++	if (propList["style:text-background-color"])
++	{
++		propBuffer += "; bgcolor:";
++		propBuffer += propList["style:text-background-color"]->getStr().cstr();
++	}
++
++	UT_DEBUGMSG(("AbiWordPerfect: Appending span format: %s\n", propBuffer.c_str()));
++	const XML_Char* propsArray[5];
++	
++	propsArray[0] = pProps;
++	propsArray[1] = propBuffer.c_str();
++	propsArray[2] = NULL;
++	X_CheckDocumentError(appendFmt(propsArray));
+ }
+ 
+-void IE_Imp_WordPerfect::openSection(const guint numColumns, const float spaceAfter)
++void IE_Imp_WordPerfect::openSection(const WPXPropertyList &propList, const WPXPropertyListVector &columns)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
++	UT_DEBUGMSG(("AbiWordPerfect: openSection\n"));
++
+ 	// TODO: support spaceAfter
++	if (propList["fo:margin-left"])
++		m_leftMargin = propList["fo:margin-left"]->getFloat();
++	if (propList["fo:margin-right"])
++		m_rightMargin = propList["fo:margin-right"]->getFloat();
+ 
+-	UT_DEBUGMSG(("AbiWordPerfect: openSection(numColumns: %d)\n", numColumns));
+-	
+-	_appendSection(numColumns, m_leftMargin, m_rightMargin);
++	_appendSection((columns.count() == 0) ? 1 : columns.count(), m_leftMargin, m_rightMargin); 
+ }
+ 
+ void IE_Imp_WordPerfect::insertTab()
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
++	UT_DEBUGMSG(("AbiWordPerfect: insertTab\n"));
++
+ 	UT_UCS4Char ucs = UCS_TAB;
+ 	X_CheckDocumentError(appendSpan(&ucs,1));	
+ }
+ 
+-void IE_Imp_WordPerfect::insertText(const UCSString &text)
++void IE_Imp_WordPerfect::insertText(const WPXString &text)
+ {
+-    if (m_bHdrFtrOpenCount) return; // HACK
+-    if (text.getLen())
+-    {
++	if (m_bHdrFtrOpenCount) return; // HACK
++	if (text.len())
++	{
+ 		UT_DEBUGMSG(("AbiWordPerfect: insertText\n"));
+-		X_CheckDocumentError(appendSpan(text.getUCS4(), text.getLen()));
+-    }
++		UT_UCS4String ucs4(text.cstr());
++		X_CheckDocumentError(appendSpan(ucs4.ucs4_str(), ucs4.length()));
++	}
+ }
+ 
+ void IE_Imp_WordPerfect::insertLineBreak()
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
++	UT_DEBUGMSG(("AbiWordPerfect: insertLineBreak\n"));
++
+ 	UT_UCSChar ucs = UCS_LF;
+ 	X_CheckDocumentError(appendSpan(&ucs,1));
+ }
+ 
+-void IE_Imp_WordPerfect::defineOrderedListLevel(const int listID, const guint16 level, const WPXNumberingType listType, 
+-						const UCSString &textBeforeNumber, const UCSString &textAfterNumber,
+-						const int startingNumber)
++
++
++void IE_Imp_WordPerfect::defineOrderedListLevel(const WPXPropertyList &propList)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-    UT_DEBUGMSG(("AbiWordPerfect: defineOrderedListLevel\n"));
+-    if (!m_pCurrentListDefinition || m_pCurrentListDefinition->getOutlineHash() != listID ||
+-	(m_pCurrentListDefinition->getLevelNumber(level) != (startingNumber - 1) && level==1))
+-    {
++	UT_DEBUGMSG(("AbiWordPerfect: defineOrderedListLevel\n"));
++
++	int listID = 0, startingNumber = 0, level = 1;
++	char listType = '1';
++	UT_UTF8String textBeforeNumber, textAfterNumber;
++	
++	if (propList["libwpd:id"])
++		listID = propList["libwpd:id"]->getInt();
++	if (propList["text:start-value"])
++		startingNumber = propList["text:start-value"]->getInt();
++	if (propList["libwpd:level"])
++		level = propList["libwpd:level"]->getInt();
++	if (propList["style:num-prefix"])
++		textBeforeNumber += propList["style:num-prefix"]->getStr().cstr();
++	if (propList["style:num-suffix"])
++		textAfterNumber += propList["style:num-suffix"]->getStr().cstr();
++	if (propList["style:num-format"])
++	{
++		listType = propList["style:num-format"]->getStr().cstr()[0];
++	}
++	if (!m_pCurrentListDefinition || 
++		m_pCurrentListDefinition->getOutlineHash() != listID ||
++		(m_pCurrentListDefinition->getLevelNumber(level) != startingNumber && 
++		 level == 1))
++	{
+ 		if (m_pCurrentListDefinition)
+ 			delete (m_pCurrentListDefinition);
+ 
+ 		m_pCurrentListDefinition = new ABI_ListDefinition(listID);
+-    }
+-
+-    if (!m_pCurrentListDefinition->getListID(level))
+-    {
+-		m_pCurrentListDefinition->setListID(level, UT_rand());
++	}
++	
++	if (!m_pCurrentListDefinition->getListID(level))
++	{
+ 		m_pCurrentListDefinition->setListType(level, listType);
++		m_pCurrentListDefinition->setListID(level, UT_rand());
+ 		_updateDocumentOrderedListDefinition(m_pCurrentListDefinition, level, listType, textBeforeNumber, textAfterNumber, startingNumber);
+-    }
+-
++	}
+ }
+ 
+-void IE_Imp_WordPerfect::defineUnorderedListLevel(const int listID, const guint16 level, const UCSString &bullet)
++void IE_Imp_WordPerfect::defineUnorderedListLevel(const WPXPropertyList &propList)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-    UT_DEBUGMSG(("AbiWordPerfect: defineUnorderedListLevel\n"));
+-    if (!m_pCurrentListDefinition || m_pCurrentListDefinition->getOutlineHash() != listID)
+-    {
++	UT_DEBUGMSG(("AbiWordPerfect: defineUnorderedListLevel\n"));
++
++	int listID = 0, level = 1;
++	WPXString textBeforeNumber, textAfterNumber;
++	if (propList["libwpd:id"])
++		listID = propList["libwpd:id"]->getInt();
++	if (propList["libwpd:level"])
++		level = propList["libwpd:level"]->getInt();
++
++	if (!m_pCurrentListDefinition || m_pCurrentListDefinition->getOutlineHash() != listID)
++	{
+ 		if (m_pCurrentListDefinition)
+ 			delete (m_pCurrentListDefinition);
+ 		
+ 		m_pCurrentListDefinition = new ABI_ListDefinition(listID);
+-    }
++	}
+ 
+-    if (!m_pCurrentListDefinition->getListID(level))
+-    {
++	if (!m_pCurrentListDefinition->getListID(level))
++	{
+ 		m_pCurrentListDefinition->setListID(level, UT_rand());
+ 		_updateDocumentUnorderedListDefinition(m_pCurrentListDefinition, level);
+-    }
+-
++	}
+ }
+ 
+-void IE_Imp_WordPerfect::openOrderedListLevel(const int listID)
++//void IE_Imp_WordPerfect::openOrderedListLevel(const int listID)
++void IE_Imp_WordPerfect::openOrderedListLevel(const WPXPropertyList &propList)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-    m_iCurrentListLevel++;
++	UT_DEBUGMSG(("AbiWordPerfect: openOrderedListLevel\n"));
++	
++	m_iCurrentListLevel++;
+ }
+ 
+ void IE_Imp_WordPerfect::closeOrderedListLevel()
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-    UT_DEBUGMSG(("AbiWordPerfect: closeOrderedListLevel (level: %i)\n", m_iCurrentListLevel));
+-    UT_ASSERT(m_iCurrentListLevel > 0); 
+-
+-    // every time we close a list level, the level above it is normally renumbered to start at "1"
+-    // again. this code takes care of that.
+-    if (m_iCurrentListLevel < (WP6_NUM_LIST_LEVELS-1))
+-	m_pCurrentListDefinition->setLevelNumber(m_iCurrentListLevel + 1, 0);
++	UT_DEBUGMSG(("AbiWordPerfect: closeOrderedListLevel (level: %i)\n", m_iCurrentListLevel));
++	UT_ASSERT(m_iCurrentListLevel > 0); 
++	
++	// every time we close a list level, the level above it is normally renumbered to start at "1"
++	// again. this code takes care of that.
++	if (m_iCurrentListLevel < (WP6_NUM_LIST_LEVELS-1))
++		m_pCurrentListDefinition->setLevelNumber(m_iCurrentListLevel + 1, 0);
++	
++	m_iCurrentListLevel--;
++}
+ 
+-    m_iCurrentListLevel--;
++void IE_Imp_WordPerfect::openUnorderedListLevel(const WPXPropertyList &propList)
++{
++	if (m_bHdrFtrOpenCount) return; // HACK
++	UT_DEBUGMSG(("AbiWordPerfect: openUNorderedListLevel\n"));
++	
++	m_iCurrentListLevel++;
+ }
+ 
++void IE_Imp_WordPerfect::closeUnorderedListLevel()
++{
++	if (m_bHdrFtrOpenCount) return; // HACK
++	UT_DEBUGMSG(("AbiWordPerfect: closeUnorderedListLevel (level: %i)\n", m_iCurrentListLevel));
++	UT_ASSERT(m_iCurrentListLevel > 0); 
++	
++	m_iCurrentListLevel--;
++}
+ 
+ // ASSUMPTION: We assume that unordered lists will always pass a number of "0". unpredictable behaviour
+ // may result otherwise
+-void IE_Imp_WordPerfect::openListElement(const guint8 paragraphJustification, const guint32 textAttributeBits,
+-									     const gchar *fontName, const float fontSize, 
+-									     const float lineSpacing)
++void IE_Imp_WordPerfect::openListElement(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-    UT_DEBUGMSG(("AbiWordPerfect: openListElement\n"));
+-
+-    UT_ASSERT(m_pCurrentListDefinition); // FIXME: ABI_LISTS_IMPORT throw an exception back to libwpd, if this fails
+-    
+-    // Paragraph properties for our list element
+-    UT_String szListID;
+-    UT_String szParentID;
+-    UT_String szLevel;
+-    UT_String_sprintf(szListID,"%d",m_pCurrentListDefinition->getListID(m_iCurrentListLevel));
+-    if (m_iCurrentListLevel > 1) 
++	UT_DEBUGMSG(("AbiWordPerfect: openListElement\n"));
++	
++	UT_ASSERT(m_pCurrentListDefinition); // FIXME: ABI_LISTS_IMPORT throw an exception back to libwpd, if this fails
++	
++	// Paragraph properties for our list element
++	UT_String szListID;
++	UT_String szParentID;
++	UT_String szLevel;
++	UT_String_sprintf(szListID,"%d",m_pCurrentListDefinition->getListID(m_iCurrentListLevel));
++	if (m_iCurrentListLevel > 1) 
+ 		UT_String_sprintf(szParentID,"%d", m_pCurrentListDefinition->getListID((m_iCurrentListLevel-1)));
+-    else
++	else
+ 		UT_String_sprintf(szParentID,"0"); 
+-    UT_String_sprintf(szLevel,"%d", m_iCurrentListLevel);
+- 
+-    const XML_Char* listAttribs[PT_MAX_ATTRIBUTES*2 + 1];
+-    UT_uint32 attribsCount=0;
+-    
+-    listAttribs[attribsCount++] = PT_LISTID_ATTRIBUTE_NAME;
+-    listAttribs[attribsCount++] = szListID.c_str();
+-    listAttribs[attribsCount++] = PT_PARENTID_ATTRIBUTE_NAME;
+-    listAttribs[attribsCount++] = szParentID.c_str();
+-    listAttribs[attribsCount++] = PT_LEVEL_ATTRIBUTE_NAME;
+-    listAttribs[attribsCount++] = szLevel.c_str();
+- 
+-    // Now handle the Abi List properties
+-    UT_String propBuffer;
+-    UT_String tempBuffer;
+-    UT_String_sprintf(tempBuffer,"list-style:%i;", m_pCurrentListDefinition->getListType(m_iCurrentListLevel));
+-    propBuffer += tempBuffer;
++	UT_String_sprintf(szLevel,"%d", m_iCurrentListLevel);
++	
++	const XML_Char* listAttribs[PT_MAX_ATTRIBUTES*2 + 1];
++	UT_uint32 attribsCount=0;
++	
++	listAttribs[attribsCount++] = PT_LISTID_ATTRIBUTE_NAME;
++	listAttribs[attribsCount++] = szListID.c_str();
++	listAttribs[attribsCount++] = PT_PARENTID_ATTRIBUTE_NAME;
++	listAttribs[attribsCount++] = szParentID.c_str();
++	listAttribs[attribsCount++] = PT_LEVEL_ATTRIBUTE_NAME;
++	listAttribs[attribsCount++] = szLevel.c_str();
++	
++	// Now handle the Abi List properties
++	UT_String propBuffer;
++	UT_String tempBuffer;
++	UT_String_sprintf(tempBuffer,"list-style:%i;", m_pCurrentListDefinition->getListType(m_iCurrentListLevel));
++	propBuffer += tempBuffer;
++
+ #if 0
+-    // FIXME: writing the list delimiter is kind of tricky and silly (because wordperfect wants to define
+-    // it within the document, while abi wants to (sensibly probably) define it in the list definition)
+-    // (we reset it each time but only for numbered lists)
+-    if (listDefinition->isLevelNumbered(m_iCurrentListLevel)) 
++	// FIXME: writing the list delimiter is kind of tricky and silly (because wordperfect wants to define
++	// it within the document, while abi wants to (sensibly probably) define it in the list definition)
++	// (we reset it each time but only for numbered lists)
++	if (listDefinition->isLevelNumbered(m_iCurrentListLevel)) 
+ 	{  
+ 		UT_DEBUGMSG(("WordPerfect: Appending this list delim: %s\n", m_rightListDelim.c_str()));
+ 		listDefinition->setListRightDelimText(m_iCurrentListLevel, m_rightListDelim.c_str());
+ 		X_CheckWordPerfectError(_updateDocumentListDefinition(listDefinition, m_iCurrentListLevel));
+-	}   
++	}
+ #endif
+-    if (m_pCurrentListDefinition->getListType(m_iCurrentListLevel) == BULLETED_LIST)
++
++	if (m_pCurrentListDefinition->getListType(m_iCurrentListLevel) == BULLETED_LIST)
+ 		UT_String_sprintf(tempBuffer, "field-font:Symbol; ");
+-    else
++	else
+ 		UT_String_sprintf(tempBuffer, "field-font:NULL; ");
+-
+-    m_pCurrentListDefinition->incrementLevelNumber(m_iCurrentListLevel);
+-
+-    propBuffer += tempBuffer;
+-    UT_String_sprintf(tempBuffer, "start-value:%i; ", 1);
+-    propBuffer += tempBuffer;
+-    UT_String_sprintf(tempBuffer, "text-indent:%fin; ", WP_PARAGRAPH_STYLE_TEXT_INDENT_DECREMENT);
+-    propBuffer += tempBuffer;
+-    UT_String_sprintf(tempBuffer, "margin-left:%fin", WP_PARAGRAPH_STYLE_MARGIN_LEFT_INCREMENT*m_iCurrentListLevel);
+-    propBuffer += tempBuffer;
+-    listAttribs[attribsCount++] = PT_PROPS_ATTRIBUTE_NAME;
+-    listAttribs[attribsCount++] = propBuffer.c_str();
+-    listAttribs[attribsCount++] = NULL;
+-  
+-    X_CheckDocumentError(appendStrux(PTX_Block, listAttribs));
+-
+-    // hang text off of a list label
+-    _appendListSpan(UT_rand()); 
+-    getDoc()->appendFmtMark();
+-    UT_DEBUGMSG(("WordPerfect: LISTS - Appended a list tag def'n (character props)\n"));
+-    
+-    // append a list field label
+-    const XML_Char* fielddef[3];
+-    fielddef[0] ="type";
+-    fielddef[1] = "list_label";
+-    fielddef[2] = NULL;
+-    X_CheckDocumentError(appendObject(PTO_Field,fielddef));
+-    UT_DEBUGMSG(("WordPerfect: LISTS - Appended a field def'n\n"));
+-    
+-    // insert span props
+-    _appendSpan(0, "Times New Roman", 12.0f); 
+-
+-    // insert a tab
+-    UT_UCS4Char ucs = UCS_TAB;
+-    X_CheckDocumentError(appendSpan(&ucs,1));
+-
++	
++	m_pCurrentListDefinition->incrementLevelNumber(m_iCurrentListLevel);
++	
++	propBuffer += tempBuffer;
++	UT_String_sprintf(tempBuffer, "start-value:%i; ", 1);
++	propBuffer += tempBuffer;
++	if (propList["fo:text-indent"])
++	{
++		UT_String_sprintf(tempBuffer, "text-indent:%s; ", propList["fo:text-indent"]->getStr().cstr());
++		propBuffer += tempBuffer;
++	}
++	if (propList["fo:margin-left"])
++	{
++		UT_String_sprintf(tempBuffer, "margin-left:%s", propList["fo:margin-left"]->getStr().cstr());
++		propBuffer += tempBuffer;
++	}
++	listAttribs[attribsCount++] = PT_PROPS_ATTRIBUTE_NAME;
++	listAttribs[attribsCount++] = propBuffer.c_str();
++	listAttribs[attribsCount++] = NULL;
++	
++	X_CheckDocumentError(appendStrux(PTX_Block, listAttribs));
++	
++	// hang text off of a list label
++	getDoc()->appendFmtMark();
++	UT_DEBUGMSG(("WordPerfect: LISTS - Appended a list tag def'n (character props)\n"));
++	
++	// append a list field label
++	const XML_Char* fielddef[5];
++	fielddef[0] ="type";
++	fielddef[1] = "list_label";
++	fielddef[2] = NULL;
++	X_CheckDocumentError(appendObject(PTO_Field,fielddef));
++	UT_DEBUGMSG(("WordPerfect: LISTS - Appended a field def'n\n"));
++	
++	// insert a tab
++	UT_UCS4Char ucs = UCS_TAB;
++	X_CheckDocumentError(appendSpan(&ucs,1));
+ }
+ 
+-void IE_Imp_WordPerfect::openFootnote(int number)
++void IE_Imp_WordPerfect::openFootnote(const WPXPropertyList &propList)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-	UT_DEBUGMSG(("AbiWordPerfect: openFootnote(number: %d)\n", number));
+-	
++
+ 	const XML_Char** propsArray = NULL;
+ 	
+ 	UT_String footnoteId;
+@@ -575,16 +762,12 @@
+ void IE_Imp_WordPerfect::closeFootnote()
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-	UT_DEBUGMSG(("AbiWordPerfect: closeFootnote\n"));
+-	
+ 	X_CheckDocumentError(appendStrux(PTX_EndFootnote,NULL));
+ }
+ 
+-void IE_Imp_WordPerfect::openEndnote(int number)
++void IE_Imp_WordPerfect::openEndnote(const WPXPropertyList &propList)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-	UT_DEBUGMSG(("AbiWordPerfect: openEndnote(number: %d)\n", number));	
+-	
+ 	const XML_Char** propsArray = NULL;
+ 	
+ 	UT_String endnoteId;
+@@ -619,142 +802,118 @@
+ void IE_Imp_WordPerfect::closeEndnote()
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-	UT_DEBUGMSG(("AbiWordPerfect: closeEndnote\n"));
+-	
+ 	X_CheckDocumentError(appendStrux(PTX_EndEndnote,NULL));
+ }
+ 
+-void IE_Imp_WordPerfect::openTable(const guint8 tablePositionBits, 
+-			       const float marginLeftOffset, const float marginRightOffset,
+-			       const float leftOffset, const vector < WPXColumnDefinition > &columns)
++void IE_Imp_WordPerfect::openTable(const WPXPropertyList &propList, const WPXPropertyListVector &columns)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+ 	// TODO: handle 'marginLeftOffset' and 'marginRightOffset'
++	UT_DEBUGMSG(("AbiWordPerfect: openTable\n"));
+ 	
+-    UT_DEBUGMSG(("AbiWordPerfect: openTable\n"));
+-    
+-    UT_String propBuffer;
++	UT_String propBuffer;
+ 
+-	if (tablePositionBits & WPX_TABLE_POSITION_ALIGN_WITH_LEFT_MARGIN)
+-	{
+-		// we don't need to do anything here: this is the default behavior
+-	}
+-	else if (tablePositionBits & WPX_TABLE_POSITION_ALIGN_WITH_RIGHT_MARGIN)
++	if (propList["table:align"])
+ 	{
++		// no need to support left: default behaviour
++
++		//if (strcmp(propList["table:align"]->getStr().cstr(), "right"))
+ 		// abiword does not support this I think
+-	}
+-	else if (tablePositionBits & WPX_TABLE_POSITION_CENTER_BETWEEN_MARGINS)
+-	{
++		//if (strcmp(propList["table:align"]->getStr().cstr(), "center"))
+ 		// abiword does not support this I think
+-	}
+-	else if (tablePositionBits & WPX_TABLE_POSITION_FULL)
+-	{
+-		// TODO: implement me
+-	}
+-	else if (tablePositionBits & WPX_TABLE_POSITION_ABSOLUTE_FROM_LEFT_MARGIN)
+-	{
+-		UT_String_sprintf(propBuffer, "table-column-leftpos:%.4fin; ", leftOffset);
+-	}
+-	else
+-	{
+-		//UT_ASSERT( SHOULD_NOT_HAPPEN );
++		//if (strcmp(propList["table:align"]->getStr().cstr(), "margins"))
++		// abiword does not support this I think
++		if (strcmp(propList["table:align"]->getStr().cstr(), "margins"))
++		{
++			if (propList["fo:margin-left"])
++				UT_String_sprintf(propBuffer, "table-column-leftpos:%s; ", propList["fo:margin-left"]->getStr().cstr());
++		}
+ 	}
+ 	
+ 	propBuffer += "table-column-props:";
+-	for (UT_uint32 i=0; i<columns.size(); i++)
++	WPXPropertyListVector::Iter i(columns);
++	for (i.rewind(); i.next();)
+ 	{
+ 		UT_String tmpBuffer;
+-		UT_String_sprintf(tmpBuffer, "%.4fin/", columns[i].m_width);
++		if (i()["style:column-width"])
++			UT_String_sprintf(tmpBuffer, "%s/", i()["style:column-width"]->getStr().cstr());
+ 		propBuffer += tmpBuffer;
+-	}	
+-	
++	}
++
+ 	const XML_Char* propsArray[3];
+ 	propsArray[0] = "props";
+ 	propsArray[1] = propBuffer.c_str();
+ 	propsArray[2] = NULL;
+-	
+-    X_CheckDocumentError(appendStrux(PTX_SectionTable, propsArray));
++
++	X_CheckDocumentError(appendStrux(PTX_SectionTable, propsArray));
+ }
+ 
+-void IE_Imp_WordPerfect::openTableRow()
++void IE_Imp_WordPerfect::openTableRow(const WPXPropertyList &propList)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-    UT_DEBUGMSG(("AbiWordPerfect: openRow\n"));
+-    if (m_bInCell)
+-    {		
++	UT_DEBUGMSG(("AbiWordPerfect: openRow\n"));
++	if (m_bInCell)
++	{		
+ 		X_CheckDocumentError(appendStrux(PTX_EndCell, NULL));
+-    }
+-    
+-    m_bInCell = false;
++	}
++	
++	m_bInCell = false;
++	m_iNumCoveredTableCellsInRow = 0;
+ }
+ 
+-void IE_Imp_WordPerfect::openTableCell(const guint32 col, const guint32 row, const guint32 colSpan, const guint32 rowSpan,
+-									const guint8 borderBits,
+-									const RGBSColor * cellFgColor, const RGBSColor * cellBgColor)
++void IE_Imp_WordPerfect::openTableCell(const WPXPropertyList &propList)
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-    UT_DEBUGMSG(("AbiWordPerfect: openCell(col: %d, row: %d, colSpan: %d, rowSpan: %d\n", col, row, colSpan, rowSpan));
+-    if (m_bInCell)
+-    {		
++	int col =0,  row = 0, colSpan = 0, rowSpan = 0;
++	if (propList["libwpd:column"])
++		col = propList["libwpd:column"]->getInt();
++	if (propList["libwpd:row"])
++		row = propList["libwpd:row"]->getInt();
++	if (propList["table:number-columns-spanned"])
++		colSpan = propList["table:number-columns-spanned"]->getInt();
++	if (propList["table:number-rows-spanned"])
++		rowSpan = propList["table:number-rows-spanned"]->getInt();
++
++	UT_DEBUGMSG(("AbiWordPerfect: openCell(col: %d, row: %d, colSpan: %d, rowSpan: %d\n", col, row, colSpan, rowSpan));
++	if (m_bInCell)
++	{
+ 		X_CheckDocumentError(appendStrux(PTX_EndCell, NULL));
+-    }
++	}
+ 	
+ 	UT_String propBuffer;
+-	UT_String_sprintf(propBuffer, "left-attach:%d; right-attach:%d; top-attach:%d; bot-attach:%d", col, col+colSpan, row, row+rowSpan);
++	UT_String_sprintf(propBuffer, "left-attach:%d; right-attach:%d; top-attach:%d; bot-attach:%d",
++					col+m_iNumCoveredTableCellsInRow, col+m_iNumCoveredTableCellsInRow+colSpan, row, row+rowSpan);
+ 	
+ 	UT_String borderStyle;
+ 	// we only support bg-style:1 for now
++	bool borderLeftSolid = false;
++	bool borderRightSolid = false;
++	bool borderTopSolid = false;
++	bool borderBottomSolid = false;
++	if (propList["fo:border-left"])
++		borderLeftSolid = strncmp(propList["fo:border-left"]->getStr().cstr(), "0.0inch", 7);
++	if (propList["fo:border-right"])
++		borderRightSolid = strncmp(propList["fo:border-right"]->getStr().cstr(), "0.0inch", 7);
++	if (propList["fo:border-top"])
++		borderTopSolid = strncmp(propList["fo:border-top"]->getStr().cstr(), "0.0inch", 7);
++	if (propList["fo:border-bottom"])
++		borderBottomSolid = strncmp(propList["fo:border-bottom"]->getStr().cstr(), "0.0inch", 7);
++
+ 	UT_String_sprintf(borderStyle, "; left-style:%s; right-style:%s; top-style:%s; bot-style:%s", 
+-				(borderBits & WPX_TABLE_CELL_LEFT_BORDER_OFF ? "none" : "solid"),
+- 				(borderBits & WPX_TABLE_CELL_RIGHT_BORDER_OFF ? "none" : "solid"), 
+-				(borderBits & WPX_TABLE_CELL_TOP_BORDER_OFF ? "none" : "solid"), 
+-				(borderBits & WPX_TABLE_CELL_BOTTOM_BORDER_OFF ? "none" : "solid"));
++					  (borderLeftSolid ? "solid" : "none"),
++					  (borderRightSolid ? "solid" : "none"), 
++					  (borderTopSolid ? "solid" : "none"), 
++					  (borderBottomSolid ? "solid" : "none"));
+ 	propBuffer += borderStyle;
+-
+-	/* CODE COPIED FROM WPD2SXW */
+-	UT_String bgCol;
+-	RGBSColor m_fgColor;
+-	RGBSColor m_bgColor;
+-	
+-	if (cellFgColor != NULL)
+-	{
+-		m_fgColor.m_r = cellFgColor->m_r;
+-		m_fgColor.m_g = cellFgColor->m_g;
+-		m_fgColor.m_b = cellFgColor->m_b;
+-		m_fgColor.m_s = cellFgColor->m_s;
+-	}
+-	else
+-	{
+-		m_fgColor.m_r = m_fgColor.m_g = m_fgColor.m_b = 0xFF;
+-		m_fgColor.m_s = 0x64; // 100%
+-	}
+-	if (cellBgColor != NULL)
+-	{
+-		m_bgColor.m_r = cellBgColor->m_r;
+-		m_bgColor.m_g = cellBgColor->m_g;
+-		m_bgColor.m_b = cellBgColor->m_b;
+-		m_bgColor.m_s = cellBgColor->m_s;
+-	}
+-	else
++		
++	// we only support bg-style:1 for now
++	if (propList["fo:background-color"])
+ 	{
+-		m_bgColor.m_r = m_bgColor.m_g = m_bgColor.m_b = 0xFF;
+-		m_bgColor.m_s = 0x64; // 100%
++		UT_String bgCol;
++		UT_String_sprintf(bgCol, "; bg-style:1; background-color:%s", &(propList["fo:background-color"]->getStr().cstr()[1]));
++		propBuffer += bgCol;
+ 	}
+ 	
+-	float fgAmount = (float)m_fgColor.m_s/100.0f;
+-	float bgAmount = max(((float)m_bgColor.m_s-(float)m_fgColor.m_s)/100.0f, 0.0f);
+-	int bgRed = min((int)(((float)m_fgColor.m_r*fgAmount)+((float)m_bgColor.m_r*bgAmount)), 255);
+-	int bgGreen = min((int)(((float)m_fgColor.m_g*fgAmount)+((float)m_bgColor.m_g*bgAmount)), 255);
+-	int bgBlue = min((int)(((float)m_fgColor.m_b*fgAmount)+((float)m_bgColor.m_b*bgAmount)), 255);
+-	/* END CODE COPIED FROM WPD2SXW */
+-	
+-	// we only support bg-style:1 for now
+-	UT_String_sprintf(bgCol, "; bg-style:1; background-color:%02x%02x%02x", bgRed, bgGreen, bgBlue);
+-	propBuffer += bgCol;
+-	
+-	// TODO: Handle the Cell Background Color here, but I don't think AbiWord supports that
+-	// ...
+-	
+ 	UT_DEBUGMSG(("AbiWordPerfect: Inserting a Cell definition: %s\n", propBuffer.c_str()));
+ 	
+ 	const XML_Char* propsArray[3];
+@@ -764,17 +923,20 @@
+ 	
+ 	X_CheckDocumentError(appendStrux(PTX_SectionCell, propsArray));
+ 	m_bInCell = true;
++	m_iNumCoveredTableCellsInRow += colSpan-1;
+ }
+ 
+ void IE_Imp_WordPerfect::closeTable()
+ {
+ 	if (m_bHdrFtrOpenCount) return; // HACK
+-    if (m_bInCell)
+-    {
++	UT_DEBUGMSG(("AbiWordPerfect: Closing table\n"));
++	
++	if (m_bInCell)
++	{
+ 		X_CheckDocumentError(appendStrux(PTX_EndCell, NULL));
+-    }
+-    X_CheckDocumentError(appendStrux(PTX_EndTable, NULL));
+-    m_bInCell = false;
++	}
++	X_CheckDocumentError(appendStrux(PTX_EndTable, NULL));
++	m_bInCell = false;
+ 	
+ 	// we need to open a new paragraph after a table, since libwpd does NOT do it
+ 	// FIXME: NEED TO PASS THE CURRENT PROPERTIES INSTEAD OF NULL
+@@ -782,136 +944,21 @@
+ 	X_CheckDocumentError(appendStrux(PTX_Block, NULL));
+ }
+ 
+-UT_Error IE_Imp_WordPerfect::_appendSpan(const guint32 textAttributeBits, const gchar *fontName, const float fontSize, UT_uint32 listTag)
++UT_Error IE_Imp_WordPerfect::_appendSection(int numColumns, const float marginLeft, const float marginRight)
+ {
+-    UT_DEBUGMSG(("AbiWordPerfect: Appending current text properties\n"));
+-    
+-    XML_Char* pProps = "props";
+-    UT_String propBuffer;
+-    UT_String tempBuffer;
+-    
+-    // bold
+-    propBuffer += "font-weight:";
+-    propBuffer += (textAttributeBits & WPX_BOLD_BIT ? "bold" : "normal");
+-    
+-    // italic
+-    propBuffer += "; font-style:";
+-    propBuffer += (textAttributeBits & WPX_ITALICS_BIT ? "italic" : "normal");
+-    
+-    // superscript or subscript
+-    if ((textAttributeBits & WPX_SUPERSCRIPT_BIT) || (textAttributeBits & WPX_SUBSCRIPT_BIT))
+-    {
+-		propBuffer += "; text-position:";
+-		propBuffer += (textAttributeBits & WPX_SUPERSCRIPT_BIT ? "superscript" : "subscript");
+-    }
+-    
+-	// underline & strike-out
+-    if ((textAttributeBits & WPX_UNDERLINE_BIT) || (textAttributeBits & WPX_STRIKEOUT_BIT))
+-    {
+-		propBuffer += "; text-decoration:";
+-		propBuffer += (textAttributeBits & WPX_UNDERLINE_BIT ? "underline" : "line-through");
+-    }
+-    
+-    // font face
+-    if (fontName != NULL)
+-    {
+-		propBuffer += "; font-family:";
+-		propBuffer += fontName;
+-    }
+-    
+-    // font face
+-    UT_String_sprintf(tempBuffer, "; font-size:%.3fpt", fontSize);
+-    propBuffer += tempBuffer;
+-
+-    UT_DEBUGMSG(("AbiWordPerfect: Appending span format: %s\n", propBuffer.c_str()));
+-    const XML_Char* propsArray[5];
+-    
+-    propsArray[0] = pProps;
+-    propsArray[1] = propBuffer.c_str();
+-    propsArray[2] = NULL;
+-// FIXME: remove this?
+-#if 0
+-    if (listTag) 
+-    {
+-		propsArray[2] ="type";
+-		propsArray[3] = "list_label";
+-		propsArray[4] = NULL;
+-    }
+-#endif
+-    X_CheckDocumentError(appendFmt(propsArray));
+-    return UT_OK;
+-}
+-
+-UT_Error IE_Imp_WordPerfect::_appendListSpan(UT_uint32 listTag)
+-{
+-    // List Tag to hang lists off
+-    XML_Char* pProps = "props";
+-    UT_String propBuffer;
+-    UT_String_sprintf(propBuffer, "list-tag:%d", listTag);
+-    const XML_Char* propsArray[3];
+-    
+-    propsArray[0] = pProps;
+-    propsArray[1] = propBuffer.c_str();
+-    propsArray[2] = NULL;
+-
+-    X_CheckDocumentError(appendFmt(propsArray));
+-
+-    return UT_OK;
+-}
+-
+-UT_Error IE_Imp_WordPerfect::_appendParagraph(const guint8 paragraphJustification, const guint32 textAttributeBits,
+-					      const gchar *fontName, const float fontSize, const float lineSpacing)
+-{
+-    UT_String propBuffer;
+-    
+-    propBuffer += "text-align:";
+-    switch (paragraphJustification)
+-    {
+-		case WPX_PARAGRAPH_JUSTIFICATION_LEFT:
+-			propBuffer += "left";
+-			break;
+-		case WPX_PARAGRAPH_JUSTIFICATION_RIGHT:
+-			propBuffer += "right";
+-			break;
+-		case WPX_PARAGRAPH_JUSTIFICATION_CENTER:
+-			propBuffer += "center";
+-			break;
+-		case WPX_PARAGRAPH_JUSTIFICATION_FULL:
+-			propBuffer += "justify";
+-			break;
+-    }
++	UT_DEBUGMSG(("AbiWordPerfect: Appending section\n"));
++	
++	UT_String myProps("") ;
++	setlocale(LC_NUMERIC, "C");
++	myProps += UT_String_sprintf("columns:%d; page-margin-left:%.4fin; page-margin-right:%.4fin", numColumns, marginLeft, marginRight);
++	setlocale(LC_NUMERIC, NULL);
++	
++	XML_Char * propsArray[3];
++	propsArray[0] = "props";
++	propsArray[1] = const_cast<XML_Char*>(reinterpret_cast<const XML_Char*>(myProps.c_str()));
++	propsArray[2] = NULL ;
++	X_CheckDocumentError(appendStrux(PTX_Section, (const XML_Char**)propsArray));
+ 	
+-	UT_String tmpBuffer;
+-	UT_String_sprintf(tmpBuffer, "; margin-left:%.4fin; margin-right:%.4fin; line-height:%.4f", m_leftMarginOffset, m_rightMarginOffset, lineSpacing);
+-	propBuffer += tmpBuffer;
+-    
+-    UT_DEBUGMSG(("AbiWordPerfect: Appending paragraph properties: %s\n", propBuffer.c_str()));
+-    const XML_Char* propsArray[3];
+-    propsArray[0] = "props";
+-    propsArray[1] = propBuffer.c_str();
+-    propsArray[2] = NULL;
+-    X_CheckDocumentError(appendStrux(PTX_Block, propsArray));
+-    
+-    _appendSpan(textAttributeBits, fontName, fontSize);
+-    
+-    return UT_OK;
+-}
+-
+-UT_Error IE_Imp_WordPerfect::_appendSection(guint numColumns, const float marginLeft, const float marginRight)
+-{
+-    UT_DEBUGMSG(("AbiWordPerfect: Appending section\n"));
+-    
+-    UT_String myProps("") ;
+-    setlocale(LC_NUMERIC, "C");
+-    myProps += UT_String_sprintf("columns:%d; page-margin-left:%.4fin; page-margin-right:%.4fin", numColumns, marginLeft, marginRight);
+-    setlocale(LC_NUMERIC, NULL);
+-    
+-    XML_Char * propsArray[3];
+-    propsArray[0] = "props";
+-    propsArray[1] = const_cast<XML_Char*>(reinterpret_cast<const XML_Char*>(myProps.c_str()));
+-    propsArray[2] = NULL ;
+-    X_CheckDocumentError(appendStrux(PTX_Section, (const XML_Char**)propsArray));
+-   
+ 	m_bInSection = true;
+ 	
+ 	m_leftMargin = marginLeft;
+@@ -919,7 +966,7 @@
+ 	
+ 	m_bSectionChanged = false;
+ 	
+-    return UT_OK;
++	return UT_OK;
+ }
+ 
+ // NB: AbiWord-2.0 doesn't properly support nested lists with different nested styles: only "1" style
+@@ -927,73 +974,83 @@
+ // NB: AbiWord-2.0 doesn't properly support setting list delimeters at levels greater than 1,
+ // we hack around this by using only "plain" (e.g.: NULL) list delimeters on levels greater than 1.
+ UT_Error IE_Imp_WordPerfect::_updateDocumentOrderedListDefinition(ABI_ListDefinition *pListDefinition, int iLevel, 
+-								  const WPXNumberingType listType, 
+-								  const UCSString &sTextBeforeNumber, 
+-								  const UCSString &sTextAfterNumber, int iStartingNumber)
+-{  
+-    UT_DEBUGMSG(("AbiWordPerfect: Updating document list definition (iLevel: %i)\n", iLevel));
+-
+-    // finally, set the document's list identification info..
+-    fl_AutoNum * pAuto = getDoc()->getListByID(pListDefinition->getListID(iLevel));
+-    // not in document yet, we should create a list for it
+-    if (pAuto == NULL) 
+-    {	
++																  const char listType, const UT_UTF8String &sTextBeforeNumber, 
++																  const UT_UTF8String &sTextAfterNumber, int iStartingNumber)
++{
++	UT_DEBUGMSG(("AbiWordPerfect: Updating document list definition (iLevel: %i)\n", iLevel));
++
++	if (iLevel > 1)
++	UT_DEBUGMSG(("WLACH: Parent's list id is.. %i\n", pListDefinition->getListID((iLevel-1))));
++
++	// finally, set the document's list identification info..
++	fl_AutoNum * pAuto = getDoc()->getListByID(pListDefinition->getListID(iLevel));
++	// not in document yet, we should create a list for it
++	if (pAuto == NULL) 
++	{	
+ 		UT_DEBUGMSG(("AbiWordPerfect: pAuto is NULL: creating a list\n", iLevel));
+ 		if (iLevel > 1) 
+ 		{	
+-			pAuto = new fl_AutoNum(pListDefinition->getListID(iLevel), pListDefinition->getListID((iLevel-1)), pListDefinition->getListType(1), iStartingNumber, const_cast<XML_Char*>(reinterpret_cast<const XML_Char*>("%L")), ".", getDoc());
++			pAuto = new fl_AutoNum(pListDefinition->getListID(iLevel), 
++								   pListDefinition->getListID((iLevel-1)), 
++								   pListDefinition->getListType(1), 
++								   iStartingNumber, 
++								   const_cast<XML_Char*>(reinterpret_cast<const XML_Char*>("%L")), 
++								   ".", 
++								   getDoc());
+ 		}   
+ 		else 
+ 		{
+-			UT_UCS4String sNumberingString;
+-			UT_UCS4String sNumber("%L", 0, false);
+-			sNumberingString += sTextBeforeNumber.getUCS4();
++			UT_UTF8String sNumberingString;
++			UT_UTF8String sNumber("%L", (size_t)0);
++			
++			sNumberingString += sTextBeforeNumber;
+ 			sNumberingString += sNumber;
+-			sNumberingString += sTextAfterNumber.getUCS4();
++			sNumberingString += sTextAfterNumber;
+ 	
+ 			pAuto = new fl_AutoNum(pListDefinition->getListID(iLevel), 0, pListDefinition->getListType(iLevel), iStartingNumber, 
+-					   const_cast<XML_Char*>(reinterpret_cast<const XML_Char*>(sNumberingString.utf8_str())), ".", getDoc());
++								   const_cast<XML_Char*>(reinterpret_cast<const XML_Char*>(sNumberingString.utf8_str())), ".", getDoc());
+ 		}
+ 		getDoc()->addList(pAuto);
+-    }
+-    // we should update what we have
+-    else 
+-    {
++	}
++	// we should update what we have
++	else 
++	{
+ 		UT_DEBUGMSG(("AbiWordPerfect: pAuto already exists\n", iLevel));
+-    }
+-	  
+-    pAuto->fixHierarchy();
+-	  
+-    return UT_OK;
++	}
++
++	pAuto->fixHierarchy();
++
++	return UT_OK;
+ }
+ 
+ UT_Error IE_Imp_WordPerfect::_updateDocumentUnorderedListDefinition(ABI_ListDefinition *pListDefinition, int iLevel)
+-{  
+-    UT_DEBUGMSG(("AbiWordPerfect: Updating document list definition (iLevel: %i)\n", iLevel));
+-
+-    // finally, set the document's list identification info..
+-    fl_AutoNum * pAuto = getDoc()->getListByID(pListDefinition->getListID(iLevel));
+-    // not in document yet, we should create a list for it
+-    if (pAuto == NULL) 
+-    {	
++{
++	UT_DEBUGMSG(("AbiWordPerfect: Updating document list definition (iLevel: %i)\n", iLevel));
++	
++	// finally, set the document's list identification info..
++	fl_AutoNum * pAuto = getDoc()->getListByID(pListDefinition->getListID(iLevel));
++	// not in document yet, we should create a list for it
++	if (pAuto == NULL) 
++	{	
+ 		UT_DEBUGMSG(("AbiWordPerfect: pAuto is NULL: creating a list\n", iLevel));
+ 		if (iLevel > 1) 
+ 		{	
+ 			pAuto = new fl_AutoNum(pListDefinition->getListID(iLevel), pListDefinition->getListID((iLevel-1)), 
+-					   pListDefinition->getListType(1), 0, (XML_Char *)"%L", ".", getDoc());
++								   pListDefinition->getListType(1), 0, const_cast<XML_Char*>(reinterpret_cast<const XML_Char*>("%L")), ".", getDoc());
+ 		}   
+ 		else
+-			pAuto = new fl_AutoNum(pListDefinition->getListID(iLevel), 0, pListDefinition->getListType(iLevel), 0, (XML_Char *)"%L", ".", getDoc());
++			pAuto = new fl_AutoNum(pListDefinition->getListID(iLevel), 0, pListDefinition->getListType(iLevel), 0, 
++								   const_cast<XML_Char*>(reinterpret_cast<const XML_Char*>("%L")), ".", getDoc());
+ 		  
+ 		getDoc()->addList(pAuto);
+-    }
+-    // we should update what we have
+-    else 
+-    {	
++	}
++	// we should update what we have
++	else 
++	{	
+ 		UT_DEBUGMSG(("AbiWordPerfect: pAuto already exists\n", iLevel));
+-    }
+-	  
+-    pAuto->fixHierarchy();
+-	  
+-    return UT_OK;
++	}
++
++	pAuto->fixHierarchy();
++
++	return UT_OK;
+ }
+diff -ruN abiword-2.0.12/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.h abiword-2.0.12.hacked/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.h
+--- abiword-2.0.12/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.h	2004-03-11 15:37:03.000000000 +0000
++++ abiword-2.0.12.hacked/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.h	2005-10-17 12:26:01.000000000 +0100
+@@ -38,6 +38,11 @@
+ #include "pd_Document.h"
+ #include "fl_AutoNum.h"
+ #include "fl_TableLayout.h"
++#include "fl_AutoLists.h"
++
++typedef List_Type FL_ListType;
++
++using namespace std;
+ 
+ #define WP6_NUM_LIST_LEVELS 8  // see WP6FileStructure.h
+ 
+@@ -52,8 +57,8 @@
+     ABI_ListDefinition(int iOutlineHash);
+     void setListID(const int iLevel, const UT_uint32 iID) { m_iListIDs[iLevel-1] = iID; }
+     const UT_uint32 getListID(const int iLevel) const { return m_iListIDs[iLevel-1]; }
+-    const List_Type getListType(const int iLevel) const { return m_listTypes[iLevel-1]; }
+-    void setListType(const int iLevel, const WPXNumberingType type);
++    const FL_ListType getListType(const int iLevel) const { return m_listTypes[iLevel-1]; }
++    void setListType(const int iLevel, const char type);
+     void incrementLevelNumber(const int iLevel) { m_iListNumbers[iLevel - 1]++; }
+     void setLevelNumber(const int iLevel, const int iNumber) { m_iListNumbers[iLevel - 1] = iNumber; }
+     const int getLevelNumber(const int iLevel) const { return m_iListNumbers[iLevel - 1]; }
+@@ -63,7 +68,7 @@
+     //int m_iWPOutlineHash; // we don't use this information in AbiWord, only for id purposes during filtering
+     UT_uint32 m_iListIDs[WP6_NUM_LIST_LEVELS];
+     int m_iListNumbers[WP6_NUM_LIST_LEVELS];
+-    List_Type m_listTypes[WP6_NUM_LIST_LEVELS];
++    FL_ListType m_listTypes[WP6_NUM_LIST_LEVELS];
+     int m_iOutlineHash;
+ };
+ 
+@@ -96,87 +101,67 @@
+     virtual void pasteFromBuffer(PD_DocumentRange * pDocRange,
+ 				 UT_uint8 * pData, UT_uint32 lenData, const char * szEncoding = 0);
+     
+-    virtual void setDocumentMetaData(const UCSString &author, const UCSString &subject,
+-				     const UCSString &publisher, const UCSString &category,
+-				     const UCSString &keywords, const UCSString &language,
+-				     const UCSString &abstract, const UCSString &descriptiveName,
+-				     const UCSString &descriptiveType);
++    virtual void setDocumentMetaData(const WPXPropertyList &propList);
+ 
+     virtual void startDocument();
+     virtual void endDocument();
+ 
+-	virtual void openPageSpan(const int span, const bool isLastPageSpan,
+-				  const float marginLeft, const float marginRight,
+-				  const float marginTop, const float marginBottom);
+-	virtual void closePageSpan() {}
+-	virtual void openHeaderFooter(const WPXHeaderFooterType headerFooterType, 
+-				  const WPXHeaderFooterOccurence headerFooterOccurence);
+-	virtual void closeHeaderFooter(const WPXHeaderFooterType headerFooterType, 
+-				  const WPXHeaderFooterOccurence headerFooterOccurence);
++    virtual void openPageSpan(const WPXPropertyList &propList);
++    virtual void closePageSpan() {}
++    virtual void openHeader(const WPXPropertyList &propList);
++    virtual void closeHeader();
++    virtual void openFooter(const WPXPropertyList &propList);
++    virtual void closeFooter();
++
++    virtual void openParagraph(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops);
++    virtual void closeParagraph() {}
+ 	
+-	virtual void openParagraph(const guint8 paragraphJustification, const guint32 textAttributeBits,
+-				   const float marginLeftOffset, const float marginRightOffset,
+-				   const gchar *fontName, const float fontSize, 
+-				   const float lineSpacing, 
+-				   const bool isColumnBreak, const bool isPageBreak);				  
+-	virtual void closeParagraph() {};
+-    virtual void openSpan(const guint32 textAttributeBits, const gchar *fontName, const float fontSize);
+-	virtual void closeSpan() {};		
+-	virtual void openSection(const guint numColumns, const float spaceAfter);
+-	virtual void closeSection() {};	
+-		
+-	virtual void insertTab();
+-    virtual void insertText(const UCSString &text);
++    virtual void openSpan(const WPXPropertyList &propList);
++    virtual void closeSpan() {}
++
++    virtual void openSection(const WPXPropertyList &propList, const WPXPropertyListVector &columns);
++    virtual void closeSection() {}
++
++    virtual void insertTab();
++    virtual void insertText(const WPXString &text);
+     virtual void insertLineBreak();
+-    
+-    virtual void defineOrderedListLevel(const int listID, const guint16 listLevel, const WPXNumberingType listType, 
+-					const UCSString &textBeforeNumber, const UCSString &textAfterNumber,
+-					const int startingNumber);
+-    virtual void defineUnorderedListLevel(const int listID, const guint16 listLevel, const UCSString &bullet);
+-    virtual void openOrderedListLevel(const int listID);
+-    virtual void openUnorderedListLevel(const int listID) { m_iCurrentListLevel++; }
+-    virtual void closeOrderedListLevel(); 
+-    virtual void closeUnorderedListLevel() { m_iCurrentListLevel--; }
+-	virtual void openListElement(const guint8 paragraphJustification, const guint32 textAttributeBits,
+-				     const float marginLeftOffset, const float marginRightOffset,
+-				     const gchar *fontName, const float fontSize, 
+-				     const float lineSpacing) { /* TODO: IMPLEMENT ME*/ }	
+-    virtual void openListElement(const guint8 paragraphJustification, const guint32 textAttributeBits,
+-							     const gchar *fontName, const float fontSize, 
+-							     const float lineSpacing);
++
++    virtual void defineOrderedListLevel(const WPXPropertyList &propList);
++    virtual void defineUnorderedListLevel(const WPXPropertyList &propList);	
++    virtual void openOrderedListLevel(const WPXPropertyList &propList);
++    virtual void openUnorderedListLevel(const WPXPropertyList &propList);
++    virtual void closeOrderedListLevel();
++    virtual void closeUnorderedListLevel();
++    virtual void openListElement(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops);
+     virtual void closeListElement() {}
+ 
+-	virtual void openFootnote(int number);
+-	virtual void closeFootnote();
+-	virtual void openEndnote(int number);
+-	virtual void closeEndnote();
+-		
+- 	virtual void openTable(const guint8 tablePositionBits, 
+-			       const float marginLeftOffset, const float marginRightOffset,
+-			       const float leftOffset, const vector < WPXColumnDefinition > &columns);
+-	virtual void openTableRow();
+-	virtual void closeTableRow() {};		
+-	virtual void openTableCell(const guint32 col, const guint32 row, const guint32 colSpan, const guint32 rowSpan,
+-							const guint8 borderBits,
+-							const RGBSColor * cellFgColor, const RGBSColor * cellBgColor);
+-	virtual void closeTableCell() {};
+-	virtual void insertCoveredTableCell(const guint32 col, const guint32 row) {}
+-	virtual void closeTable();
++    virtual void openFootnote(const WPXPropertyList &propList);
++    virtual void closeFootnote();
++    virtual void openEndnote(const WPXPropertyList &propList);
++    virtual void closeEndnote();
++
++    virtual void openTable(const WPXPropertyList &propList, const WPXPropertyListVector &columns);
++    virtual void openTableRow(const WPXPropertyList &propList);
++    virtual void closeTableRow() {}
++    virtual void openTableCell(const WPXPropertyList &propList);
++    virtual void closeTableCell() {}
++    virtual void insertCoveredTableCell(const WPXPropertyList &propList) {}
++    virtual void closeTable();
++
+     
+ protected:
+-    UT_Error							_appendSpan(const guint32 textAttributeBits, const gchar *fontName, const float fontSize, UT_uint32 listTag = 0);
++    UT_Error							_appendSection(int numColumns, const float, const float);
++//    UT_Error							_appendSpan(const guint32 textAttributeBits, const char *fontName, const float fontSize, UT_uint32 listTag = 0);
+     UT_Error                            _appendListSpan(UT_uint32 listTag);
+-    UT_Error							_appendParagraph(const guint8 paragraphJustification, const guint32 textAttributeBits,
+-										 const gchar *fontName, const float fontSize, const float lineSpacing);
+-    UT_Error							_appendSection(guint numColumns, const float, const float);
++//    UT_Error							_appendParagraph(const guint8 paragraphJustification, const guint32 textAttributeBits,
++//										 const gchar *fontName, const float fontSize, const float lineSpacing);
+     UT_Error							_updateDocumentOrderedListDefinition(ABI_ListDefinition *pListDefinition, 
+-												     int iLevel, const WPXNumberingType listType, 
+-												     const UCSString &sTextBeforeNumber, 
+-												     const UCSString &sTextAfterNumber,
++												     int iLevel, const char listType, 
++												     const UT_UTF8String &sTextBeforeNumber, 
++												     const UT_UTF8String &sTextAfterNumber,
+ 												     int iStartingNumber);    
+     UT_Error							_updateDocumentUnorderedListDefinition(ABI_ListDefinition *pListDefinition, 
+ 												       int level);    
+-    
+ private:
+     // section props
+     float								m_leftMargin;
+@@ -186,8 +171,11 @@
+ 	UT_uint32							m_nextFreeId;
+ 
+ 	// paragraph props
++    float								m_topMargin;
++    float								m_bottomMargin;
+     float								m_leftMarginOffset;
+     float								m_rightMarginOffset;
++    float								m_textIndent;
+ 
+     // state handling that libwpd can't account for
+     //UT_StringPtrMap						m_listStylesHash;
+@@ -199,6 +187,8 @@
+ 
+     int							        m_iCurrentListLevel;
+     bool								m_bInCell;
++	//needed for correct conversion of complicated tables
++    int							        m_iNumCoveredTableCellsInRow;
+ 	
+ 	
+ 	// HACK HACK HACK




More information about the fedora-cvs-commits mailing list