Bug 75781 - last row empty after csv export
Summary: last row empty after csv export
Status: RESOLVED FIXED
Alias: None
Product: calligrasheets
Classification: Applications
Component: filters (show other bugs)
Version: 1.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Ariya Hidayat
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-21 16:48 UTC by klaus
Modified: 2004-08-21 21:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
csv table, delimiter is semicolon (14.53 KB, text/x-csv)
2004-02-21 16:51 UTC, klaus
Details
spreadsheet with the problem (31.95 KB, application/x-kspread)
2004-08-15 22:23 UTC, Raul Fernandes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description klaus 2004-02-21 16:48:18 UTC
Version:           1.3 (using KDE KDE 3.2.0)
Installed from:    SuSE RPMs
OS:          Linux

it is not a general bug but happens to my special file, attached as example

open ex1.csv with kspread choosing semicolon as delimiter.
copy last row (260) to next row (261).
save as original kspread document ex1.ksp and close kspread.
open ex1.ksp, notice row 261 is not empty.
export as zz.csv choosing semicolon as delimiter.
inspect zz.csv: row 261 is empty
Comment 1 klaus 2004-02-21 16:51:01 UTC
Created attachment 4821 [details]
csv table, delimiter is semicolon
Comment 2 Nicolas Goutte 2004-08-09 02:21:47 UTC
I cannot reproduce with KSpread CVS HEAD.
Comment 3 Raul Fernandes 2004-08-15 22:20:43 UTC
I can reproduce this bug here. I am using the kspread cvs 20040815. The line 261 is really empty in the final csv file.
It's worth to note that the formatting is partially lost with the cut and paste. The cols C, D and E are left aligned but the recent created cells C261, D261 and E261 is right aligned. Is this another bug??
I've note one suspicious thing. It seems that every spreadsheet has one row empty in the end of sheet. So, the export filter ignores the last row when exporting.
The spreadsheet created by this way has no empty row in the end of the sheet. So, this is a bug of import filter???
I will upload the spreadsheet with this problem.
Comment 4 Raul Fernandes 2004-08-15 22:23:26 UTC
Created attachment 7126 [details]
spreadsheet with the problem

Check that the spreadsheet doesn't end with a blank row.
Open this spreadsheet and export to cvs file to reproduce this bug.
Comment 5 Nicolas Goutte 2004-08-21 21:20:15 UTC
Now I see it too.
Comment 6 Nicolas Goutte 2004-08-21 21:53:24 UTC
I think I see the problem.

By default, there is a 256x256 sheet, so it needs bigger tables to see that there is a comparison error. (Loop starting with 1 but end check is done with < instead of using <= )
Comment 7 Nicolas Goutte 2004-08-21 21:59:19 UTC
CVS commit by goutte: 

Fix export of big tables
(If the first row/column is numbered 1, then the end test of the for loop has
to be made with <= and not with < only.)
CCMAIL:75781-close@bugs.kde.org


  M +2 -2      csvexport.cc   1.28


--- koffice/filters/kspread/csv/csvexport.cc  #1.27:1.28
@@ -227,5 +227,5 @@ KoFilter::ConversionStatus CSVExport::co
 
       QString emptyLines;
-      for ( int currentrow = 1 ; currentrow < iMaxRow ; ++currentrow, ++i )
+      for ( int currentrow = 1 ; currentrow <= iMaxRow ; ++currentrow, ++i )
       {
         if ( i > step )
@@ -238,5 +238,5 @@ KoFilter::ConversionStatus CSVExport::co
         QString separators;
         QString line;
-        for ( int currentcolumn = 1 ; currentcolumn < iMaxColumn ; currentcolumn++ )
+        for ( int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++ )
         {
           exportCell( sheet, currentcolumn, currentrow, separators, line, csvDelimiter, textQuote );