Bug 89410 - editor loses formatting on various actions
Summary: editor loses formatting on various actions
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: composer (show other bugs)
Version: 1.7
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 88157 90354 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-13 16:02 UTC by F Reifenstahl
Modified: 2007-09-14 12:17 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch.diff (456 bytes, text/x-diff)
2004-09-20 09:43 UTC, qt-bugs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description F Reifenstahl 2004-09-13 16:02:10 UTC
Version:           1.7 (using KDE 3.3.0, SuSE)
Compiler:          gcc version 3.3.3 (SuSE Linux)
OS:                Linux (i686) release 2.6.8.1

If one enters <tab>s at the start of lines, they count 8 spaces. After adding a signature, they are reduced to 1 space
Create an ordered list and save (to template). After restoring the list formatting has gone away.
Sometimes you can't add bold or italic markups by pressing the buttons, nothing happens.
Comment 1 Ingo Klöcker 2004-09-15 22:30:59 UTC
The second issue has been resolved.
Comment 2 Edwin Schepers 2004-09-18 14:19:47 UTC
Hi,
I think I found a bug in Qt. I found it because someone was complaining about 
KMail not sending tab characters.
It seems that in revision 1.49 of qrichtext.cpp the change was made :
In QTextParagraph::paint(), a tab character is changed into a space. When I 
delete the uc[(int)ii] == '\t' in 
    for ( uint ii = 0; ii < qstr.length(); ii++ )
        if ( uc[(int)ii]== '\n' ) || uc[(int)ii] == '\t' )
            uc[(int)ii] = 0x20;

the tab character gets saved (but maybe this has other consequences).

Regards,
Edwin Schepers.

Comment 3 Edwin Schepers 2004-09-18 14:38:01 UTC
The previous was sent to qt-bugs@trolltech.com

The third issue has been solved too.
Comment 4 Edwin Schepers 2004-09-18 16:58:13 UTC
*** Bug 88157 has been marked as a duplicate of this bug. ***
Comment 5 qt-bugs 2004-09-20 09:43:49 UTC
On Saturday, 18. sep 2004 14:26 Edwin Schepers wrote:
> Hi,
> I think I found a bug in Qt. I found it because someone was
> complaining about
> KMail not sending tab characters.
> It seems that in revision 1.49 of qrichtext.cpp the change was made :
> In QTextParagraph::paint(), a tab character is changed into a space.
> When I
> delete the uc[(int)ii] == '\t' in
>     for ( uint ii = 0; ii < qstr.length(); ii++ )
>         if ( uc[(int)ii]== '\n' ) || uc[(int)ii] == '\t' )
>             uc[(int)ii] = 0x20;
>
> the tab character gets saved (but maybe this has other consequences).

Hi Edwin,

We are aware of this issue. The attached patch should solve the problem.
Please try it out and let us know how it works out for you. The fix
should also be in the latest snapshot.

Best regards,
Sigrid
Trolltech AS, Waldemar Thranes gt. 98, N-0175 Oslo, Norway


Created an attachment (id=7590)
patch.diff
Comment 6 F Reifenstahl 2004-09-21 15:45:30 UTC
It seems there are many more bugs in kmail editor. When saving and restoring mails with attachments, often every NEWLINE is expanded to 2 NEWLINES. Italics and bold buttons don't work, ordered list are lost after saving and restoring...
Comment 7 Nicolas Goutte 2004-09-28 23:03:34 UTC
*** Bug 90354 has been marked as a duplicate of this bug. ***
Comment 8 Don Sanders 2004-09-30 12:17:21 UTC
On Wednesday 22 September 2004 03:45, Edwin Schepers wrote:
...
> Reading #86925, it could be that Don has a solution for this one.
> Don ?

My patch just changes from using <p> tags to using <br> tags. Let me 
try at home and get back to you.

I couldn't reproduce any of the other bugs "When saving and restoring 
mails with attachments, often every NEWLINE is expanded to 2 
NEWLINES. Italics and bold buttons don't work, ordered list are lost 
after saving and restoring...". I couldn't reproduce any of these 
problems.

Don.

Comment 9 F Reifenstahl 2004-09-30 15:56:05 UTC
> > Reading #86925, it could be that Don has a solution for this one.
> > Don ?
>
> My patch just changes from using <p> tags to using <br> tags. Let me
> try at home and get back to you.
>
> I couldn't reproduce any of the other bugs "When saving and restoring
> mails with attachments, often every NEWLINE is expanded to 2
> NEWLINES. Italics and bold buttons don't work, ordered list are lost
> after saving and restoring...". I couldn't reproduce any of these
> problems.

Belonging to SuSE rpms I am always up to date, so maybe some bugs disappeared. 
I will try anew:

Opening a new message and entering arbitrary, unformatted text, <RETURN> 
inserts a newline. Formatting a block instancing as an ordered list, and 
formatting back to standard, insertion of <RETURN> has changed to paragraph 
(2 newlines).

Right now the italics button is grey, no chance to format any word this way.
Ah, just yet I inadvertently saved this reply: the bold "instancing" (you 
see?) in the preceding paragraph survived, but every newline in the text 
above has changed to a newparagraph. And: after saving and restoring the 
italics button was activ, but selecting text and pressing the button results 
didn't change anything. Now the italics button is grey again.
Colouring text doesn't work. When choosing colours in the dialogues colour 
wheel, RGB values toggle between 0 and 1 and the choosen colour is not took 
over.
Kind regards
Frank <html><head><meta name="qrichtext" content="1" /></head><body style="font-size:10pt;font-family:Misc Fixed">
<p>&gt; &gt; Reading #86925, it could be that Don has a solution for this one.</p>
<p>&gt; &gt; Don ?</p>
<p>&gt;</p>
<p>&gt; My patch just changes from using &lt;p&gt; tags to using &lt;br&gt; tags. Let me</p>
<p>&gt; try at home and get back to you.</p>
<p>&gt;</p>
<p>&gt; I couldn't reproduce any of the other bugs &quot;When saving and restoring</p>
<p>&gt; mails with attachments, often every NEWLINE is expanded to 2</p>
<p>&gt; NEWLINES. Italics and bold buttons don't work, ordered list are lost</p>
<p>&gt; after saving and restoring...&quot;. I couldn't reproduce any of these</p>
<p>&gt; problems.</p>
<p></p>
<p>Belonging to SuSE rpms I am always up to date, so maybe some bugs disappeared. I will try anew:</p>
<p></p>
<p>Opening a new message and entering arbitrary, unformatted text, &lt;RETURN&gt; inserts a newline. Formatting a block <span style="font-weight:600">instancing </span>as an ordered list, and formatting back to standard, insertion of &lt;RETURN&gt; has changed to paragraph (2 newlines).</p>
<p></p>
<p>Right now the italics button is grey, no chance to format any word this way.</p>
<p>Ah, just yet I inadvertently saved this reply: the bold &quot;instancing&quot; (you see?) in the preceding paragraph survived, but every newline in the text <span style="font-style:italic">above has changed to a newparagraph. And: after saving and restoring the italics button was activ, but selecting text and pressing the button results didn't change anything. Now the italics button is grey again.</span></p>
<p><span style="font-style:italic">Colouring text doesn't work. When choosing colours in the dialogues colour wheel, RGB values toggle between 0 and 1 and the choosen colour is not took over.</span></p>
<p>Kind regards</p>
<p>Frank </p>
</body></html>
Comment 10 earlgrey 2004-09-30 17:39:01 UTC
On Thu, 30 Sep 2004 08:17 pm, Don Sanders wrote:
<snip>

> I couldn't reproduce any of the other bugs "When saving and restoring
> mails with attachments, often every NEWLINE is expanded to 2
> NEWLINES. Italics and bold buttons don't work, ordered list are lost
> after saving and restoring...". I couldn't reproduce any of these
> problems.

When I switch to html mode, the font drop down menu is set to an empty entry,
that's when the bold & italic buttons don't work/get stuck.
But selecting a font makes them behave.


Sam

> Don.

Comment 11 Edwin Schepers 2004-10-06 17:51:19 UTC
earl grey wrote :
> I once had this problem when my default font (Helvetica) was not in the
> list of available fonts. I don't know how this can happen but it did.
> In this case, my font-dropdown was initially empty. After changing my
> default font is was initially filled.
> Could it be the case for you too?
yes exactly the same, including the Helvetica font, funny that!
I did (and do) assume it's a problem with my computer, 
Comment 12 David 2004-12-04 00:55:25 UTC
This must be what is happening to me. Doing a program in python also. Normally use Nedit. But when open it with Kedit and save, it screws up the indents. Everything shifted left. Luckily found NOT to use kedit or kwrite for opening anything programmed prior with another editor and had a backup.

bash-2.05b$ python main.py
  File "main.py", line 25
    def run(self):
                 ^
IndentationError: unindent does not match any outer indentation level

Tested other editors:

Code:
bash-2.05b$ python main.py
  File "main.py", line 25
    def run(self):
                 ^
IndentationError: unindent does not match any outer indentation level

1) Kedit: Looks fine when load up, save and program fails. Load back up in kedit and everything shifted left.
2) Kwrite: It loads up with all indents shifted left. Same results when save.
3) Abiword and Kate looks fine, nothing shifted and prog works after saving it.

So three editor don't change the indent, two do. 

Use kde 3.2.3 because 3.3.0 is too buggy.
Comment 13 David 2004-12-04 00:56:57 UTC
Oops, forgot to remove the second:

Code:
bash-2.05b$ python main.py
  File "main.py", line 25
    def run(self):
                 ^
IndentationError: unindent does not match any outer indentation level
Comment 14 David Faure 2004-12-04 00:59:36 UTC
David: wrong bug report for your comments about kedit/kwrite.
This report is about kmail's editor (when composing a mail to be sent).

Comment 15 David 2004-12-04 01:03:30 UTC
Darn, thought was following a link that said was a duplicate of a kedit problem. Sorry.
Comment 16 David 2004-12-04 01:08:49 UTC
Went back and found where came here from. The bug was a kedit bug and they said that http://bugs.kde.org/show_bug.cgi?id=88157 was a duplicate of this bug here.
So it is marked Resolved. 

Where to report, where to report. Darn, used to love kedit, but can't have it changing my corrupting my source code.
Comment 17 David Faure 2004-12-04 01:22:04 UTC
Well ok, if you meant kedit explicitely (and not kwrite), then indeed those reports are related.
kedit and kmail's composer both use the Qt class QTextEdit, where the bug is.
See comment #2 - and the patch in #5.
I wonder which Qt version has the bug and which one has the fix - this report wasn't explicit about it.

Comment 18 Edwin Schepers 2004-12-04 13:41:07 UTC
see also #90688, comment #5
Comment 19 Robin Farine 2005-04-12 18:13:55 UTC
Good news, the "tab replaced with space" problem is solved in Qt 3.3.4.

I was about to say that on my Debian Sarge system with the upgraded libqt3c102-mt package (based on Qt 3.3.4) the problem still occurred, but after restarting the X session, the problem disappeared. Thank you guys.
Comment 20 David Rosenstrauch 2005-04-13 03:48:19 UTC
Yes, I'm seeing it fixed as well on my Arch Linux box since the latest Qt upgrade.  Very cool!  And my thanks as well to the boys at Trolltech for fixing this one.

So this bug can probably be closed now.
Comment 21 Till Adam 2005-05-08 17:36:19 UTC
Ok, thanks for reporting back.