Error with a RTF

General TRichView support forum. Please post your questions here
Post Reply
Benoit B.

Error with a RTF

Post by Benoit B. »

when i load this file, the TRichView crash

Code: Select all

{\rtf1\ansi\ansicpg0\uc1\deff0\deflang0\deflangfe0{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset0 Arial;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}\uc1 \pard\fi0\li0\ql\ri0\sb0\sa0\itap0
{\trowd\trgaph38\trleft0\itap1\trrh240\trpaddl30\trpaddt30\trpaddr30\trpaddb30\trpaddfl3\trpaddft3\trpaddfr3\trpaddfb3\trspdl-8\trspdr-8\trspdfl3\trspdfr3\trspdt-8\trspdft3\trspdb-8\trspdfb3\trftsWidth1\richviewtbw0\clwWidth0\clwWidth75\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx1211\clwWidth0\clwWidth160\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx3784\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx5146\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx6509\clwWidth0\clwWidth141\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx8780\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx10142\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx11504\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx12867\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx14229\clwWidth0\clwWidth56\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx15138\pard \intbl\itap1{{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18 \b \cf0 N° Sosa/réf.\cell}{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18 \b \cf0 Nom\cell}{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18 \b \cf0 Naissance\cell}{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18 \b \cf0 Lieu naissance\cell}{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18 \b \cf0 Conjoint\cell}{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18 \b \cf0 Date d'union\cell}{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18 \b \cf0 Lieu d'union\cell}{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18 \b \cf0 Décès\cell}{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18 \b \cf0 Lieu décès\cell}{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18 \b \cf0 Age\cell}}\row

\pard \intbl\itap1{{\pard\fi0\li0\qr\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cf0 1\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cf0 \cf9 Claude de MIREMONT\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cf0 \cf6 Marguerite de TILLOY\pard\ql\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\pard\ql\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\pard\ql\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cf0 1478\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }}\row 

\pard\intbl\itap1}{\trowd\trgaph38\trleft0\itap1\trrh240\trpaddl30\trpaddt30\trpaddr30\trpaddb30\trpaddfl3\trpaddft3\trpaddfr3\trpaddfb3\trspdl-8\trspdr-8\trspdfl3\trspdfr3\trspdt-8\trspdft3\trspdb-8\trspdfb3\trftsWidth1\richviewtbw0\clwWidth0\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx15138\pard \intbl\itap1{{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\b Génération 2\keepn\cell }}\pard\intbl\itap1\row }{\trowd\trgaph38\trleft0\itap1\trrh240\trpaddl30\trpaddt30\trpaddr30\trpaddb30\trpaddfl3\trpaddft3\trpaddfr3\trpaddfb3\trspdl-8\trspdr-8\trspdfl3\trspdfr3\trspdt-8\trspdft3\trspdb-8\trspdfb3\trftsWidth1\richviewtbw0\clwWidth0\clwWidth75\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx1211\clwWidth0\clwWidth160\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx3784\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx5146\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx6509\clwWidth0\clwWidth141\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx8780\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx10142\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx11504\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx12867\clwWidth0\clwWidth85\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx14229\clwWidth0\clwWidth56\clbrdrl\brdrs\brdrw15\brdrcf1\clbrdrt\brdrs\brdrw15\brdrcf1\clbrdrr\brdrs\brdrw15\brdrcf1\clbrdrb\brdrs\brdrw15\brdrcf1\clcbpat-1\clvertalc\cellx15138\pard \intbl\itap1{{\pard\fi0\li0\qr\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cf0 2\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cf0 \cf9 Philippe de MIREMONT\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cf0 \cf6 Isabeau d'ASPREMONT\pard\ql\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\pard\ql\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\pard\ql\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }}\row 

\pard \intbl\itap1{{\pard\fi0\li0\qr\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cf0 3 ()\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cf0 \cf6 Isabeau d'ASPREMONT\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cf0 \cf9 Philippe de MIREMONT\pard\ql\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\pard\ql\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\pard\ql\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\ql\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }{\pard\fi0\li0\qc\ri0\sb45\sa0\itap1\intbl \plain \f1\lang1036 \fs18\cell }}\row 

}\pard\fi0\li0\ql\ri0\sb0\sa0\itap0 \plain \f1\lang1033\fs24 \par
}
Can you help me please ? i don't find what's wrong.
This file work with word
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Which program generated this RTF? Is it possible to modify it?

In order to fix this RTF, search for "\pard\ql\cell" and remove "\pard" from it.
Explanation:
\pard resets all paragraph properties to defaults. Including a flag "this paragraph is in table".
\ql is not important, it's a paragraph alignment.
\cell means the cell end. TRichView reads this keyword, checks the current paragraph properties, and sees that the paragraph is not in the table, so it signals the table end. But this not a table end, and the following cell causes error.

I believe that this RTF is erroneous, and success or failure of reading it depends on specifics of implemenation of RTF reading.

PS: TRichView does not crash when loading this RTF file, just LoadRTF returns False (exception is visible only if you debug in Delphi IDE)
Benoit B.

Post by Benoit B. »

Sergey Tkachenko wrote:Which program generated this RTF? Is it possible to modify it?
In fact, it's my own RTF generator and i've remove the \pard.

Thanks for your help and your explanation.

Benoit B.
maliger
Posts: 3
Joined: Mon Feb 26, 2007 1:57 pm

RTF \clcbpat-1

Post by maliger »

Hello,

as far as I see (and study the MS' RTF specification) the \clcbpat have the parameter as index to color table. No -1 allowed.

Or am I wrong? What that -1 should mean?

Regards,
Martin

btw: RV generated RTFs do not pass our validating parser becouse of this.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Can you send me RVF document, after exporting which to RTF you get \clcbpat-1? It must not happen.
Post Reply