Niklas,

Niklas Nebel wrote:
Even if you get it to work, it still looks like a fundamentally wrong approach to me. Importing a WP file into Writer is supposed to result in real, editable text that can be searched or sorted, not just something that happens to look right. I'd suggest to reverse the text in the filter.

I am also aware that the solution I was proposing was not really satisfactory. Therefore, I spent some time trying to come up with a intelligent and small code to do the reordering. Nevertheless, the thing is a bit more complicated then it looks. I used FriBiDi in our standalone converter wpd2sxw. I realized that there are several problems making a proper solution rather tedious one.

1) The "inverse" bidi algorithm is not really defined. There is an API in Icu's ubidi.h that tries to "approximate" it, but it is surrounded with a disclaimer. Other BiDi implementation that I know about FriBiDi does not even try to implement it.

2) Even if one provides a reordering of the strings in the filter, the result will be likely very wrong, since the strings we get from libwpd are strings of text with the same formatting attributes (bold, italic,...) and not natural runs. So, reordering them can lead to something quite disastrous. You can check the "WP6 Charset 9 modified.*" documents at http://hei.unige.ch/~strba5/Smokey/ Especially the PDF from what you see as WordPerfect user and the sxw created with wpd2sxw with the string reordering switched on.

3) There is actually a solution which would (a) break libwpd API, (b) add an dependency of libwpd on icu or fribidi, and (c) render the library pretty unstable for quite some time untill all special cases are found and catered for. I outlined this solution in a mailing to [EMAIL PROTECTED] (http://sourceforge.net/mailarchive/message.php?msg_id=12249679). Given that we are only 3 (in words three) developpers working on libwpd in our free time, such a refactoring (although necessary) is likely not to happen in next future.

Given these considerations, the solution with the LRO controls looks like the only workable one in a reasonable time limit. Assuring you about the fact that we are working on a "proper" solution, I would plead for you accepting the LRO one with which the user can at least (I hope and it is my prayer) see correctly the text.

Cheers

Fridrich

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to