Bug 59029 - Rightly alignd hebrew paragraphs in HTML export dose not posses dir=rtl argument.
Summary: Rightly alignd hebrew paragraphs in HTML export dose not posses dir=rtl argum...
Status: RESOLVED LATER
Alias: None
Product: kword
Classification: Miscellaneous
Component: filters (show other bugs)
Version: 1.5 or before
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-27 09:52 UTC by Ronen
Modified: 2009-11-07 20:56 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ronen 2003-05-27 09:52:23 UTC
Version:           1.2.1 (using KDE 3.1.1)
Installed from:     (testing/unstable)
Compiler:          gcc version 3.2.3 20030309 (Debian prerelease)
OS:          Linux (i686) release 2.4.20-xfs

While exporting files from Kword to HTML, hebrew right-align paragraph shuld contain
<p .... dir=rtl>
in order to viewd properly. in Kword 1.2.1, This is not the case. the exported HTML contain 
<p class="Standard" style="text-align:right; ">
while the best thing is to add
<p class="Standard" style="text-align:right; " dir=rtl>

This argument shuld be inserted when the text is in this paragraph is in Right-To-Left language (hebrew, arabic etc..) and alignd to the right.
Comment 1 Nicolas Goutte 2003-06-06 20:29:39 UTC
Sorry, for now the HTML export filter does not work with RTL.

Unfortunately, I have not the resources to fix it for now.

Have a nice day!
Comment 2 Zack Rusin 2003-06-19 01:20:34 UTC
Subject: koffice/filters/kword/html/export

CVS commit by zrusin: 

Cleanups and fix for 59029.

CCMAIL: 59029-done@bugs.kde.org


  M +3 -1      ExportBasic.cc   1.10
  M +6 -3      ExportCss.cc   1.11
  M +3 -4      ExportDialog.cc   1.11


--- koffice/filters/kword/html/export/ExportBasic.cc  #1.9:1.10
@@ -325,4 +325,6 @@ void HtmlBasicWorker::openParagraph(cons
     {
         *m_streamOut << " align=\"" << layout.alignment << "\"";
+        if (layout.alignment == "right")
+          *m_streamOut << " dir=\"rtl\"";
     }
     else if ( layout.alignment=="auto")

--- koffice/filters/kword/html/export/ExportCss.cc  #1.10:1.11
@@ -485,4 +485,7 @@ void HtmlCssWorker::openParagraph(const 
     }
     
+    if (layout.alignment == "right")
+        *m_streamOut << " dir=\"rtl\"";
+
     *m_streamOut << ">";
 

--- koffice/filters/kword/html/export/ExportDialog.cc  #1.10:1.11
@@ -47,5 +47,4 @@ HtmlExportDialog :: HtmlExportDialog(QWi
     //m_dialog->comboBoxEncoding->insertStringList(KGlobal::charsets()->descriptiveEncodingNames());
 
-    resize(size()); // Is this right?
 
     setMainWidget(m_dialog);
@@ -71,5 +70,5 @@ bool HtmlExportDialog::isXHtml(void) con
 QTextCodec* HtmlExportDialog::getCodec(void) const
 {
-    QTextCodec* codec=NULL;
+    QTextCodec* codec=0;
 
     if (m_dialog->radioEncodingUTF8==m_dialog->buttonGroupEncoding->selected())
@@ -129,5 +128,5 @@ HtmlExportDialog::Mode HtmlExportDialog:
     }
 
-    return CSS;
+    return CSS;//Our default
 }
 


Comment 3 Nicolas Goutte 2003-06-19 17:13:07 UTC
Subject: Re:  Rightly alignd hebrew paragraphs in HTML export dose not posses dir=rtl argument.         

No, sorry but that is wrong.

right!=rtl

You may want right aligned text with left-to-right text.

And why the NULL to 0 change. We have a pointer, so the correct one is NULL.

Have a nice day!

> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>      
> http://bugs.kde.org/show_bug.cgi?id=59029     
> zack@kde.org changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |RESOLVED
>          Resolution|                            |FIXED
> 
> 
> 
> ------- Additional Comments From zack@kde.org  2003-06-19 01:20 -------
> Subject: koffice/filters/kword/html/export
> 
> CVS commit by zrusin: 
> 
> Cleanups and fix for 59029.
> 
> CCMAIL: 59029-done@bugs.kde.org
> 
> 
>   M +3 -1      ExportBasic.cc   1.10
>   M +6 -3      ExportCss.cc   1.11
>   M +3 -4      ExportDialog.cc   1.11
> 
> 
> --- koffice/filters/kword/html/export/ExportBasic.cc  #1.9:1.10
> @@ -325,4 +325,6 @@ void HtmlBasicWorker::openParagraph(cons
>      {
>          *m_streamOut << " align=\"" << layout.alignment << "\"";
> +        if (layout.alignment == "right")
> +          *m_streamOut << " dir=\"rtl\"";
>      }
>      else if ( layout.alignment=="auto")
> 
> --- koffice/filters/kword/html/export/ExportCss.cc  #1.10:1.11
> @@ -485,4 +485,7 @@ void HtmlCssWorker::openParagraph(const 
>      }
>      
> +    if (layout.alignment == "right")
> +        *m_streamOut << " dir=\"rtl\"";
> +
>      *m_streamOut << ">";
>  
> 
> --- koffice/filters/kword/html/export/ExportDialog.cc  #1.10:1.11
> @@ -47,5 +47,4 @@ HtmlExportDialog :: HtmlExportDialog(QWi
>     
//m_dialog->comboBoxEncoding->insertStringList(KGlobal::charsets()-
>descriptiveEncodingNames());

>  
> -    resize(size()); // Is this right?
>  
>      setMainWidget(m_dialog);
> @@ -71,5 +70,5 @@ bool HtmlExportDialog::isXHtml(void) con
>  QTextCodec* HtmlExportDialog::getCodec(void) const
>  {
> -    QTextCodec* codec=NULL;
> +    QTextCodec* codec=0;
>  
>      if (m_dialog->radioEncodingUTF8==m_dialog->buttonGroupEncoding->selected
())
> @@ -129,5 +128,5 @@ HtmlExportDialog::Mode HtmlExportDialog:
>      }
>  
> -    return CSS;
> +    return CSS;//Our default
>  }


Comment 4 Nicolas Goutte 2003-06-19 17:15:13 UTC
Re-opening bug as fix is wrong.
Comment 5 Zack Rusin 2003-06-19 17:43:57 UTC
Subject: Re:  Rightly alignd hebrew paragraphs in HTML export dose not posses dir=rtl argument.

On Thursday 19 June 2003 17:13, nicolasg@snafu.de wrote:
> No, sorry but that is wrong.
>
> right!=rtl
>
> You may want right aligned text with left-to-right text.

In which case dir="rtl" doesn't mean anything and we still end up with 
what we wanted. The only problem with that approach, is when rtl text 
is left aligned but read below.
I'm gonna change it anyway because I want to start depending on 
QChar::Direction and then in ExportCss add to the style:
direction: rtl; unicode-bidi: embed; if QChar::Direction == DirRLE
and direction: rtl; unicode-bidi: override; if QChar::Direction == 
DirRLO and in the BasicWorker simply add the checks for 
QChar::Direction and stick with dir="rtl".

> And why the NULL to 0 change. We have a pointer, so the correct one
> is NULL.

I don't want to get in another NULL vs. 0 discussion but we use 0 (or as 
the recent discussion shows 0L) all over KDE so I see no reason why 
this filter should be different).

Zack

Comment 6 Nicolas Goutte 2003-06-19 18:02:03 UTC
Subject: Re:  Rightly alignd hebrew paragraphs in HTML export dose not posses dir=rtl argument.         

> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>      
> http://bugs.kde.org/show_bug.cgi?id=59029     
> 
> 
> 
> 
> ------- Additional Comments From zack@kde.org  2003-06-19 17:43 -------
> Subject: Re:  Rightly alignd hebrew paragraphs in HTML export dose not posses 
dir=rtl
argument.
> 
> On Thursday 19 June 2003 17:13, nicolasg@snafu.de wrote:
> > No, sorry but that is wrong.
> >
> > right!=rtl
> >
> > You may want right aligned text with left-to-right text.
> 
> In which case dir="rtl" doesn't mean anything and we still end up with 
> what we wanted. The only problem with that approach, is when rtl text 
> is left aligned but read below.

Well, the problem is that we have not tested how it reacts. With all these 
browsers, there is surely one that does not like it.

> I'm gonna change it anyway because I want to start depending on 
> QChar::Direction and then in ExportCss add to the style:
> direction: rtl; unicode-bidi: embed; if QChar::Direction == DirRLE
> and direction: rtl; unicode-bidi: override; if QChar::Direction == 
> DirRLO and in the BasicWorker simply add the checks for 
> QChar::Direction and stick with dir="rtl".

Yes, I would prefer a real solution to the problem.

> 
> > And why the NULL to 0 change. We have a pointer, so the correct one
> > is NULL.
> 
> I don't want to get in another NULL vs. 0 discussion but we use 0 (or as 
> the recent discussion shows 0L) all over KDE so I see no reason why 
> this filter should be different).

Good, let's go for 0L then.

(I really start to hate all these discussions, as half of them ends up in 
something against what was used in KOffice for months.)

> 
> Zack

Have a nice
day!

Comment 7 Zack Rusin 2003-06-19 21:43:36 UTC
Subject: koffice/filters/kword/html/export

CVS commit by zrusin: 

This is a lot better fix for 59029 - it doesn't depend on the alignment anymore.

CCMAIL: 59029@bugs.kde.org


  M +3 -3      ExportBasic.cc   1.11
  M +2 -2      ExportBasic.h   1.6
  M +9 -6      ExportCss.cc   1.12
  M +3 -2      ExportCss.h   1.6
  M +2 -2      ExportDocStruct.cc   1.8
  M +2 -2      ExportDocStruct.h   1.6
  M +5 -5      ExportFilter.cc   1.38
  M +4 -2      ExportFilter.h   1.22



Comment 8 Zack Rusin 2003-09-14 18:33:10 UTC
Fixed.
Comment 9 Nicolas Goutte 2003-09-14 19:40:33 UTC
Subject: Re:  Rightly alignd hebrew paragraphs in HTML export dose not posses dir=rtl argument.

No, sorry, it is not finished. The "light" mode has no RTL code. And the rest 
seems not to work (see what Diego has written on koffice-devel.)

Diego is currently working on it.

Have a nice day!

On Sunday 14 September 2003 18:33, Zack Rusin wrote:
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>
> http://bugs.kde.org/show_bug.cgi?id=59029
> zack@kde.org changed:
>
>            What    |Removed                     |Added
> ---------------------------------------------------------------------------
>- Status|REOPENED                    |RESOLVED
>          Resolution|                            |FIXED
>
>
>
> ------- Additional Comments From zack@kde.org  2003-09-14 18:33 -------
> Fixed.

Comment 10 Nicolas Goutte 2003-09-14 19:42:03 UTC
Re-opening. Diego is taking care of. 
Comment 11 Zack Rusin 2003-09-14 19:55:36 UTC
Subject: Re:  Rightly alignd hebrew paragraphs in HTML export dose not posses dir=rtl argument.

On Sunday 14 September 2003 13:40, Nicolas Goutte wrote:
> No, sorry, it is not finished. The "light" mode has no RTL code. And
> the rest seems not to work (see what Diego has written on
> koffice-devel.)
>
> Diego is currently working on it.

I never implemented it for light mode because it's supposed to be light, 
doesn't it? The normal mode uses dir; the advanced css. Diego works on 
KSpread and his report on whole KOffice didn't mention KWord html 
export. So do you have a testcase showing that it's actually not 
working?

Zack

Comment 12 Nicolas Goutte 2003-09-14 21:07:32 UTC
Subject: Re:  Rightly alignd hebrew paragraphs in HTML export dose not posses dir=rtl argument.

Light mode is meaning whatever (X)HTML strict can do alone. And I really think 
that right-to-left writers have the right to use the light mode too. (The RTL 
tags are in (X)HTML strict, so there is no problem.)

As for Diego working on KWord, there is the following quote:

<QUOTE>
>
> QString::isRightToLeft is not documented. So it is difficult to guess that
> it exists. Also it means that there is not any guarantee that it will still
> be in Qt 4. (However this sounds good enough for a problem that we have in
> KWord's HTML export filter. Thank you!)
I am sure it that it will be in QT4, dont worry. Anyway I will report it to 
the trolls, thats a big oops IMHO.
I have seen the that the HTML export filter does not work well (I will hunt 
first kspread and then kword). If anyone want to fix them please mail me in 
private for not duplicating work. My next mail will be for kword developers 
then.
</QUOTE>

My view was that the light mode was still not finished and I thought that the 
whole RTL stuff was missing. (Which I later discovered it is wrong, as it is 
only incomplete.)

His comment made me think that he too had found other bugs. So as I have 
written that Diego should work on the KWord HTML export filter, it is him 
that you should contact if you want to code instead of him. (I am occupied 
enough with the RTF filters and I do not know any RTL language.)

As for further code changes, a possibility is to have the RTL tags together 
for the three modes, as CSS allows that. (CSS even allows RTL HTML tags to 
override CSS commands.) It would avoid having two or three times the same 
code.

Have a nice day!

On Sunday 14 September 2003 19:53, Zack Rusin wrote:
> On Sunday 14 September 2003 13:40, Nicolas Goutte wrote:
> > No, sorry, it is not finished. The "light" mode has no RTL code. And
> > the rest seems not to work (see what Diego has written on
> > koffice-devel.)
> >
> > Diego is currently working on it.
>
> I never implemented it for light mode because it's supposed to be light,
> doesn't it? The normal mode uses dir; the advanced css. Diego works on
> KSpread and his report on whole KOffice didn't mention KWord html
> export. So do you have a testcase showing that it's actually not
> working?
>
> Zack

Comment 13 George Goldberg 2008-02-18 04:30:09 UTC
Is this bug still present in a recent KDE version, such as 3.5.9 or 4.0.1?
Comment 14 Diego Iastrubni 2008-08-12 23:15:58 UTC
... should I finnally fix this issue...? :)
Comment 15 Thomas Zander 2009-11-07 20:56:08 UTC
No exports available in 2.0, closing as 'later'