Bug 130619

Summary: Crash on entering doxygen comment on editing cpp files
Product: [Applications] kate Reporter: Stefan Nikolaus <stefan.nikolaus>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: esigra, kde
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Stefan Nikolaus 2006-07-11 15:36:27 UTC
Version:           2.5.3 (using KDE 3.5.3, compiled sources)
Compiler:          Target: x86_64-suse-linux
OS:                Linux (x86_64) release 2.6.16.13-4-default

Kate crashes, if I try to edit a doxygen comment.

Steps to reproduce:
1. Open a .cpp/.h file
2. Enter '/**'
3. <RETURN>

-> crash

3.5 branch, SVN 559263
Comment 1 Stefan Nikolaus 2006-07-11 15:41:50 UTC
This was fixed with one of the patches for bug 129263 or bug 129580. Apparently, the respective fixes were committed in a modified form.
Comment 2 Andreas Kling 2006-07-11 21:57:17 UTC
SVN commit 561299 by kling:

Don't pass (int)-1 to KateTextLine::stringAtPos(), it chokes on that.
This is fixed in KDE4 Kate, where all unsigned ints are made signed.

BUG: 130619


 M  +2 -1      kateautoindent.cpp  


--- branches/KDE/3.5/kdelibs/kate/part/kateautoindent.cpp #561298:561299
@@ -568,8 +568,9 @@
       QString filler = tabString (indent);
 
       bool doxygenAutoInsert = doc->config()->configFlags() & KateDocumentConfig::cfDoxygenAutoTyping;
+
       if ( doxygenAutoInsert &&
-           (!textLine->stringAtPos(first, "*/") && !textLine->stringAtPos(first, "*")))
+           ((first < 0) || (!textLine->stringAtPos(first, "*/") && !textLine->stringAtPos(first, "*"))))
       {
         filler = filler + " * ";
       }
Comment 3 Andreas Kling 2006-07-19 18:30:54 UTC
*** Bug 131078 has been marked as a duplicate of this bug. ***