From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: TQt4 port koffice This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- filters/kspread/opencalc/opencalcexport.cc | 364 +++++------ filters/kspread/opencalc/opencalcexport.h | 35 +- filters/kspread/opencalc/opencalcimport.cc | 810 ++++++++++++------------ filters/kspread/opencalc/opencalcimport.h | 93 +-- filters/kspread/opencalc/opencalcstyleexport.cc | 106 ++-- filters/kspread/opencalc/opencalcstyleexport.h | 82 +-- filters/kspread/opencalc/status.html | 12 +- 7 files changed, 752 insertions(+), 750 deletions(-) (limited to 'filters/kspread/opencalc') diff --git a/filters/kspread/opencalc/opencalcexport.cc b/filters/kspread/opencalc/opencalcexport.cc index 20915b51..f38b0bb8 100644 --- a/filters/kspread/opencalc/opencalcexport.cc +++ b/filters/kspread/opencalc/opencalcexport.cc @@ -24,11 +24,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -55,7 +55,7 @@ using namespace KSpread; -typedef QValueList AreaList; +typedef TQValueList AreaList; class OpenCalcExportFactory : KGenericFactory { @@ -78,20 +78,20 @@ K_EXPORT_COMPONENT_FACTORY( libopencalcexport, OpenCalcExportFactory() ) return false; \ } while(0) -OpenCalcExport::OpenCalcExport( KoFilter *, const char *, const QStringList & ) +OpenCalcExport::OpenCalcExport( KoFilter *, const char *, const TQStringList & ) : KoFilter(), m_locale( 0 ) { } -KoFilter::ConversionStatus OpenCalcExport::convert( const QCString & from, - const QCString & to ) +KoFilter::ConversiontqStatus OpenCalcExport::convert( const TQCString & from, + const TQCString & to ) { /* later... KSpreadLeader * leader = new KSpreadLeader( m_chain ); OpenCalcWorker * worker = new OpenCalcWorker(); leader->setWorker( worker ); - KoFilter::ConversionStatus status = leader->convert(); + KoFilter::ConversiontqStatus status = leader->convert(); delete worker; delete leader; @@ -104,7 +104,7 @@ KoFilter::ConversionStatus OpenCalcExport::convert( const QCString & from, if ( !document ) return KoFilter::StupidError; - if ( !::qt_cast( document ) ) + if ( !::tqqt_cast( document ) ) { kdWarning(30518) << "document isn't a KSpread::Doc but a " << document->className() << endl; @@ -183,20 +183,20 @@ bool OpenCalcExport::exportDocInfo( KoStore * store, const Doc* ksdoc ) KoDocumentInfoAbout * aboutPage = static_cast( docInfo->page( "about" ) ); KoDocumentInfoAuthor * authorPage = static_cast( docInfo->page( "author" ) ); - QDomDocument meta; + TQDomDocument meta; meta.appendChild( meta.createProcessingInstruction( "xml","version=\"1.0\" encoding=\"UTF-8\"" ) ); - QDomElement content = meta.createElement( "office:document-meta" ); + TQDomElement content = meta.createElement( "office:document-meta" ); content.setAttribute( "xmlns:office", "http://openoffice.org/2000/office"); content.setAttribute( "xmlns:xlink", "http://www.w3.org/1999/xlink" ); content.setAttribute( "xmlns:dc", "http://purl.org/dc/elements/1.1/" ); content.setAttribute( "xmlns:meta", "http://openoffice.org/2000/meta" ); content.setAttribute( "office:version", "1.0" ); - QDomNode officeMeta = meta.createElement( "office:meta" ); + TQDomNode officeMeta = meta.createElement( "office:meta" ); - QDomElement data = meta.createElement( "meta:generator" ); - QString app( "KSpread " ); + TQDomElement data = meta.createElement( "meta:generator" ); + TQString app( "KSpread " ); app += KSpread::version; data.appendChild( meta.createTextNode( app ) ); officeMeta.appendChild( data ); @@ -214,7 +214,7 @@ bool OpenCalcExport::exportDocInfo( KoStore * store, const Doc* ksdoc ) officeMeta.appendChild( data ); data = meta.createElement( "meta:keywords" ); - QDomElement dataItem = meta.createElement( "meta:keyword" ); + TQDomElement dataItem = meta.createElement( "meta:keyword" ); dataItem.appendChild( meta.createTextNode( aboutPage->keywords() ) ); data.appendChild( dataItem ); officeMeta.appendChild( data ); @@ -227,7 +227,7 @@ bool OpenCalcExport::exportDocInfo( KoStore * store, const Doc* ksdoc ) data.appendChild( meta.createTextNode( aboutPage->subject() ) ); officeMeta.appendChild( data ); - const QDateTime dt ( QDateTime::currentDateTime() ); + const TQDateTime dt ( TQDateTime::tqcurrentDateTime() ); if ( dt.isValid() ) { data = meta.createElement( "dc:date" ); @@ -245,14 +245,14 @@ bool OpenCalcExport::exportDocInfo( KoStore * store, const Doc* ksdoc ) */ data = meta.createElement( "meta:document-statistic" ); - data.setAttribute( "meta:table-count", QString::number( ksdoc->map()->count() ) ); + data.setAttribute( "meta:table-count", TQString::number( ksdoc->map()->count() ) ); // TODO: data.setAttribute( "meta:cell-count", ); officeMeta.appendChild( data ); content.appendChild( officeMeta ); meta.appendChild( content ); - QCString doc( meta.toCString() ); + TQCString doc( meta.toCString() ); kdDebug(30518) << "Meta: " << doc << endl; store->write( doc, doc.length() ); @@ -268,32 +268,32 @@ bool OpenCalcExport::exportSettings( KoStore * store, const Doc * ksdoc ) if ( !store->open( "settings.xml" ) ) return false; - QDomDocument doc; + TQDomDocument doc; doc.appendChild( doc.createProcessingInstruction( "xml","version=\"1.0\" encoding=\"UTF-8\"" ) ); - QDomElement settings = doc.createElement( "office:document-settings" ); + TQDomElement settings = doc.createElement( "office:document-settings" ); settings.setAttribute( "xmlns:office", "http://openoffice.org/2000/office"); settings.setAttribute( "xmlns:xlink", "http://www.w3.org/1999/xlink" ); settings.setAttribute( "xmlns:config", "http://openoffice.org/2001/config" ); settings.setAttribute( "office:version", "1.0" ); - QDomElement begin = doc.createElement( "office:settings" ); + TQDomElement begin = doc.createElement( "office:settings" ); - QDomElement configItem = doc.createElement("config:config-item-set" ); + TQDomElement configItem = doc.createElement("config:config-item-set" ); configItem.setAttribute( "config:name", "view-settings" ); - QDomElement mapIndexed = doc.createElement( "config:config-item-map-indexed" ); + TQDomElement mapIndexed = doc.createElement( "config:config-item-map-indexed" ); mapIndexed.setAttribute("config:name", "Views" ); configItem.appendChild( mapIndexed ); - QDomElement mapItem = doc.createElement("config:config-item-map-entry" ); + TQDomElement mapItem = doc.createElement("config:config-item-map-entry" ); - QDomElement attribute = doc.createElement("config:config-item" ); + TQDomElement attribute = doc.createElement("config:config-item" ); attribute.setAttribute( "config:name", "ActiveTable" ); attribute.setAttribute( "config:type", "string" ); View * view = static_cast( ksdoc->views().getFirst()); - QString activeTable; + TQString activeTable; if ( view ) // no view if embedded document { Canvas * canvas = view->canvasWidget(); @@ -304,30 +304,30 @@ bool OpenCalcExport::exportSettings( KoStore * store, const Doc * ksdoc ) attribute.appendChild( doc.createTextNode( activeTable ) ); mapItem.appendChild( attribute ); - QDomElement configmaped = doc.createElement( "config:config-item-map-named" ); + TQDomElement configmaped = doc.createElement( "config:config-item-map-named" ); configmaped.setAttribute( "config:name","Tables" ); - QPtrListIterator it( ksdoc->map()->sheetList() ); + TQPtrListIterator it( ksdoc->map()->sheetList() ); for( ; it.current(); ++it ) { - QPoint marker; + TQPoint marker; if ( view ) { marker = view->markerFromSheet( *it ); } - QDomElement tmpItemMapNamed = doc.createElement( "config:config-item-map-entry" ); + TQDomElement tmpItemMapNamed = doc.createElement( "config:config-item-map-entry" ); tmpItemMapNamed.setAttribute( "config:name", ( *it )->tableName() ); - QDomElement sheetAttribute = doc.createElement( "config:config-item" ); + TQDomElement sheetAttribute = doc.createElement( "config:config-item" ); sheetAttribute.setAttribute( "config:name", "CursorPositionX" ); sheetAttribute.setAttribute( "config:type", "int" ); - sheetAttribute.appendChild( doc.createTextNode( QString::number(marker.x() ) ) ); + sheetAttribute.appendChild( doc.createTextNode( TQString::number(marker.x() ) ) ); tmpItemMapNamed.appendChild( sheetAttribute ); sheetAttribute = doc.createElement( "config:config-item" ); sheetAttribute.setAttribute( "config:name", "CursorPositionY" ); sheetAttribute.setAttribute( "config:type", "int" ); - sheetAttribute.appendChild( doc.createTextNode( QString::number(marker.y() ) ) ); + sheetAttribute.appendChild( doc.createTextNode( TQString::number(marker.y() ) ) ); tmpItemMapNamed.appendChild( sheetAttribute ); configmaped.appendChild( tmpItemMapNamed ); @@ -344,7 +344,7 @@ bool OpenCalcExport::exportSettings( KoStore * store, const Doc * ksdoc ) doc.appendChild( settings ); - QCString f( doc.toCString() ); + TQCString f( doc.toCString() ); kdDebug(30518) << "Settings: " << (char const * ) f << endl; store->write( f, f.length() ); @@ -362,10 +362,10 @@ bool OpenCalcExport::exportContent( KoStore * store, const Doc * ksdoc ) createDefaultStyles(); - QDomDocument doc; + TQDomDocument doc; doc.appendChild( doc.createProcessingInstruction( "xml","version=\"1.0\" encoding=\"UTF-8\"" ) ); - QDomElement content = doc.createElement( "office:document-content" ); + TQDomElement content = doc.createElement( "office:document-content" ); content.setAttribute( "xmlns:office", "http://openoffice.org/2000/office"); content.setAttribute( "xmlns:style", "http://openoffice.org/2000/style" ); content.setAttribute( "xmlns:text", "http://openoffice.org/2000/text" ); @@ -383,7 +383,7 @@ bool OpenCalcExport::exportContent( KoStore * store, const Doc * ksdoc ) content.setAttribute( "office:class", "spreadsheet" ); content.setAttribute( "office:version", "1.0" ); - QDomElement data = doc.createElement( "office:script" ); + TQDomElement data = doc.createElement( "office:script" ); content.appendChild( data ); if ( !exportBody( doc, content, ksdoc ) ) @@ -391,7 +391,7 @@ bool OpenCalcExport::exportContent( KoStore * store, const Doc * ksdoc ) doc.appendChild( content ); - QCString f( doc.toCString() ); + TQCString f( doc.toCString() ); kdDebug(30518) << "Content: " << (char const * ) f << endl; store->write( f, f.length() ); @@ -402,7 +402,7 @@ bool OpenCalcExport::exportContent( KoStore * store, const Doc * ksdoc ) return true; } -void exportNamedExpr( QDomDocument & doc, QDomElement & parent, +void exportNamedExpr( TQDomDocument & doc, TQDomElement & tqparent, AreaList const & namedAreas ) { AreaList::const_iterator it = namedAreas.begin(); @@ -410,7 +410,7 @@ void exportNamedExpr( QDomDocument & doc, QDomElement & parent, while ( it != end ) { - QDomElement namedRange = doc.createElement( "table:named-range" ); + TQDomElement namedRange = doc.createElement( "table:named-range" ); Reference ref = *it; @@ -418,34 +418,34 @@ void exportNamedExpr( QDomDocument & doc, QDomElement & parent, namedRange.setAttribute( "table:base-cell-address", convertRefToBase( ref.sheet_name, ref.rect ) ); namedRange.setAttribute( "table:cell-range-address", convertRefToRange( ref.sheet_name, ref.rect ) ); - parent.appendChild( namedRange ); + tqparent.appendChild( namedRange ); ++it; } } -bool OpenCalcExport::exportBody( QDomDocument & doc, QDomElement & content, const Doc * ksdoc ) +bool OpenCalcExport::exportBody( TQDomDocument & doc, TQDomElement & content, const Doc * ksdoc ) { - QDomElement fontDecls = doc.createElement( "office:font-decls" ); - QDomElement autoStyles = doc.createElement( "office:automatic-styles" ); - QDomElement body = doc.createElement( "office:body" ); + TQDomElement fontDecls = doc.createElement( "office:font-decls" ); + TQDomElement autoStyles = doc.createElement( "office:automatic-styles" ); + TQDomElement body = doc.createElement( "office:body" ); if ( ksdoc->map()->isProtected() ) { body.setAttribute( "table:structure-protected", "true" ); - QCString passwd; + TQCString passwd; ksdoc->map()->password( passwd ); if ( passwd.length() > 0 ) { - QCString str( KCodecs::base64Encode( passwd ) ); - body.setAttribute( "table:protection-key", QString( str.data() ) ); + TQCString str( KCodecs::base64Encode( passwd ) ); + body.setAttribute( "table:protection-key", TQString( str.data() ) ); } } - QPtrListIterator it( ksdoc->map()->sheetList() ); + TQPtrListIterator it( ksdoc->map()->sheetList() ); for( it.toFirst(); it.current(); ++it ) { @@ -456,37 +456,37 @@ bool OpenCalcExport::exportBody( QDomDocument & doc, QDomElement & content, cons ts.visible = !sheet->isHidden(); - QDomElement tabElem = doc.createElement( "table:table" ); + TQDomElement tabElem = doc.createElement( "table:table" ); tabElem.setAttribute( "table:style-name", m_styles.sheetStyle( ts ) ); if ( sheet->isProtected() ) { tabElem.setAttribute( "table:protected", "true" ); - QCString passwd; + TQCString passwd; sheet->password( passwd ); if ( passwd.length() > 0 ) { - QCString str( KCodecs::base64Encode( passwd ) ); - tabElem.setAttribute( "table:protection-key", QString( str.data() ) ); + TQCString str( KCodecs::base64Encode( passwd ) ); + tabElem.setAttribute( "table:protection-key", TQString( str.data() ) ); } } - QString name( sheet->tableName() ); + TQString name( sheet->tableName() ); - int n = name.find( ' ' ); + int n = name.tqfind( ' ' ); if ( n != -1 ) { kdDebug(30518) << "Sheet name converting: " << name << endl; name[n] == '_'; kdDebug(30518) << "Sheet name converted: " << name << endl; } - name = name.replace( ' ', "_" ); + name = name.tqreplace( ' ', "_" ); - QRect _printRange = sheet->print()->printRange(); - if ( _printRange != ( QRect( QPoint( 1, 1 ), QPoint( KS_colMax, KS_rowMax ) ) ) ) + TQRect _printRange = sheet->print()->printRange(); + if ( _printRange != ( TQRect( TQPoint( 1, 1 ), TQPoint( KS_colMax, KS_rowMax ) ) ) ) { - QString range= convertRangeToRef( name, _printRange ); + TQString range= convertRangeToRef( name, _printRange ); //kdDebug(30518)<<" range : "<listArea(); if ( namedAreas.count() > 0 ) { - QDomElement namedExpr = doc.createElement( "table:named-expressions" ); + TQDomElement namedExpr = doc.createElement( "table:named-expressions" ); exportNamedExpr( doc, namedExpr, namedAreas ); body.appendChild( namedExpr ); @@ -523,7 +523,7 @@ bool OpenCalcExport::exportBody( QDomDocument & doc, QDomElement & content, cons return true; } -void OpenCalcExport::exportSheet( QDomDocument & doc, QDomElement & tabElem, +void OpenCalcExport::exportSheet( TQDomDocument & doc, TQDomElement & tabElem, const Sheet * sheet, int maxCols, int maxRows ) { kdDebug(30518) << "exportSheet: " << sheet->tableName() << endl; @@ -553,14 +553,14 @@ void OpenCalcExport::exportSheet( QDomDocument & doc, QDomElement & tabElem, ++j; } - QDomElement colElem = doc.createElement( "table:table-column" ); + TQDomElement colElem = doc.createElement( "table:table-column" ); colElem.setAttribute( "table:style-name", m_styles.columnStyle( cs ) ); colElem.setAttribute( "table:default-cell-style-name", "Default" );//todo fixme create style from cell if ( hide ) colElem.setAttribute( "table:visibility", "collapse" ); if ( repeated > 1 ) - colElem.setAttribute( "table:number-columns-repeated", QString::number( repeated ) ); + colElem.setAttribute( "table:number-columns-repeated", TQString::number( repeated ) ); tabElem.appendChild( colElem ); i += repeated; @@ -573,7 +573,7 @@ void OpenCalcExport::exportSheet( QDomDocument & doc, QDomElement & tabElem, rs.breakB = ::Style::automatic; rs.size = row->mmHeight() / 10; - QDomElement rowElem = doc.createElement( "table:table-row" ); + TQDomElement rowElem = doc.createElement( "table:table-row" ); rowElem.setAttribute( "table:style-name", m_styles.rowStyle( rs ) ); if ( row->isHide() ) rowElem.setAttribute( "table:visibility", "collapse" ); @@ -584,7 +584,7 @@ void OpenCalcExport::exportSheet( QDomDocument & doc, QDomElement & tabElem, } } -void OpenCalcExport::exportCells( QDomDocument & doc, QDomElement & rowElem, +void OpenCalcExport::exportCells( TQDomDocument & doc, TQDomElement & rowElem, const Sheet *sheet, int row, int maxCols ) { int i = 1; @@ -593,14 +593,14 @@ void OpenCalcExport::exportCells( QDomDocument & doc, QDomElement & rowElem, int repeated = 1; bool hasComment = false; const Cell* cell = sheet->cellAt( i, row ); - QDomElement cellElem; + TQDomElement cellElem; if ( !cell->isPartOfMerged() ) cellElem = doc.createElement( "table:table-cell" ); else cellElem = doc.createElement( "table:covered-table-cell" ); - QFont font; + TQFont font; Value const value( cell->value() ); if ( !cell->isDefault() ) { @@ -635,7 +635,7 @@ void OpenCalcExport::exportCells( QDomDocument & doc, QDomElement & rowElem, ++j; } if ( repeated > 1 ) - cellElem.setAttribute( "table:number-columns-repeated", QString::number( repeated ) ); + cellElem.setAttribute( "table:number-columns-repeated", TQString::number( repeated ) ); } if ( value.isBoolean() ) @@ -654,7 +654,7 @@ void OpenCalcExport::exportCells( QDomDocument & doc, QDomElement & rowElem, else cellElem.setAttribute( "table:value-type", "float" ); - cellElem.setAttribute( "table:value", QString::number( value.asFloat() ) ); + cellElem.setAttribute( "table:value", TQString::number( value.asFloat() ) ); } else { @@ -665,15 +665,15 @@ void OpenCalcExport::exportCells( QDomDocument & doc, QDomElement & rowElem, { kdDebug(30518) << "Formula found" << endl; - QString formula( convertFormula( cell->text() ) ); + TQString formula( convertFormula( cell->text() ) ); cellElem.setAttribute( "table:formula", formula ); } else if ( !cell->link().isEmpty() ) { - QDomElement link = doc.createElement( "text:p" ); - QDomElement linkref = doc.createElement( "text:a" ); + TQDomElement link = doc.createElement( "text:p" ); + TQDomElement linkref = doc.createElement( "text:a" ); - QString tmp = cell->link(); + TQString tmp = cell->link(); if ( localReferenceAnchor( tmp ) ) linkref.setAttribute( "xlink:href", ( "#"+tmp ) ); else @@ -686,7 +686,7 @@ void OpenCalcExport::exportCells( QDomDocument & doc, QDomElement & rowElem, } else if ( !cell->isEmpty() ) { - QDomElement textElem = doc.createElement( "text:p" ); + TQDomElement textElem = doc.createElement( "text:p" ); textElem.appendChild( doc.createTextNode( cell->strOutText() ) ); cellElem.appendChild( textElem ); @@ -699,17 +699,17 @@ void OpenCalcExport::exportCells( QDomDocument & doc, QDomElement & rowElem, int rowSpan = cell->mergedYCells() + 1; if ( colSpan > 1 ) - cellElem.setAttribute( "table:number-columns-spanned", QString::number( colSpan ) ); + cellElem.setAttribute( "table:number-columns-spanned", TQString::number( colSpan ) ); if ( rowSpan > 1 ) - cellElem.setAttribute( "table:number-rows-spanned", QString::number( rowSpan ) ); + cellElem.setAttribute( "table:number-rows-spanned", TQString::number( rowSpan ) ); } if ( hasComment ) { - QString comment( cell->format()->comment( i, row ) ); - QDomElement annotation = doc.createElement( "office:annotation" ); - QDomElement text = doc.createElement( "text:p" ); + TQString comment( cell->format()->comment( i, row ) ); + TQDomElement annotation = doc.createElement( "office:annotation" ); + TQDomElement text = doc.createElement( "text:p" ); text.appendChild( doc.createTextNode( comment ) ); annotation.appendChild( text ); @@ -764,10 +764,10 @@ bool OpenCalcExport::exportStyles( KoStore * store, const Doc *ksdoc ) if ( !store->open( "styles.xml" ) ) return false; - QDomDocument doc; + TQDomDocument doc; doc.appendChild( doc.createProcessingInstruction( "xml","version=\"1.0\" encoding=\"UTF-8\"" ) ); - QDomElement content = doc.createElement( "office:document-styles" ); + TQDomElement content = doc.createElement( "office:document-styles" ); content.setAttribute( "xmlns:office", "http://openoffice.org/2000/office" ); content.setAttribute( "xmlns:style", "http://openoffice.org/2000/style" ); content.setAttribute( "xmlns:text", "http://openoffice.org/2000/text" ); @@ -785,24 +785,24 @@ bool OpenCalcExport::exportStyles( KoStore * store, const Doc *ksdoc ) content.setAttribute( "office:version", "1.0" ); // order important here! - QDomElement officeStyles = doc.createElement( "office:styles" ); + TQDomElement officeStyles = doc.createElement( "office:styles" ); exportDefaultCellStyle( doc, officeStyles ); - QDomElement fontDecls = doc.createElement( "office:font-decls" ); + TQDomElement fontDecls = doc.createElement( "office:font-decls" ); m_styles.writeFontDecl( doc, fontDecls ); // TODO: needs in new number/date/time parser... // exportDefaultNumberStyles( doc, officeStyles ); - QDomElement defaultStyle = doc.createElement( "style:style" ); + TQDomElement defaultStyle = doc.createElement( "style:style" ); defaultStyle.setAttribute( "style:name", "Default" ); defaultStyle.setAttribute( "style:family", "table-cell" ); officeStyles.appendChild( defaultStyle ); - QDomElement autoStyles = doc.createElement( "office:automatic-styles" ); + TQDomElement autoStyles = doc.createElement( "office:automatic-styles" ); exportPageAutoStyles( doc, autoStyles, ksdoc ); - QDomElement masterStyles = doc.createElement( "office:master-styles" ); + TQDomElement masterStyles = doc.createElement( "office:master-styles" ); exportMasterStyles( doc, masterStyles, ksdoc ); content.appendChild( fontDecls ); @@ -812,7 +812,7 @@ bool OpenCalcExport::exportStyles( KoStore * store, const Doc *ksdoc ) doc.appendChild( content ); - QCString f( doc.toCString() ); + TQCString f( doc.toCString() ); kdDebug(30518) << "Content: " << (char const * ) f << endl; store->write( f, f.length() ); @@ -823,9 +823,9 @@ bool OpenCalcExport::exportStyles( KoStore * store, const Doc *ksdoc ) return true; } -void OpenCalcExport::exportDefaultCellStyle( QDomDocument & doc, QDomElement & officeStyles ) +void OpenCalcExport::exportDefaultCellStyle( TQDomDocument & doc, TQDomElement & officeStyles ) { - QDomElement defStyle = doc.createElement( "style:default-style" ); + TQDomElement defStyle = doc.createElement( "style:default-style" ); defStyle.setAttribute( "style:family", "table-cell" ); KoDocument * document = m_chain->inputDocument(); @@ -833,19 +833,19 @@ void OpenCalcExport::exportDefaultCellStyle( QDomDocument & doc, QDomElement & o Format * format = new Format( 0, ksdoc->styleManager()->defaultStyle() ); const KLocale *locale = ksdoc->locale(); - QString language; - QString country; - QString charSet; + TQString language; + TQString country; + TQString charSet; - QString l( locale->language() ); + TQString l( locale->language() ); KLocale::splitLocale( l, language, country, charSet ); - QFont font( format->font() ); + TQFont font( format->font() ); m_styles.addFont( font, true ); - QDomElement style = doc.createElement( "style:properties" ); + TQDomElement style = doc.createElement( "style:properties" ); style.setAttribute( "style:font-name", font.family() ); - style.setAttribute( "fo:font-size", QString( "%1pt" ).arg( font.pointSize() ) ); - style.setAttribute( "style:decimal-places", QString::number( locale->fracDigits() ) ); + style.setAttribute( "fo:font-size", TQString( "%1pt" ).tqarg( font.pointSize() ) ); + style.setAttribute( "style:decimal-places", TQString::number( locale->fracDigits() ) ); style.setAttribute( "fo:language", language ); style.setAttribute( "fo:country", country ); style.setAttribute( "style:font-name-asian", "HG Mincho Light J" ); @@ -866,10 +866,10 @@ void OpenCalcExport::createDefaultStyles() // TODO: default number styles, currency styles,... } -void OpenCalcExport::exportPageAutoStyles( QDomDocument & doc, QDomElement & autoStyles, +void OpenCalcExport::exportPageAutoStyles( TQDomDocument & doc, TQDomElement & autoStyles, const Doc *ksdoc ) { - QPtrListIterator it( ksdoc->map()->sheetList() ); + TQPtrListIterator it( ksdoc->map()->sheetList() ); const Sheet * sheet = it.toFirst(); float width = 20.999; @@ -881,13 +881,13 @@ void OpenCalcExport::exportPageAutoStyles( QDomDocument & doc, QDomElement & aut height = sheet->print()->paperHeight() / 10; } - QString sWidth = QString( "%1cm" ).arg( width ); - QString sHeight = QString( "%1cm" ).arg( height ); + TQString sWidth = TQString( "%1cm" ).tqarg( width ); + TQString sHeight = TQString( "%1cm" ).tqarg( height ); - QDomElement pageMaster = doc.createElement( "style:page-master" ); + TQDomElement pageMaster = doc.createElement( "style:page-master" ); pageMaster.setAttribute( "style:name", "pm1" ); - QDomElement properties = doc.createElement( "style:properties" ); + TQDomElement properties = doc.createElement( "style:properties" ); properties.setAttribute( "fo:page-width", sWidth ); properties.setAttribute( "fo:page-height", sHeight ); properties.setAttribute( "fo:border", "0.002cm solid #000000" ); @@ -896,7 +896,7 @@ void OpenCalcExport::exportPageAutoStyles( QDomDocument & doc, QDomElement & aut pageMaster.appendChild( properties ); - QDomElement header = doc.createElement( "style:header-style" ); + TQDomElement header = doc.createElement( "style:header-style" ); properties = doc.createElement( "style:properties" ); properties.setAttribute( "fo:min-height", "0.75cm" ); properties.setAttribute( "fo:margin-left", "0cm" ); @@ -905,7 +905,7 @@ void OpenCalcExport::exportPageAutoStyles( QDomDocument & doc, QDomElement & aut header.appendChild( properties ); - QDomElement footer = doc.createElement( "style:header-style" ); + TQDomElement footer = doc.createElement( "style:header-style" ); properties = doc.createElement( "style:properties" ); properties.setAttribute( "fo:min-height", "0.75cm" ); properties.setAttribute( "fo:margin-left", "0cm" ); @@ -920,22 +920,22 @@ void OpenCalcExport::exportPageAutoStyles( QDomDocument & doc, QDomElement & aut autoStyles.appendChild( pageMaster ); } -void OpenCalcExport::exportMasterStyles( QDomDocument & doc, QDomElement & masterStyles, +void OpenCalcExport::exportMasterStyles( TQDomDocument & doc, TQDomElement & masterStyles, const Doc * ksdoc ) { - QDomElement masterPage = doc.createElement( "style:master-page" ); + TQDomElement masterPage = doc.createElement( "style:master-page" ); masterPage.setAttribute( "style:name", "Default" ); masterPage.setAttribute( "style:page-master-name", "pm1" ); - QPtrListIterator it( ksdoc->map()->sheetList() ); + TQPtrListIterator it( ksdoc->map()->sheetList() ); const Sheet * sheet = it.toFirst(); - QString headerLeft; - QString headerCenter; - QString headerRight; - QString footerLeft; - QString footerCenter; - QString footerRight; + TQString headerLeft; + TQString headerCenter; + TQString headerRight; + TQString footerLeft; + TQString footerCenter; + TQString footerRight; if ( sheet ) { @@ -950,19 +950,19 @@ void OpenCalcExport::exportMasterStyles( QDomDocument & doc, QDomElement & maste if ( ( headerLeft.length() > 0 ) || ( headerCenter.length() > 0 ) || ( headerRight.length() > 0 ) ) { - QDomElement header = doc.createElement( "style:header" ); - QDomElement left = doc.createElement( "style:region-left" ); - QDomElement text = doc.createElement( "text:p" ); + TQDomElement header = doc.createElement( "style:header" ); + TQDomElement left = doc.createElement( "style:region-left" ); + TQDomElement text = doc.createElement( "text:p" ); convertPart( headerLeft, doc, text, ksdoc ); left.appendChild( text ); - QDomElement center = doc.createElement( "style:region-center" ); - QDomElement text1 = doc.createElement( "text:p" ); + TQDomElement center = doc.createElement( "style:region-center" ); + TQDomElement text1 = doc.createElement( "text:p" ); convertPart( headerCenter, doc, text1, ksdoc ); center.appendChild( text1 ); - QDomElement right = doc.createElement( "style:region-right" ); - QDomElement text2 = doc.createElement( "text:p" ); + TQDomElement right = doc.createElement( "style:region-right" ); + TQDomElement text2 = doc.createElement( "text:p" ); convertPart( headerRight, doc, text2, ksdoc ); right.appendChild( text2 ); @@ -974,9 +974,9 @@ void OpenCalcExport::exportMasterStyles( QDomDocument & doc, QDomElement & maste } else { - QDomElement header = doc.createElement( "style:header" ); - QDomElement text = doc.createElement( "text:p" ); - QDomElement name = doc.createElement( "text:sheet-name" ); + TQDomElement header = doc.createElement( "style:header" ); + TQDomElement text = doc.createElement( "text:p" ); + TQDomElement name = doc.createElement( "text:sheet-name" ); name.appendChild( doc.createTextNode( "???" ) ); text.appendChild( name ); header.appendChild( text ); @@ -987,19 +987,19 @@ void OpenCalcExport::exportMasterStyles( QDomDocument & doc, QDomElement & maste if ( ( footerLeft.length() > 0 ) || ( footerCenter.length() > 0 ) || ( footerRight.length() > 0 ) ) { - QDomElement footer = doc.createElement( "style:footer" ); - QDomElement left = doc.createElement( "style:region-left" ); - QDomElement text = doc.createElement( "text:p" ); + TQDomElement footer = doc.createElement( "style:footer" ); + TQDomElement left = doc.createElement( "style:region-left" ); + TQDomElement text = doc.createElement( "text:p" ); convertPart( footerLeft, doc, text, ksdoc ); left.appendChild( text ); - QDomElement center = doc.createElement( "style:region-center" ); - QDomElement text1 = doc.createElement( "text:p" ); + TQDomElement center = doc.createElement( "style:region-center" ); + TQDomElement text1 = doc.createElement( "text:p" ); convertPart( footerCenter, doc, text1, ksdoc ); center.appendChild( text1 ); - QDomElement right = doc.createElement( "style:region-right" ); - QDomElement text2 = doc.createElement( "text:p" ); + TQDomElement right = doc.createElement( "style:region-right" ); + TQDomElement text2 = doc.createElement( "text:p" ); convertPart( footerRight, doc, text2, ksdoc ); right.appendChild( text2 ); @@ -1011,10 +1011,10 @@ void OpenCalcExport::exportMasterStyles( QDomDocument & doc, QDomElement & maste } else { - QDomElement footer = doc.createElement( "style:footer" ); - QDomElement text = doc.createElement( "text:p" ); + TQDomElement footer = doc.createElement( "style:footer" ); + TQDomElement text = doc.createElement( "text:p" ); text.appendChild( doc.createTextNode( i18n( "Page " ) ) ); - QDomElement number = doc.createElement( "text:page-number" ); + TQDomElement number = doc.createElement( "text:page-number" ); number.appendChild( doc.createTextNode( "1" ) ); text.appendChild( number ); footer.appendChild( text ); @@ -1025,18 +1025,18 @@ void OpenCalcExport::exportMasterStyles( QDomDocument & doc, QDomElement & maste masterStyles.appendChild( masterPage ); } -void OpenCalcExport::addText( QString const & text, QDomDocument & doc, - QDomElement & parent ) +void OpenCalcExport::addText( TQString const & text, TQDomDocument & doc, + TQDomElement & tqparent ) { if (text.length() > 0 ) - parent.appendChild( doc.createTextNode( text ) ); + tqparent.appendChild( doc.createTextNode( text ) ); } -void OpenCalcExport::convertPart( QString const & part, QDomDocument & doc, - QDomElement & parent, const Doc * ksdoc ) +void OpenCalcExport::convertPart( TQString const & part, TQDomDocument & doc, + TQDomElement & tqparent, const Doc * ksdoc ) { - QString text; - QString var; + TQString text; + TQString var; bool inVar = false; uint i = 0; @@ -1052,54 +1052,54 @@ void OpenCalcExport::convertPart( QString const & part, QDomDocument & doc, inVar = false; if ( var == "" ) { - addText( text, doc, parent ); + addText( text, doc, tqparent ); - QDomElement page = doc.createElement( "text:page-number" ); + TQDomElement page = doc.createElement( "text:page-number" ); page.appendChild( doc.createTextNode( "1" ) ); - parent.appendChild( page ); + tqparent.appendChild( page ); } else if ( var == "" ) { - addText( text, doc, parent ); + addText( text, doc, tqparent ); - QDomElement page = doc.createElement( "text:page-count" ); + TQDomElement page = doc.createElement( "text:page-count" ); page.appendChild( doc.createTextNode( "99" ) ); - parent.appendChild( page ); + tqparent.appendChild( page ); } else if ( var == "" ) { - addText( text, doc, parent ); + addText( text, doc, tqparent ); - QDomElement t = doc.createElement( "text:date" ); + TQDomElement t = doc.createElement( "text:date" ); t.setAttribute( "text:date-value", "0-00-00" ); // todo: "style:data-style-name", "N2" - t.appendChild( doc.createTextNode( QDate::currentDate().toString() ) ); - parent.appendChild( t ); + t.appendChild( doc.createTextNode( TQDate::tqcurrentDate().toString() ) ); + tqparent.appendChild( t ); } else if ( var == "