[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/filters/kspread/csv
From:       Stefan Nikolaus <nikolaus4 () googlemail ! com>
Date:       2007-08-01 9:36:55
Message-ID: 1185961015.989211.8899.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 695055 by nikolaus:

Filters		CSV Import.
		Don't create columns, whose size is the default.


 M  +6 -8      csvimport.cc  


--- trunk/koffice/filters/kspread/csv/csvimport.cc #695054:695055
@@ -133,11 +133,10 @@
     emit sigProgress(value);
     QApplication::setOverrideCursor(Qt::WaitCursor);
 
-    int i;
-    double init = ksdoc->defaultColumnFormat()->width();
+    const double defaultWidth = ksdoc->defaultColumnFormat()->width();
     QVector<double> widths( numCols );
-    for ( i = 0; i < numCols; ++i )
-      widths[i] = init;
+    for (int i = 0; i < numCols; ++i)
+        widths[i] = defaultWidth;
 
     Cell cell( sheet, 1, 1 );
     QFontMetrics fm( cell.style().font() );
@@ -198,11 +197,10 @@
 
     emit sigProgress( 98 );
 
-    ElapsedTime t2( "Resizing columns" );
-    for ( i = 0; i < numCols; ++i )
+    for (int i = 0; i < numCols; ++i)
     {
-      ColumnFormat * c  = sheet->nonDefaultColumnFormat( i + 1 );
-      c->setWidth( widths[i] );
+        if (widths[i] > defaultWidth)
+            sheet->nonDefaultColumnFormat(i + 1)->setWidth(widths[i]);
     }
 
     // Restore the document's decimal symbol and thousands separator.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic