Bug 66983 - KSpread: Cannot export to gnumeric spreadsheet
Summary: KSpread: Cannot export to gnumeric spreadsheet
Status: RESOLVED FIXED
Alias: None
Product: calligrasheets
Classification: Applications
Component: filters (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Ariya Hidayat
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-01 09:22 UTC by Ben Burton
Modified: 2004-08-07 00:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Burton 2003-11-01 09:22:31 UTC
Version:           1.2.94 (using KDE KDE 3.1.4)
Installed from:    Debian testing/unstable Packages
OS:          Linux

Received through the Debian BTS (#200313).

Create a simple spreadsheet (just a handful of numbers, nothing complex) and try to export as a gnumeric worksheet.

The following message appears on the console:

Exporting GNUmeric
koffice (filter manager): WARNING: You already asked for some different source.
csvfilter: ERROR: Unable to open output file!

A "could not save" messagebox appears and no export file is written.

Thanks!
Comment 1 Ville Herva 2004-07-29 18:39:53 UTC
Happens here, too, KDE-3.2.3, Koffice-1.3.2. 

Here's a test case: 
http://bugs.kde.org/attachment.cgi?id=6912&action=view
Comment 3 Nicolas Goutte 2004-08-07 00:17:12 UTC
CVS commit by goutte: 

- Fix Gnumeric export filter (KDE Bug #66983, Debian BTS #200313)
  (For the output file, the input file name was asked but refused by the
  filter system, as the filter uses an import document.)
- A XML file without encoding declaration is in UTF-8, so use UTF-8 instead
  of local encoding
- As we produce now an UTF-8 document, declare it explicitely as UTF-8
  (as it is the implicit KOffice policy.)

Note: as I have not GNumeric installed, I cannot test the file format itself
CCMAIL:66983-close@bugs.kde.org


  M +3 -3      gnumericexport.cc   1.16


--- koffice/filters/kspread/gnumeric/gnumericexport.cc  #1.15:1.16
@@ -308,5 +308,5 @@ KoFilter::ConversionStatus GNUMERICExpor
     /* This could be Made into a function */
 
-  gnumeric_doc.appendChild( gnumeric_doc.createProcessingInstruction( "xml", "version=\"1.0\"" ) );
+  gnumeric_doc.appendChild( gnumeric_doc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) );
 
   QDomElement workbook = gnumeric_doc.createElement("gmr:Workbook");
@@ -589,8 +589,8 @@ Hidden="0"/>
 
     // Ok, now write to export file
-    QCString cstr(str.local8Bit()); // I assume people will prefer local8Bit over utf8... Another param ?
+    const QCString cstr(str.utf8());
 
     gzFile gzfile;
-    gzfile = gzopen( QFile::encodeName(m_chain->inputFile()), "wb");
+    gzfile = gzopen( QFile::encodeName(m_chain->outputFile()), "wb");
 
     if (gzfile==NULL)


Comment 4 Nicolas Goutte 2004-08-07 00:24:08 UTC
CVS commit by goutte: 

Sync with CVS HEAD (except instance name change):
- fix writing (#66983)
- generate UTF-8
- no qDebug()
CCMAIL:66983@bugs.kde.org


  M +4 -4      gnumericexport.cc   1.14.2.1


--- koffice/filters/kspread/gnumeric/gnumericexport.cc  #1.14:1.14.2.1
@@ -278,5 +278,5 @@ QDomElement GNUMERICExport::GetCellStyle
 KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const QCString& to )
 {
-    qDebug("Exporting GNUmeric");
+    kdDebug(30501) << "Exporting GNUmeric" << endl;
 
     QDomDocument gnumeric_doc=QDomDocument("gmr:Workbook");
@@ -308,5 +308,5 @@ KoFilter::ConversionStatus GNUMERICExpor
     /* This could be Made into a function */
 
-  gnumeric_doc.appendChild( gnumeric_doc.createProcessingInstruction( "xml", "version=\"1.0\"" ) );
+  gnumeric_doc.appendChild( gnumeric_doc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) );
 
   QDomElement workbook = gnumeric_doc.createElement("gmr:Workbook");
@@ -589,8 +589,8 @@ Hidden="0"/>
 
     // Ok, now write to export file
-    QCString cstr(str.local8Bit()); // I assume people will prefer local8Bit over utf8... Another param ?
+    const QCString cstr(str.utf8());
 
     gzFile gzfile;
-    gzfile = gzopen( QFile::encodeName(m_chain->inputFile()), "wb");
+    gzfile = gzopen( QFile::encodeName(m_chain->outputFile()), "wb");
 
     if (gzfile==NULL)