[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:34:17
Message-ID: 1185564857.445576.11019.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 693352 by nikolaus:

Filters		CSV Import.
		Use Value's formats instead of setting an equivalent style.


 M  +5 -14     csvimport.cc  


--- trunk/koffice/filters/kspread/csv/csvimport.cc #693351:693352
@@ -33,14 +33,14 @@
 
 #include <KoFilterChain.h>
 #include <KoFilterManager.h>
+
+#include <kspread/Cell.h>
 #include <kspread/Doc.h>
 #include <kspread/Global.h>
 #include <kspread/Map.h>
 #include <kspread/RowColumnFormat.h>
 #include <kspread/Sheet.h>
 #include <kspread/Style.h>
-#include <kspread/StyleManager.h>
-#include <kspread/Cell.h>
 #include <kspread/Value.h>
 #include <kspread/ValueConverter.h>
 
@@ -71,8 +71,6 @@
     if ( !document )
         return KoFilter::StupidError;
 
-    kDebug(30501) << "here we go... " << document->metaObject()->className() << \
                endl;
-
     if ( !qobject_cast<const KSpread::Doc *>( document ) )
     {
       kWarning(30501) << "document isn't a KSpread::Doc but a " << \
document->metaObject()->className() << endl; @@ -84,8 +82,6 @@
         return KoFilter::NotImplemented;
     }
 
-    kDebug(30501) << "...still here..." << endl;
-
     Doc *ksdoc = static_cast<Doc *>( document ); // type checked above
 
     if(ksdoc->mimeType()!="application/x-kspread")
@@ -238,20 +234,15 @@
               cell = Cell( sheet, col + 1, row + 1 );
               cell.setUserInput(text);
               cell.setValue(ksdoc->converter()->asDate(Value(text)));
-              Style style;
-              style.setFormatType( Format::ShortDate );
-              cell.setStyle(style);
               break;
              }
              case CSVDialog::CURRENCY:
              {
               cell = Cell( sheet, col + 1, row + 1 );
               cell.setUserInput(text);
-              cell.setValue( Value( text ) );
-              Style style;
-              style.setFormatType( Format::Money );
-              style.setPrecision( 2 );
-              cell.setStyle(style);
+              Value value(text);
+              value.setFormat(Value::fmt_Money);
+              cell.setValue(value);
               break;
              }
             }


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

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