summaryrefslogtreecommitdiffstats
path: root/filters/kspread/dbase
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
commit8362bf63dea22bbf6736609b0f49c152f975eb63 (patch)
tree0eea3928e39e50fae91d4e68b21b1e6cbae25604 /filters/kspread/dbase
downloadkoffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz
koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'filters/kspread/dbase')
-rw-r--r--filters/kspread/dbase/Makefile.am17
-rw-r--r--filters/kspread/dbase/dbase.cpp251
-rw-r--r--filters/kspread/dbase/dbase.h67
-rw-r--r--filters/kspread/dbase/dbaseimport.cc181
-rw-r--r--filters/kspread/dbase/dbaseimport.h38
-rw-r--r--filters/kspread/dbase/kspread_dbase_import.desktop65
-rw-r--r--filters/kspread/dbase/status.html164
-rwxr-xr-xfilters/kspread/dbase/test/birth.dbfbin0 -> 134 bytes
-rw-r--r--filters/kspread/dbase/test/browser.dbfbin0 -> 167 bytes
-rwxr-xr-xfilters/kspread/dbase/test/stability.dbfbin0 -> 161 bytes
10 files changed, 783 insertions, 0 deletions
diff --git a/filters/kspread/dbase/Makefile.am b/filters/kspread/dbase/Makefile.am
new file mode 100644
index 00000000..29322ab4
--- /dev/null
+++ b/filters/kspread/dbase/Makefile.am
@@ -0,0 +1,17 @@
+####### General stuff
+
+INCLUDES= -I$(srcdir) $(KOFFICE_INCLUDES) $(all_includes)
+
+####### Files
+
+kde_module_LTLIBRARIES = libdbaseimport.la
+
+libdbaseimport_la_SOURCES = dbaseimport.cc dbase.cpp
+libdbaseimport_la_LIBADD = $(KOFFICE_LIBS)
+libdbaseimport_la_LDFLAGS = -module $(KDE_PLUGIN)
+noinst_HEADERS = dbaseimport.h dbase.h
+
+METASOURCES = AUTO
+
+service_DATA = kspread_dbase_import.desktop
+servicedir = $(kde_servicesdir)
diff --git a/filters/kspread/dbase/dbase.cpp b/filters/kspread/dbase/dbase.cpp
new file mode 100644
index 00000000..67780f33
--- /dev/null
+++ b/filters/kspread/dbase/dbase.cpp
@@ -0,0 +1,251 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 by Thomas Franke and Andreas Pietzowski <[email protected]>
+ Ariya Hidayat <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+
+#include <qdatetime.h>
+#include <qdatastream.h>
+#include <qfile.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qptrlist.h>
+
+#include <dbase.h>
+
+DBase::DBase(): m_recordCount( 0 )
+{
+ fields.setAutoDelete( true );
+}
+
+DBase::~DBase()
+{
+ fields.clear();
+ close();
+}
+
+ // Headerdefinition in dBASE
+ //
+ // Type char Content
+ //
+ // unsigned char version 0 dBASE-Version (3)
+ // unsigned char last_update[3] 1-3 Date of last update
+ // unsigned long records 4-7 Number of records
+ // unsigned short header_length 8-9 headerlength
+ // unsigned short record_length 10-11 recordlength
+ // unsigned char reserved[20] 12-31 reserverd info from dBase
+ //
+
+bool DBase::load( const QString& filename )
+{
+
+ m_file.setName( filename );
+ if( !m_file.open(IO_ReadOnly) )
+ return false;
+
+ m_stream.setDevice( &m_file );
+ m_stream.setByteOrder( QDataStream::LittleEndian );
+
+ unsigned filesize = m_file.size();
+
+ // read dBASE version
+ Q_UINT8 ver;
+ m_stream >> ver;
+ m_version = ver & 0x7f; // bit 7: has memo ?
+
+ // only dBASE V.3 is supported
+ if ( m_version != 3 )
+ return false;
+
+ // date of last update
+ Q_UINT8 y, m, d;
+ m_stream >> y >> m >> d;
+ // because dBASE saves 102 instead of 2002 (very Y2K-save ;-)
+ m_lastUpdate.setYMD( y+1900, m, d );
+
+ // check for valid date
+ if( !m_lastUpdate.isValid() ) return false;
+
+ // number of records
+ Q_UINT32 norec;
+ m_stream >> norec;
+ m_recordCount = norec;
+
+ // header-length
+ Q_UINT16 header_length;
+ m_stream >> header_length;
+ m_headerLength = header_length;
+
+ // record-length
+ Q_UINT16 record_length;
+ m_stream >> record_length;
+ m_recordLength = record_length;
+
+ // read the remaining chars
+ Q_UINT8 dummy;
+ for (int foo = 0; foo < 20; ++foo)
+ m_stream >> dummy;
+
+ // size of file must match
+ if( filesize < m_headerLength + m_recordLength * m_recordCount )
+ return false;
+
+ // Now read the headers of the columns and their type
+
+ // Type char Content
+ //
+ // unsigned char field_name[11] 0-10 Fieldname
+ // unsigned char field_type 11 Fieldtype
+ // unsigned long field_address 12-15 Fielddataaddress
+ // unsigned char field_length 16 Fieldlength
+ // unsigned char field_decimals 17 decimals
+ // unsigned char reserved[14] 18-31 reserved for internal dBASE-stuff
+
+ fields.clear();
+ for( unsigned i = 1; i < m_headerLength/32; ++i )
+ {
+ DBaseField* field = new DBaseField;
+
+ // columnn-name
+ Q_UINT8 colname[12];
+ for ( int j = 0; j < 11; ++j)
+ m_stream >> colname[j];
+ colname[11] = '\0';
+ field->name = QString( (const char*) &colname[0] );
+
+ // type of column
+ Q_UINT8 coltype;
+ m_stream >> coltype;
+ switch( coltype )
+ {
+ case 'C': field->type = DBaseField::Character; break;
+ case 'N': field->type = DBaseField::Numeric; break;
+ case 'D': field->type = DBaseField::Date; break;
+ case 'M': field->type = DBaseField::Memo; break;
+ case 'L': field->type = DBaseField::Logical; break;
+ default: field->type = DBaseField::Unknown; break;
+ }
+
+ // fileddataaddress
+ Q_UINT32 addr;
+ m_stream >> addr;
+
+ // columnlength
+ Q_UINT8 colsize;
+ m_stream >> colsize;
+ field->length = colsize;
+
+ // decimals
+ Q_UINT8 decimals;
+ m_stream >> decimals;
+ field->decimals = decimals;
+
+ // read remaining chars
+ Q_UINT8 dummy;
+ for ( int foo = 0; foo < 14; ++foo )
+ m_stream >> dummy;
+
+ // now append
+ fields.append( field );
+ }
+
+ // set the index to the first record
+ m_stream.device()->at( m_headerLength );
+
+ return true;
+}
+
+QStringList DBase::readRecord( unsigned recno )
+{
+ QStringList result;
+
+ // out of range ? return empty strings
+ if( recno >= m_recordCount )
+ {
+ for( unsigned i=0; i<fields.count(); i++)
+ result.append( "" );
+ return result;
+ }
+
+ // seek to where the record is
+ unsigned filepos = m_headerLength + recno * m_recordLength;
+ m_stream.device()->at( filepos );
+
+ // first char == '*' means the record is deleted
+ // so we just skip it
+ Q_UINT8 delmarker;
+ m_stream >> delmarker;
+ if( delmarker == 0x2a )
+ return result;
+
+ // load it
+ for( unsigned i=0; i<fields.count(); i++ )
+ switch( fields.at(i)->type )
+ {
+ // Numeric or Character
+ case DBaseField::Numeric:
+ case DBaseField::Character:
+ {
+ QString str;
+ Q_UINT8 ch;
+ for( unsigned j=0; j<fields.at(i)->length; j++ )
+ { m_stream >> ch; str += QChar(ch); }
+ result.append( str );
+ } break;
+
+ // Logical
+ case DBaseField::Logical:
+ {
+ Q_UINT8 ch;
+ m_stream >> ch;
+ switch( ch )
+ {
+ case 'Y': case 'y': case 'T': case 't': result.append( "True" ); break;
+ case 'N': case 'n': case 'F': case 'f': result.append( "False" ); break;
+ default: result.append( "" ); break;
+ }
+ } break;
+
+ // Date, stored as YYYYMMDD
+ // Note: convert it to YYYY-MM-DD
+ case DBaseField::Date:
+ {
+ QString str;
+ Q_UINT8 ch;
+ for( unsigned j=0; j<fields.at(i)->length; j++ )
+ { m_stream >> ch; str += QChar(ch); }
+ str.insert( 6, '-' );
+ str.insert( 4, '-' );
+ result.append( str );
+ } break;
+
+ // Unknown/Unimplemented
+ case DBaseField::Unknown:
+ case DBaseField::Memo:
+ default:
+ result.append( "" ); // unknown
+ break;
+ }
+
+ return result;
+}
+
+void DBase::close()
+{
+ if( m_file.isOpen() ) m_file.close();
+}
diff --git a/filters/kspread/dbase/dbase.h b/filters/kspread/dbase/dbase.h
new file mode 100644
index 00000000..022d2ba1
--- /dev/null
+++ b/filters/kspread/dbase/dbase.h
@@ -0,0 +1,67 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 by Thomas Franke and Andreas Pietzowski <[email protected]>
+ Ariya Hidayat <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef DBASE_H
+#define DBASE_H
+
+#include <qdatastream.h>
+#include <qdatetime.h>
+#include <qfile.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+class DBaseField
+{
+ public:
+ QString name;
+ enum { Unknown, Character, Date, Numeric, Logical, Memo } type;
+ unsigned length;
+ unsigned decimals;
+};
+
+class DBase
+{
+
+ public:
+ DBase();
+ ~DBase();
+
+ QPtrList<DBaseField> fields;
+
+ bool load( const QString& filename );
+ QStringList readRecord( unsigned recno );
+ void close();
+
+ unsigned recordCount(){ return m_recordCount; }
+ int version(){ return m_version; }
+ QDate lastUpdate(){ return m_lastUpdate; }
+
+ private:
+
+ QFile m_file;
+ QDataStream m_stream;
+ int m_version;
+ QDate m_lastUpdate;
+ unsigned m_recordCount;
+ unsigned m_headerLength;
+ unsigned m_recordLength;
+};
+
+#endif
diff --git a/filters/kspread/dbase/dbaseimport.cc b/filters/kspread/dbase/dbaseimport.cc
new file mode 100644
index 00000000..1c167cd0
--- /dev/null
+++ b/filters/kspread/dbase/dbaseimport.cc
@@ -0,0 +1,181 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Ariya Hidayat <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <config.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <dbaseimport.h>
+#include <dbaseimport.moc>
+#include <dbase.h>
+
+#include <qfile.h>
+#include <qfont.h>
+#include <qfontmetrics.h>
+#include <qstring.h>
+
+#include <kdebug.h>
+#include <KoFilterChain.h>
+#include <KoGlobal.h>
+#include <KoUnit.h>
+#include <kgenericfactory.h>
+#include <kmessagebox.h>
+
+typedef KGenericFactory<DBaseImport, KoFilter> DBaseImportFactory;
+K_EXPORT_COMPONENT_FACTORY( libdbaseimport, DBaseImportFactory( "kofficefilters" ) )
+
+
+DBaseImport::DBaseImport ( QObject*, const char*, const QStringList& )
+ : KoFilter()
+{
+}
+
+KoFilter::ConversionStatus DBaseImport::convert( const QCString& from, const QCString& to )
+{
+ if (to != "application/x-kspread" || from != "application/x-dbase")
+ return KoFilter::NotImplemented;
+
+ QString inputFile = m_chain->inputFile();
+
+ DBase dbase;
+ bool result = dbase.load( inputFile );
+
+ if( dbase.version() !=3 )
+ {
+ KMessageBox::sorry( 0, i18n("File format is not supported.") );
+ return KoFilter::NotImplemented;
+ }
+
+ if( !result )
+ {
+ KMessageBox::sorry( 0, i18n("Could not read from file." ) );
+ return KoFilter::StupidError;
+ }
+
+ QString root, documentInfo;
+
+ root = "<!DOCTYPE spreadsheet >\n";
+ root += "<spreadsheet mime=\"application/x-kspread\" editor=\"KSpread\" >\n";
+ root += "<paper format=\"A4\" orientation=\"Portrait\" >\n";
+ root += "<borders right=\"20\" left=\"20\" bottom=\"20\" top=\"20\" />\n";
+ root += "<head/>\n";
+ root += "<foot/>\n";
+ root += "</paper>\n";
+ root += "<map activeTable=\"Table1\" >\n";
+
+ root += "<locale positivePrefixCurrencySymbol=\"True\"";
+ root += " negativeMonetarySignPosition=\"0\"";
+ root += " negativePrefixCurrencySymbol=\"True\" fracDigits=\"2\"";
+ root += " thousandsSeparator=\",\" dateFormat=\"%A %d %B %Y\"";
+ root += " timeFormat=\"%H:%M:%S\" monetaryDecimalSymbol=\".\"";
+ root += " weekStartsMonday=\"True\" currencySymbol=\"$\"";
+ root += " negativeSign=\"-\" positiveSign=\"\"";
+ root += " positiveMonetarySignPosition=\"1\" decimalSymbol=\".\"";
+ root += " monetaryThousandsSeparator=\",\" dateFormatShort=\"%Y-%m-%d\" />\n";
+
+ root += "<table name=\"Table1\" columnnumber=\"0\" borders=\"0\"";
+ root += " hide=\"0\" hidezero=\"0\" firstletterupper=\"0\" grid=\"1\"";
+ root += " formular=\"0\" lcmode=\"0\" >\n";
+
+ // KOffice default font
+ QFont font = KoGlobal::defaultFont();
+
+ // define columns
+ QFontMetrics fm( font );
+ for( unsigned i=0; i<dbase.fields.count(); i++ )
+ {
+ int mw = QMAX( dbase.fields.at(i)->length, dbase.fields.at(i)->name.length());
+ double w = POINT_TO_MM( fm.maxWidth() * mw );
+ root += "<column column=\"" + QString::number(i+1) + "\"";
+ root += " width=\"" + QString::number( w ) + "\"><format/></column>\n";
+ }
+
+ // define rows
+ double h = POINT_TO_MM( 5 + fm.height() + fm.leading() );
+ for( unsigned j=0; j<dbase.recordCount(); j++ )
+ {
+ root += "<row row=\"" + QString::number(j+1) + "\"";
+ root += " height=\"" + QString::number( h ) + "\" ><format/></row>\n";
+ }
+
+ // field names come as first row
+ for( unsigned i=0; i<dbase.fields.count(); i++ )
+ {
+ root += "<cell row=\"1\" column=\"" + QString::number(i+1) + "\" >\n";
+ root += "<format><pen width=\"0\" style=\"1\" color=\"#000000\" />";
+ root += "<font family=\"" + font.family() + "\"" +
+ " size=\"" + QString::number(font.pointSizeFloat()) + "\"" +
+ " weight=\"50\" />";
+ root += "</format>\n";
+ root += "<text>" + dbase.fields.at(i)->name + "</text></cell>\n";
+ }
+
+ // process all records
+ unsigned row = 1;
+ for( unsigned j=0; j<dbase.recordCount(); j++ )
+ {
+ QStringList rec = dbase.readRecord( j );
+ if( rec.count() )
+ {
+ row++;
+ for( unsigned i=0; i<rec.count(); i++ )
+ {
+ root += "<cell row=\"" + QString::number(row) + "\"" +
+ "column=\"" + QString::number(i+1) + "\" >\n";
+ root += "<format><pen width=\"0\" style=\"1\" color=\"#000000\" />";
+ root += "<font family=\"" + font.family() + "\"" +
+ " size=\"" + QString::number(font.pointSizeFloat()) + "\"" +
+ " weight=\"50\" />";
+ root += "</format>\n";
+ root += "<text>" + rec[i] + "</text></cell>\n";
+ }
+ }
+ }
+
+ dbase.close();
+
+ root += "</table>\n";
+ root += "</map>\n";
+ root += "</spreadsheet>";
+
+ // prepare storage
+ KoStoreDevice* out=m_chain->storageFile( "root", KoStore::Write );
+
+ // store output document
+ if( out )
+ {
+ QCString cstring = root.utf8();
+ cstring.prepend( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" );
+ out->writeBlock( (const char*) cstring, cstring.length() );
+ }
+
+ // store document info
+ out = m_chain->storageFile( "documentinfo.xml", KoStore::Write );
+ if ( out )
+ {
+ QCString cstring = documentInfo.utf8();
+ cstring.prepend( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" );
+
+ out->writeBlock( (const char*) cstring, cstring.length() );
+ }
+
+ return KoFilter::OK;
+}
diff --git a/filters/kspread/dbase/dbaseimport.h b/filters/kspread/dbase/dbaseimport.h
new file mode 100644
index 00000000..b51a7138
--- /dev/null
+++ b/filters/kspread/dbase/dbaseimport.h
@@ -0,0 +1,38 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Ariya Hidayat <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __DBASEIMPORT_H
+#define __DBASEIMPORT_H
+
+#include <KoFilter.h>
+#include <KoStore.h>
+
+class DBaseImport : public KoFilter {
+
+ Q_OBJECT
+
+public:
+
+ DBaseImport ( QObject *parent, const char* name, const QStringList& );
+ virtual ~DBaseImport() {}
+
+ virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to );
+};
+
+#endif // __DBASEIMPORT_H
diff --git a/filters/kspread/dbase/kspread_dbase_import.desktop b/filters/kspread/dbase/kspread_dbase_import.desktop
new file mode 100644
index 00000000..610edd2f
--- /dev/null
+++ b/filters/kspread/dbase/kspread_dbase_import.desktop
@@ -0,0 +1,65 @@
+[Desktop Entry]
+Type=Service
+Name=KSpread dBASE Import Filter
+Name[bg]=Филтър за импортиране от dBASE в KSpread
+Name[br]=Sil enporzh dBASE evit KSpread
+Name[ca]=Filtre d'importació dBASE per a KSpread
+Name[cs]=Importní filtr dBASE pro KSpread
+Name[cy]=Hidlen Fewnforio dBASE Kspread
+Name[da]=KSpread dBASE-importfilter
+Name[de]=KSpread dBASE-Importfilter
+Name[el]=Φίλτρο εισαγωγής dBASE του KSpread
+Name[eo]=dBASE-importfiltrilo por KSpread
+Name[es]=Filtro de importación de dBase para KSpread
+Name[et]=KSpreadi dBASE'i impordifilter
+Name[eu]=KSpread-en dBASE inportaziorako iragazkia
+Name[fa]=پالایۀ واردات KSpread dBASE
+Name[fi]=KSpread dBASE tuontisuodin
+Name[fr]=Filtre d'importation dBASE de Kspread
+Name[fy]=KSpread dBASE Ymportfilter
+Name[ga]=Scagaire Iompórtála dBASE le haghaidh KSpread
+Name[gl]=Filtro de Importación de dBASE para KSpread
+Name[he]=מסנן ייבוא מ־dBASE ל־KSpread
+Name[hi]=के-स्प्रेड डीबेस आयात छननी
+Name[hr]=KSpread dBASE filtar uvoza
+Name[hu]=KSpread dBASE importszűrő
+Name[is]=KSpread dBASE innflutningssía
+Name[it]=Filtro di importazione dBASE per KSpread
+Name[ja]=KSpread dBASE インポートフィルタ
+Name[km]=តម្រង​នាំចូល dBASE សម្រាប់ KSpread
+Name[lo]= ຕົວຕອງການນຳເຂົ້າ dBase ຂອງກະດາດຄຳນວນ K
+Name[lt]=KSpread dBASE importavimo filtras
+Name[lv]=KSpread dBASE importa filtrs
+Name[ms]=Penapis Import KSpread dBASE
+Name[mt]=Filtru għall-importazzjoni ta' dBase ġo KSpread
+Name[nb]=dBASE-importfilter for KSpread
+Name[nds]=dBASE-Importfilter för KSpread
+Name[ne]=केडीई स्प्रिेड डिबेस आयात फिल्टर
+Name[nl]=KSpread dBASE Importfilter
+Name[nn]=dBASE-importfilter for KSpread
+Name[pl]=Filtr importu formatu dBASE do KSpread
+Name[pt]=Filtro de Importação de dBase para o KSpread
+Name[pt_BR]=Filtro de importação KSpread - dBASE
+Name[ru]=Фильтр импорта файлов dBASE в KSpread
+Name[se]=KSpread:a dBASE-sisafievrridansilli
+Name[sk]=dBase filter pre import do KSpread
+Name[sl]=Uvozni filter dBASE za KSpread
+Name[sr]=KSpread-ов филтер за увоз из dBASE-а
+Name[sr@Latn]=KSpread-ov filter za uvoz iz dBASE-a
+Name[sv]=Kspread dBASE-importfilter
+Name[ta]=Kspread dbase இறக்குமதி வடிகட்டி
+Name[tg]=Филтри Воридоти KSpread dBASE
+Name[th]=ตัวกรองการนำเข้า dBase ของกระดาษคำนวณ K
+Name[tr]=KSpread dBASE Alma Filtresi
+Name[uk]=Фільтр імпорту dBASE для KSpread
+Name[uz]=KSpread dBASE import filteri
+Name[uz@cyrillic]=KSpread dBASE импорт филтери
+Name[wa]=Passete dBASE d' intrêye po KSpread
+Name[xh]=Isihluzi Sokurhweba se KSpread dBASE
+Name[zh_CN]=KSpread dBASE 导入过滤器
+Name[zh_TW]=KSpread dBASE 匯入過濾程式
+X-KDE-Export=application/x-kspread
+X-KDE-Import=application/x-dbase
+X-KDE-Weight=1
+X-KDE-Library=libdbaseimport
+ServiceTypes=KOfficeFilter
diff --git a/filters/kspread/dbase/status.html b/filters/kspread/dbase/status.html
new file mode 100644
index 00000000..561cf26e
--- /dev/null
+++ b/filters/kspread/dbase/status.html
@@ -0,0 +1,164 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>KOffice filters status: dBASE</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#000099" vlink="#666666" alink="#666666">
+<A NAME="START">&nbsp;</A>
+
+<BR>
+<center>
+ <h1>
+ KOffice filters status: &nbsp;&nbsp;<i>dBASE</i>
+ </h1>
+</center>
+
+<hr NOSHADE SIZE=2 WIDTH="70%">
+
+<font size="-1"><b>
+ <A HREF="#import">Import</A> |
+ <A HREF="#export">Export</A>
+</b></font>
+
+<BR><BR><BR>
+<center><a NAME="import"></a></center>
+
+<A HREF="#START"><font size="-1"><b>Up</b></font></A>
+<center>
+<table BORDER=0 CELLSPACING=0 BGCOLOR="#000000" WIDTH="100%">
+ <tr>
+ <td>
+ <table BORDER=0 CELLPADDING=2 BGCOLOR="#FFFFFF" WIDTH="100%">
+
+ <tr BGCOLOR="#DDFFDD">
+ <td COLSPAN="2">
+ <center><b><i><font size="+1">
+ <BR>
+ Import dBASE for KSpread<BR>
+ <BR>
+ </font></i></b></center>
+ </td>
+ </tr>
+
+ <tr BGCOLOR="#EEEEFF">
+ <td VALIGN=TOP WIDTH="1%" NOWRAP><b><font size="+1">Last update</font></b></td>
+ <td>27 Mar 2002</td>
+ </tr>
+
+ <tr BGCOLOR="#CCCCFF">
+ <td VALIGN=TOP><b><font size="+1">Features</font></b></td>
+ <td>Can import dBASE document<br>
+ Only support dBASE 3</td>
+ </tr>
+
+ <tr BGCOLOR="#EEEEFF">
+ <td VALIGN=TOP><b><font size="+1">Todo</font></b></td>
+ <td>
+ Support for Memo field
+ </td>
+ </tr>
+
+ <tr BGCOLOR="#CCCCFF">
+ <td VALIGN=TOP><b><font size="+1">History</font></b></td>
+ <td>-</td>
+ </tr>
+
+ <tr BGCOLOR="#EEEEFF">
+ <td VALIGN=TOP><b><font size="+1">Authors</font></b></td>
+ <td>
+ <A HREF="mailto:[email protected]">Ariya Hidayat</A>
+ </td>
+ </tr>
+
+ <tr BGCOLOR="#CCCCFF">
+ <td VALIGN=TOP><b><font size="+1">Links</font></b></td>
+ <td>
+ <a href="http://community.borland.com/article/0,1410,15838,00.html">http://community.borland.com/article/0,1410,15838,00.html</a><br>
+ <a href="http://www.apptools.com/dbase/faq/qformt.htm">dBASE DBF file format</a><br>
+ <a href="http://www.geocities.com/SiliconValley/Pines/2563/xbase.htm">XBase
+file format description</a><br>
+ <a href="http://www.hdk-berlin.de/~rasca/dbflib/">dbflib: another xbase library</a><br>
+ </td>
+ </tr>
+
+ <tr BGCOLOR="#EEEEFF">
+ <td VALIGN=TOP><b><font size="+1">Progress report </font></b></td>
+ <td>-</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+</center>
+<A HREF="#START"><font size="-1"><b>Up</b></font></A>
+
+<br><br><br>
+
+<hr NOSHADE SIZE=1>
+<br><br><br>
+
+
+<center>
+ <a NAME="export"></a>
+</center>
+
+<A HREF="#START"><font size="-1"><b>Up</b></font></A>
+<center>
+<table BORDER=0 CELLSPACING=0 BGCOLOR="#000000" WIDTH="100%">
+ <tr>
+ <td>
+ <table BORDER=0 CELLPADDING=2 BGCOLOR="#FFFFFF" WIDTH="100%">
+ <tr BGCOLOR="#FFDDDD">
+ <td COLSPAN="2">
+ <center><b><i><font size="+1">
+ <BR>Export KSpread to dBASE<BR><BR>
+ </font></i></b></center>
+ </td>
+ </tr>
+
+ <tr BGCOLOR="#EEEEFF">
+ <td VALIGN=TOP WIDTH="1%" NOWRAP><b><font size="+1">Last update</font></b></td>
+ <td>?</td>
+ </tr>
+
+ <tr BGCOLOR="#CCCCFF">
+ <td VALIGN=TOP><b><font size="+1">Features</font></b></td>
+ <td>?</td>
+ </tr>
+
+ <tr BGCOLOR="#EEEEFF">
+ <td VALIGN=TOP><b><font size="+1">Todo</font></b></td>
+ <td>?</td>
+ </tr>
+
+ <tr BGCOLOR="#CCCCFF">
+ <td VALIGN=TOP><b><font size="+1">History</font></b></td>
+ <td>-</td>
+ </tr>
+
+ <tr BGCOLOR="#EEEEFF">
+ <td VALIGN=TOP><b><font size="+1">Authors</font></b></td>
+ <td>
+ <A HREF="mailto:[email protected]">Ariya Hidayat</A>
+ </td>
+ </tr>
+
+ <tr BGCOLOR="#CCCCFF">
+ <td VALIGN=TOP><b><font size="+1">Links</font></b></td>
+ <td>-</td>
+ </tr>
+
+ <tr BGCOLOR="#EEEEFF">
+ <td VALIGN=TOP><b><font size="+1">Progress report </font></b></td>
+ <td>---</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+</center>
+<A HREF="#START"><font size="-1"><b>Up</b></font></A>
+
+</body>
+</html>
diff --git a/filters/kspread/dbase/test/birth.dbf b/filters/kspread/dbase/test/birth.dbf
new file mode 100755
index 00000000..f836c7a4
--- /dev/null
+++ b/filters/kspread/dbase/test/birth.dbf
Binary files differ
diff --git a/filters/kspread/dbase/test/browser.dbf b/filters/kspread/dbase/test/browser.dbf
new file mode 100644
index 00000000..38aab826
--- /dev/null
+++ b/filters/kspread/dbase/test/browser.dbf
Binary files differ
diff --git a/filters/kspread/dbase/test/stability.dbf b/filters/kspread/dbase/test/stability.dbf
new file mode 100755
index 00000000..d4d3554d
--- /dev/null
+++ b/filters/kspread/dbase/test/stability.dbf
Binary files differ