[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PSPP-BUG: [GUI] PSPPire closes unexpectedly when entering text with

From: John Darrington
Subject: Re: PSPP-BUG: [GUI] PSPPire closes unexpectedly when entering text with a length greater than 80 bytes (Utilities | Data File comments)
Date: Sun, 6 Oct 2013 18:28:14 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

I don't seem to be able to reproduce this crash.

It looks as if the code you deleted was designed to move the cursor to the end 
of the text,
after something has been pasted.  Which is probably what the user wants.  

I don't know why is is crashing.  Does it fix the problem if you call  
only if gtk_text_iter_forward_to_line_end returns TRUE ?


On Thu, Oct 03, 2013 at 11:25:46PM -0700, Ben Pfaff wrote:
     On Thu, Oct 03, 2013 at 11:19:35PM -0700, Ben Pfaff wrote:
     > On Thu, Oct 03, 2013 at 10:27:13PM -0700, Basti?n D?az wrote:
     > > 1. Open an empty file or a file with some information (with the gui)
     > > 2. Copy a long text (from a PDF file or from a web page)
     > > 3. Paste the text into window "Data File Comments" in utilities menu 
(Control + V or from the context menu)
     > > 
     > > At that time, psppire closes.
     > Thanks.  I was testing with text that was only a little longer than 80
     > characters.  With a much longer line, like you provided, I also see the
     > crash.
     John, the following patch fixes the crash for me.  The behavior still
     looks otherwise OK to me, but presumably the deleted code was there for
     a reason.  Is this a correct patch?
     diff --git a/src/ui/gui/comments-dialog.c b/src/ui/gui/comments-dialog.c
     index 1d31777..ba312ff 100644
     --- a/src/ui/gui/comments-dialog.c
     +++ b/src/ui/gui/comments-dialog.c
     @@ -1,5 +1,5 @@
      /* PSPPIRE - a graphical user interface for PSPP.
     -   Copyright (C) 2007, 2010, 2011, 2012  Free Software Foundation
     +   Copyright (C) 2007, 2010, 2011, 2012, 2013  Free Software Foundation
         This program is free software: you can redistribute it and/or modify
         it under the terms of the GNU General Public License as published by
     @@ -74,16 +74,10 @@ wrap_line (GtkTextBuffer *buffer,
        if ( chars > DOC_LINE_LENGTH )
            GtkTextIter line_fold = *iter;
     -      GtkTextIter cursor;
            gtk_text_iter_set_line_offset (&line_fold, DOC_LINE_LENGTH);
            gtk_text_buffer_insert (buffer, &line_fold, "\r\n", 2);
     -      cursor = line_fold;
     -      gtk_text_iter_forward_to_line_end (&cursor);
     -      gtk_text_buffer_place_cursor (buffer, &cursor);

PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]