[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-07-27 19:02:43
Message-ID: 1185562963.019049.7543.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 693344 by nikolaus:
Filters CSV Import.
Don't insert the default style over and over again; the document's empty.
M +0 -24 csvimport.cc
--- trunk/koffice/filters/kspread/csv/csvimport.cc #693343:693344
@@ -139,8 +139,6 @@
Cell cell( sheet, 1, 1 );
QFontMetrics fm( cell.style().font() );
- Style * s = ksdoc->styleManager()->defaultStyle();
-
for ( int row = 0; row < numRows; ++row )
{
for (int col = 0; col < numCols; ++col)
@@ -164,13 +162,8 @@
//### FIXME: long term solution is to allow to select Generic format \
("autodetect") in the dialog and make it the default
cell = Cell( sheet, col + 1, row + 1 );
- cell.setStyle( *s );
cell.parseUserInput( text );
- Style style;
- style.setFormatType (Format::Generic);
- cell.setStyle(style);
-
/* old code
cell = Cell( sheet, col + 1, row + 1, s );
cell.setValue( Value( text ) );
@@ -188,19 +181,14 @@
if ( !ok )
{
cell = Cell( sheet, col + 1, row + 1 );
- cell.setStyle( *s );
cell.setValue( Value( text ) );
}
else
{
cell = Cell( sheet, col + 1, row + 1 );
- cell.setStyle( *s );
cell.setValue(Value(d));
}
cell.setUserInput(text);
- Style style;
- style.setPrecision( 2 );
- cell.setStyle(style);
break;
}
case CSVDialog::COMMANUMBER:
@@ -214,19 +202,14 @@
if ( !ok )
{
cell = Cell( sheet, col + 1, row + 1 );
- cell.setStyle( *s );
cell.setValue( Value( text ) );
}
else
{
cell = Cell( sheet, col + 1, row + 1 );
- cell.setStyle( *s );
cell.setValue(Value(d));
}
cell.setUserInput(tmp);
- Style style;
- style.setPrecision( 2 );
- cell.setStyle(style);
break;
}
case CSVDialog::POINTNUMBER:
@@ -240,25 +223,19 @@
if ( !ok )
{
cell = Cell( sheet, col + 1, row + 1 );
- cell.setStyle( *s );
cell.setValue( Value( text ) );
}
else
{
cell = Cell( sheet, col + 1, row + 1 );
- cell.setStyle( *s );
cell.setValue(Value(d));
}
cell.setUserInput(tmp);
- Style style;
- style.setPrecision( 2 );
- cell.setStyle(style);
break;
}
case CSVDialog::DATE:
{
cell = Cell( sheet, col + 1, row + 1 );
- cell.setStyle( *s );
cell.setUserInput(text);
cell.setValue(ksdoc->converter()->asDate(Value(text)));
Style style;
@@ -269,7 +246,6 @@
case CSVDialog::CURRENCY:
{
cell = Cell( sheet, col + 1, row + 1 );
- cell.setStyle( *s );
cell.setUserInput(text);
cell.setValue( Value( text ) );
Style style;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic