<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Should have read...<br>
<br>
At line line 1517 it is used to initialise '<b>m_topLine</b>' which
in turn is used to initialise 'row' at line 1546<br>
<br>
Chris<br>
<br>
<div class="moz-cite-prefix">On 15/04/2014 8:23 PM, Chris wrote:<br>
</div>
<blockquote cite="mid:534D0F99.2080306@rebel.com.au" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hi Allan<br>
<br>
Hoping you can give me some insight here.<br>
<br>
On windows when trying to import I get an exception. The
application is trying to dereference a null pointer with the usual
consequence.<br>
<br>
The problem is after loading the table object with the imported
file it then tries to reference the cell location [-1,0] this
returns a null pointer and thus crashes.<br>
<br>
I have done a trace through the code and have discovered the
following.<br>
<br>
The csvdialog object has a field called m_startLine which by
default is set to 1.<br>
101: m_startLine = 1;<br>
<br>
At line 640 in csvdialog.cpp it is set to default to zero if it
doesn't exist in the profile. This seems ok and I assume the +1
covers a boundary condition<br>
640: m_startLine = profilesGroup.readEntry("StartLine", -1) + 1;
(was the -1 meant to be 0?)<br>
<br>
At line 908 it is used as a parameter and decremented to -1<br>
908: redrawWindow(m_startLine - 1);<br>
<br>
At line line 1517 it is used to initialise 'm_startLine' which in
turn is used to initialise 'row' at line 1546<br>
<br>
At line 1561, row (set to -1) is used to index the table<br>
1561: label.setText(ui->tableWidget->item(<b>row</b>,
col)->text());<br>
<br>
At that point it throws an exception as
ui->tableWidget->item(row, col) returns a null pointer (by
design) and there is no checking of the return value nor checking
of the index before it is used.<br>
<br>
I assume this is a bug. What I am not sure about is what it should
have been set to to start with -1, 0 or 1? as I said the default
before loading a profile is 1.<br>
<br>
What really confuses me is on kubuntu I don't get an error with
the same import file (actually it crashed the first time, but
didn't again after I recreated the profile).<br>
<br>
Can you please advise where the error seems to be?<br>
<br>
Chris<br>
</blockquote>
<br>
</body>
</html>