Bug 46871 - resolve->edit widget drops the last character of every line
Summary: resolve->edit widget drops the last character of every line
Status: RESOLVED FIXED
Alias: None
Product: cervisia
Classification: Applications
Component: general (show other bugs)
Version: 2.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Christian Loose
URL:
Keywords:
: 55572 87538 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-08-24 03:18 UTC by Mircea Baciu
Modified: 2004-08-19 21:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Steps to recreate the defect (2.04 KB, text/plain)
2004-03-02 23:13 UTC, George Barta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mircea Baciu 2002-08-24 03:15:40 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           cervisia
Version:           2.0 (using KDE 3.0.7 1 beta1))
Severity:          normal
Installed from:    compiled sources
Compiler:          gcc version 2.95.3 20010315 (release)
OS:                Linux (i686) release 2.4.20-pre4
OS/Compiler notes: 

When trying to edit a conflict the edit widget displays the lines without the last character. Also the empty lines are dropped as explained in bug #41259.

Here's the merge result file:
--- cut ---

line 4

<<<<<<< test.txt
line 3

line 33
=======
line 5

line 6
>>>>>>> 1.2.2.1
--- cut ---

Thanks
Mircea

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 Till Gerken 2003-01-26 19:52:30 UTC
Same happens here, CVS HEAD snapshot from around 13th of January, GCC 3.2. 
Comment 2 Christian Loose 2003-03-04 09:32:18 UTC
Hi!

If this happens again, could you please attach the not-working source file
to this bug.

Thanks

Christian
Comment 3 Christian Loose 2003-03-06 11:06:21 UTC
*** Bug 55572 has been marked as a duplicate of this bug. ***
Comment 4 Christian Loose 2003-07-29 12:31:57 UTC
Again I can't reproduce this bug. The testcase of the original reporter works for me (KDE 3.1).  
  
So if anybody of the reporters still experiences this bug, please add a testcase to this bug.  
Either as comment or attachment.  
  
Thanks for your help.  
  
Christian  
Comment 5 Christian Loose 2003-08-28 14:10:20 UTC
Another month passed and I still didn't get a test case. 
 
So I close this bug report for now. Please re-open it when the bug still exists and  
please please provide a test case. Thanks. 
 
Christian 
Comment 6 George Barta 2004-03-02 23:12:24 UTC
I have been experiencing the same problem with cervisia.  Here is what I know:

KDE version: 3.2.0 - built from sources using 'konstruct' on Feb 27, 2004
Platform: - RedHat 9

steps to reproduce: ( see attachment "conflict_test_steps.txt" )

additional info:
	I've tracked this problem to http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdesdk/cervisia/resolvedlg.cpp?annotate=1.24
on line 565.  By changing the line from "length()-1" to just "length()" in my local source, the problem went away.  The same is true for line 573.  When I removed the '+ "\n"', the extra blank line added after every line went away.

I know this problem is not in this code, however, since this has been there from the original version of the file.  Code outside of resolvedlg.cpp may have changed which causes this behavior.

Let me know if there is any other info I can provide.

George
Comment 7 George Barta 2004-03-02 23:13:47 UTC
Created attachment 4980 [details]
Steps to recreate the defect
Comment 8 Christian Loose 2004-03-02 23:32:55 UTC
Thanks a lot George!

With your very detailed step by step explanation, I could reproduce the bug. So I reopen it and I will try to fix it for the next KDE 3.2.x release.

Christian
Comment 9 Chris Browet 2004-03-29 13:20:44 UTC
I myself always had this bug since I use Cervisia. I actually thought it was a setup problem as the bug was so obvious that I thought it couldn't have been left unsolved for so long.

Looking at the code it looks like it dated from the moment the "fopen" was replaced by a QTextStream (which strips the newline char) in ResolveDialog::parseFile (http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdesdk/cervisia/resolvedlg.cpp#rev1.7)

I actually wonder how come some people do not have it, and it explains why this has not been solved sooner. Maybe something in the QTextCodec? 
Comment 10 Christian Loose 2004-04-02 00:32:40 UTC
CVS commit by cloose: 

Fix BR #46871: 
Preserve file content in resolve dialog: 
  - don't remove characters
  - don't add or remove new line markers 
  - correctly handle A+B/B+A cases with no new line marker
    at the end of the first version 

CCMAIL: 46871-done@bugs.kde.org


  M +6 -0      ChangeLog   1.116
  M +43 -76    resolvedlg.cpp   1.29
  M +1 -0      resolvedlg.h   1.13
  M +4 -11     resolvedlg_p.cpp   1.2
  M +2 -2      resolvedlg_p.h   1.2



Comment 11 Christian Loose 2004-08-19 21:38:15 UTC
*** Bug 87538 has been marked as a duplicate of this bug. ***