Bug 244774 - Kdevelop auto-changes "this->someVar" into "this.someVar"
Summary: Kdevelop auto-changes "this->someVar" into "this.someVar"
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Code completion (show other bugs)
Version: 4.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 4.0.1
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-15 18:54 UTC by olig9
Modified: 2011-01-15 06:35 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
test case showing the problem (268 bytes, text/x-c++src)
2010-07-15 18:54 UTC, olig9
Details

Note You need to log in before you can comment on or make changes to this bug.
Description olig9 2010-07-15 18:54:06 UTC
Created attachment 49181 [details]
test case showing the problem

Version:           4.0.0 (using KDE 4.4.4) 
OS:                Linux

In certain cases, when typing "obj1 > this->mObj" Kdev will change the -> characters automatically to a dot when typing it, so it reads this.mObj . This is obviously incorrect in normal C++ code.

Looks like this only happens in very special cases. See the test case. I think it has to do with:
- obj1 being an object (if it's an int the problem doesn't appear)
- the comparison being a greater-than (if it's a <, >= or == the problem doesn't appear)


Reproducible: Always

Steps to Reproduce:
- open the attached test case file in Kdev 4
- edit the "if" line: delete it and type it again, as: "if (obj1 > this->mObj)"
- observe that the -> is automatically changed to "."


Actual Results:  
The "->" characters are replaced by a "." character

Expected Results:  
The "->" characters should stay as I typed them.

Workaround is to type "(*this).someVar" instead :-)

This happens with self-compiled Kdev 4.0.60, on RHEL 5.1.
Comment 1 Jan 2010-07-16 16:36:42 UTC
I can reproduce this with KDevelop 4.0.0 in KDE SC 4.5 RC2.
Comment 2 Olivier.jg 2011-01-15 06:35:58 UTC
Auto-close didn't work because diff was too long to be added as a comment.
This is fixed by commit 6ac597c5e862b9891665025375a5febb9cf33404.