Hi folks,
First off, attached to this is a small patch that must be applied on
top of the larger one I sent yesterday. It fixes color support, and
changes the property PROPS to props, to make it work with current CVS.
As requested there are three Psion documents attached to this:
* 'Example Word' is an example Psion Word document which includes almost
possible layout (except page-level layout);
* 'Example TextEd' is a very short and simple Psion TextEd document;
* `ASCII_Codes.psi' contains all characters the Psion knows about
in a Psion Word file.
The last document is included to show that something goes wrong in the
conversion of ASCII characters above 0x80. I do the conversion as follows
(see IE_Imp_Psion::prepareCharacters for the exact code):
char *input; /* parameter */
class UT_Mbtowc mbtowc;
int i /* index on input of character we will convert; in the real code
we range it over a larger part of the input */
UT_UCSChar uc;
wchar_t wc;
mbtowc.setInCharset("CP1252");
if (!mbtowc.mbtowc(wc,input[i]))
// We reach this point which is not good :-(
uc = (UT_UCSChar) wc;
if (!(gbBlock->ins(gbBlock->getLength(),&uc,1)))
return UT_FALSE;
This may tie in to the discussion about signed characters; or it may not,
and I may just have hit some other problem. "CP1252" is known to my
iconv implementation, so that part should work...
Have fun with it,
Frodo
--
Frodo Looijaard <[EMAIL PROTECTED]> PGP key and more: http://huizen.dds.nl/~frodol
Defenestration n. (formal or joc.):
The act of removing Windows from your computer in disgust, usually followed
by the installation of Linux or some other Unix-like operating system.
gzip compressed data, deflated, original filename, last modified: Wed Dec 20 01:09:41 2000, os: Unix
���?: Example_TextEd 3g`��V ������d'1� iC�� g+6ΐ��b
J�SH�H�-�IUI�(qMQH�O.�M�+�S�H,Jɩ�'g�d��t���B�E���E�@E�ũ)
i�E
�>E��E���@M
9�y饉�
���Eɩ
��)�zl�~.l��L_`�����`��d�B����M&6��w�T��� ��p�(
@-��
�@|�8+P�! � �{- l��q
gzip compressed data, deflated, original filename, last modified: Wed Dec 20 01:36:59 2000, os: Unix
--- src/wp/impexp/xp/ie_imp_Psion.cpp.old Wed Dec 20 00:15:27 2000
+++ src/wp/impexp/xp/ie_imp_Psion.cpp Wed Dec 20 01:35:18 2000
@@ -132,5 +132,5 @@
UT_Bool IE_Imp_Psion::applyPageAttributes(psiconv_page_layout_section layout)
{
- char* pProps = "PROPS";
+ char* pProps = "props";
// UT_Byte is `unsigned char', so we need some nasty casts :-(
class UT_ByteBuf props(256);
@@ -186,5 +186,5 @@
UT_Bool IE_Imp_Psion::applyParagraphAttributes(psiconv_paragraph_layout layout)
{
- char* pProps = "PROPS";
+ char* pProps = "props";
// UT_Byte is `unsigned char', so we need some nasty casts :-(
class UT_ByteBuf props(256);
@@ -196,5 +196,4 @@
psiconv_tab tab;
-#if 0
// background color: not yet implemented; what would its name be?!?
strcat(propBuffer, "backcolor:");
@@ -203,5 +202,4 @@
layout->back_color->green,
layout->back_color->blue);
-#endif
// Left indent
@@ -308,5 +306,5 @@
UT_Bool IE_Imp_Psion::applyCharacterAttributes(psiconv_character_layout layout)
{
- char* pProps = "PROPS";
+ char* pProps = "props";
// UT_Byte is `unsigned char', so we need some nasty casts :-(
class UT_ByteBuf props(256);
@@ -376,8 +374,11 @@
(layout->color->green),
(layout->color->blue));
+ props.append((unsigned char *) buffer,strlen(buffer));
+
// background color
sprintf(buffer, "; bgcolor:%02x%02x%02x", layout->back_color->red,
layout->back_color->green,
layout->back_color->blue);
+ props.append((unsigned char *) buffer,strlen(buffer));
// Append the string termination character '\000'
