diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kspread/kspread_map.cc | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
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
Diffstat (limited to 'kspread/kspread_map.cc')
-rw-r--r-- | kspread/kspread_map.cc | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/kspread/kspread_map.cc b/kspread/kspread_map.cc index 6b7d89d5..032fd13c 100644 --- a/kspread/kspread_map.cc +++ b/kspread/kspread_map.cc @@ -20,7 +20,7 @@ #include <stdlib.h> #include <time.h> -#include <qfile.h> +#include <tqfile.h> #include <kmdcodec.h> #include <ktempfile.h> @@ -49,7 +49,7 @@ using namespace KSpread; bool Map::respectCase = true; Map::Map ( Doc* doc, const char* name) - : QObject( doc, name ), + : TQObject( doc, name ), m_doc( doc ), m_initialActiveSheet( 0 ), m_initialMarkerColumn( 0 ), @@ -72,15 +72,15 @@ Doc* Map::doc() const return m_doc; } -void Map::setProtected( QCString const & passwd ) +void Map::setProtected( TQCString const & passwd ) { m_strPassword = passwd; } Sheet* Map::createSheet() { - QString s( i18n("Sheet%1") ); - s = s.arg( tableId++ ); + TQString s( i18n("Sheet%1") ); + s = s.tqarg( tableId++ ); Sheet *t = new Sheet ( this, s , s.utf8()); t->setSheetName( s, true ); // huh? (Werner) return t; @@ -102,13 +102,13 @@ Sheet *Map::addNewSheet () return t; } -void Map::moveSheet( const QString & _from, const QString & _to, bool _before ) +void Map::moveSheet( const TQString & _from, const TQString & _to, bool _before ) { Sheet* sheetfrom = findSheet( _from ); Sheet* sheetto = findSheet( _to ); - int from = m_lstSheets.find( sheetfrom ) ; - int to = m_lstSheets.find( sheetto ) ; + int from = m_lstSheets.tqfind( sheetfrom ) ; + int to = m_lstSheets.tqfind( sheetto ) ; if ( !_before ) ++to; @@ -139,14 +139,14 @@ void Map::loadOasisSettings( KoOasisSettings &settings ) kdDebug()<<" loadOasisSettings( KoOasisSettings &settings ) exist : "<< !sheetsMap.isNull() <<endl; if ( !sheetsMap.isNull() ) { - QPtrListIterator<Sheet> it( m_lstSheets ); + TQPtrListIterator<Sheet> it( m_lstSheets ); for( ; it.current(); ++it ) { it.current()->loadOasisSettings( sheetsMap ); } } - QString activeSheet = firstView.parseConfigItemString( "ActiveTable" ); + TQString activeSheet = firstView.parseConfigItemString( "ActiveTable" ); kdDebug()<<" loadOasisSettings( KoOasisSettings &settings ) activeSheet :"<<activeSheet<<endl; if (!activeSheet.isEmpty()) @@ -159,7 +159,7 @@ void Map::loadOasisSettings( KoOasisSettings &settings ) void Map::saveOasisSettings( KoXmlWriter &settingsWriter ) { - settingsWriter.addConfigItem( "ViewId", QString::fromLatin1( "View1" ) ); + settingsWriter.addConfigItem( "ViewId", TQString::tqfromLatin1( "View1" ) ); // Save visual info for the first view, such as active sheet and active cell // It looks like a hack, but reopening a document creates only one view anyway (David) View * view = m_doc->views().isEmpty() ? 0 : dynamic_cast<View*>(m_doc->views().getFirst()); @@ -174,14 +174,14 @@ void Map::saveOasisSettings( KoXmlWriter &settingsWriter ) //<config:config-item-map-named config:name="Tables"> settingsWriter.startElement("config:config-item-map-named" ); settingsWriter.addAttribute("config:name","Tables" ); - QPtrListIterator<Sheet> it( m_lstSheets ); + TQPtrListIterator<Sheet> it( m_lstSheets ); for( ; it.current(); ++it ) { settingsWriter.startElement( "config:config-item-map-entry" ); settingsWriter.addAttribute( "config:name", ( *it )->sheetName() ); if ( view ) { - QPoint marker = view->markerFromSheet( *it ); + TQPoint marker = view->markerFromSheet( *it ); KoPoint offset = view->offsetFromSheet( *it ); settingsWriter.addConfigItem( "CursorPositionX", marker.x() ); settingsWriter.addConfigItem( "CursorPositionY", marker.y() ); @@ -200,8 +200,8 @@ bool Map::saveOasis( KoXmlWriter & xmlWriter, KoGenStyles & mainStyles, KoStore if ( !m_strPassword.isEmpty() ) { xmlWriter.addAttribute("table:structure-protected", "true" ); - QCString str = KCodecs::base64Encode( m_strPassword ); - xmlWriter.addAttribute("table:protection-key", QString( str.data() ) );/* FIXME !!!!*/ + TQCString str = KCodecs::base64Encode( m_strPassword ); + xmlWriter.addAttribute("table:protection-key", TQString( str.data() ) );/* FIXME !!!!*/ } GenValidationStyles valStyle; @@ -215,11 +215,11 @@ bool Map::saveOasis( KoXmlWriter & xmlWriter, KoGenStyles & mainStyles, KoStore } bodyTmpFile.setAutoDelete( true ); - QFile* tmpFile = bodyTmpFile.file(); - KoXmlWriter bodyTmpWriter( tmpFile ); + TQFile* tmpFile = bodyTmpFile.file(); + KoXmlWriter bodyTmpWriter( TQT_TQIODEVICE(tmpFile) ); - QPtrListIterator<Sheet> it( m_lstSheets ); + TQPtrListIterator<Sheet> it( m_lstSheets ); for( ; it.current(); ++it ) { it.current()->saveOasis( bodyTmpWriter, mainStyles, valStyle, store, manifestWriter, _indexObj, _partIndexObj ); @@ -229,15 +229,15 @@ bool Map::saveOasis( KoXmlWriter & xmlWriter, KoGenStyles & mainStyles, KoStore tmpFile->close(); - xmlWriter.addCompleteElement( tmpFile ); + xmlWriter.addCompleteElement( TQT_TQIODEVICE(tmpFile) ); bodyTmpFile.close(); return true; } -QDomElement Map::save( QDomDocument& doc ) +TQDomElement Map::save( TQDomDocument& doc ) { - QDomElement mymap = doc.createElement( "map" ); + TQDomElement mymap = doc.createElement( "map" ); // Save visual info for the first view, such as active sheet and active cell // It looks like a hack, but reopening a document creates only one view anyway (David) View * view = static_cast<View*>(m_doc->views().getFirst()); @@ -255,17 +255,17 @@ QDomElement Map::save( QDomDocument& doc ) { if ( m_strPassword.size() > 0 ) { - QCString str = KCodecs::base64Encode( m_strPassword ); - mymap.setAttribute( "protected", QString( str.data() ) ); + TQCString str = KCodecs::base64Encode( m_strPassword ); + mymap.setAttribute( "protected", TQString( str.data() ) ); } else mymap.setAttribute( "protected", "" ); } - QPtrListIterator<Sheet> it( m_lstSheets ); + TQPtrListIterator<Sheet> it( m_lstSheets ); for( ; it.current(); ++it ) { - QDomElement e = it.current()->saveXML( doc ); + TQDomElement e = it.current()->saveXML( doc ); if ( e.isNull() ) return e; mymap.appendChild( e ); @@ -273,37 +273,37 @@ QDomElement Map::save( QDomDocument& doc ) return mymap; } -bool Map::loadOasis( const QDomElement& body, KoOasisLoadingContext& oasisContext ) +bool Map::loadOasis( const TQDomElement& body, KoOasisLoadingContext& oasisContext ) { if ( body.hasAttributeNS( KoXmlNS::table, "structure-protected" ) ) { - QCString passwd( "" ); + TQCString passwd( "" ); if ( body.hasAttributeNS( KoXmlNS::table, "protection-key" ) ) { - QString p = body.attributeNS( KoXmlNS::table, "protection-key", QString::null ); - QCString str( p.latin1() ); + TQString p = body.attributeNS( KoXmlNS::table, "protection-key", TQString() ); + TQCString str( p.latin1() ); passwd = KCodecs::base64Decode( str ); } m_strPassword = passwd; } - QDomNode sheetNode = KoDom::namedItemNS( body, KoXmlNS::table, "table" ); + TQDomNode sheetNode = KoDom::namedItemNS( body, KoXmlNS::table, "table" ); // sanity check if ( sheetNode.isNull() ) return false; while ( !sheetNode.isNull() ) { - QDomElement sheetElement = sheetNode.toElement(); + TQDomElement sheetElement = sheetNode.toElement(); if( !sheetElement.isNull() ) { //kdDebug()<<" Map::loadOasis tableElement is not null \n"; //kdDebug()<<"tableElement.nodeName() :"<<sheetElement.nodeName()<<endl; if( sheetElement.nodeName() == "table:table" ) { - if( !sheetElement.attributeNS( KoXmlNS::table, "name", QString::null ).isEmpty() ) + if( !sheetElement.attributeNS( KoXmlNS::table, "name", TQString() ).isEmpty() ) { Sheet* sheet = addNewSheet(); - sheet->setSheetName( sheetElement.attributeNS( KoXmlNS::table, "name", QString::null ), true, false ); + sheet->setSheetName( sheetElement.attributeNS( KoXmlNS::table, "name", TQString() ), true, false ); } } } @@ -311,21 +311,21 @@ bool Map::loadOasis( const QDomElement& body, KoOasisLoadingContext& oasisContex } //pre-load auto styles - QDict<Style> autoStyles = doc()->styleManager()->loadOasisAutoStyles( oasisContext.oasisStyles() ); + TQDict<Style> autoStyles = doc()->styleManager()->loadOasisAutoStyles( oasisContext.oasisStyles() ); // load the sheet sheetNode = body.firstChild(); while ( !sheetNode.isNull() ) { - QDomElement sheetElement = sheetNode.toElement(); + TQDomElement sheetElement = sheetNode.toElement(); if( !sheetElement.isNull() ) { //kdDebug()<<"tableElement.nodeName() bis :"<<sheetElement.nodeName()<<endl; if( sheetElement.nodeName() == "table:table" ) { - if( !sheetElement.attributeNS( KoXmlNS::table, "name", QString::null ).isEmpty() ) + if( !sheetElement.attributeNS( KoXmlNS::table, "name", TQString() ).isEmpty() ) { - QString name = sheetElement.attributeNS( KoXmlNS::table, "name", QString::null ); + TQString name = sheetElement.attributeNS( KoXmlNS::table, "name", TQString() ); Sheet* sheet = findSheet( name ); if( sheet ) sheet->loadOasis( sheetElement, oasisContext, autoStyles ); @@ -342,15 +342,15 @@ bool Map::loadOasis( const QDomElement& body, KoOasisLoadingContext& oasisContex } -bool Map::loadXML( const QDomElement& mymap ) +bool Map::loadXML( const TQDomElement& mymap ) { - QString activeSheet = mymap.attribute( "activeTable" ); + TQString activeSheet = mymap.attribute( "activeTable" ); m_initialMarkerColumn = mymap.attribute( "markerColumn" ).toInt(); m_initialMarkerRow = mymap.attribute( "markerRow" ).toInt(); m_initialXOffset = mymap.attribute( "xOffset" ).toDouble(); m_initialYOffset = mymap.attribute( "yOffset" ).toDouble(); - QDomNode n = mymap.firstChild(); + TQDomNode n = mymap.firstChild(); if ( n.isNull() ) { // We need at least one sheet ! @@ -359,7 +359,7 @@ bool Map::loadXML( const QDomElement& mymap ) } while( !n.isNull() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( !e.isNull() && e.tagName() == "table" ) { Sheet *t = addNewSheet(); @@ -371,15 +371,15 @@ bool Map::loadXML( const QDomElement& mymap ) if ( mymap.hasAttribute( "protected" ) ) { - QString passwd = mymap.attribute( "protected" ); + TQString passwd = mymap.attribute( "protected" ); if ( passwd.length() > 0 ) { - QCString str( passwd.latin1() ); + TQCString str( passwd.latin1() ); m_strPassword = KCodecs::base64Decode( str ); } else - m_strPassword = QCString( "" ); + m_strPassword = TQCString( "" ); } if (!activeSheet.isEmpty()) @@ -393,12 +393,12 @@ bool Map::loadXML( const QDomElement& mymap ) void Map::update() { - QPtrListIterator<Sheet> it( m_lstSheets ); + TQPtrListIterator<Sheet> it( m_lstSheets ); for( ; it.current(); ++it ) it.current()->recalc(); } -Sheet* Map::findSheet( const QString & _name ) +Sheet* Map::findSheet( const TQString & _name ) { Sheet * t; @@ -445,7 +445,7 @@ Sheet * Map::previousSheet( Sheet * currentSheet ) bool Map::saveChildren( KoStore * _store ) { - QPtrListIterator<Sheet> it( m_lstSheets ); + TQPtrListIterator<Sheet> it( m_lstSheets ); for( ; it.current(); ++it ) { // set the child document's url to an internal url (ex: "tar:/0/1") @@ -457,7 +457,7 @@ bool Map::saveChildren( KoStore * _store ) bool Map::loadChildren( KoStore * _store ) { - QPtrListIterator<Sheet> it( m_lstSheets ); + TQPtrListIterator<Sheet> it( m_lstSheets ); for( ; it.current(); ++it ) if ( !it.current()->loadChildren( _store ) ) return false; @@ -475,25 +475,25 @@ DCOPObject * Map::dcopObject() void Map::takeSheet( Sheet * sheet ) { - int pos = m_lstSheets.findRef( sheet ); + int pos = m_lstSheets.tqfindRef( sheet ); m_lstSheets.take( pos ); m_lstDeletedSheets.append( sheet ); } void Map::insertSheet( Sheet * sheet ) { - int pos = m_lstDeletedSheets.findRef( sheet ); + int pos = m_lstDeletedSheets.tqfindRef( sheet ); if ( pos != -1 ) m_lstDeletedSheets.take( pos ); m_lstSheets.append(sheet); } // FIXME cache this for faster operation -QStringList Map::visibleSheets() const +TQStringList Map::visibleSheets() const { - QStringList result; + TQStringList result; - QPtrListIterator<Sheet> it( m_lstSheets ); + TQPtrListIterator<Sheet> it( m_lstSheets ); for( ; it; ++it ) { Sheet* sheet = it.current(); @@ -505,11 +505,11 @@ QStringList Map::visibleSheets() const } // FIXME cache this for faster operation -QStringList Map::hiddenSheets() const +TQStringList Map::hiddenSheets() const { - QStringList result; + TQStringList result; - QPtrListIterator<Sheet> it( m_lstSheets ); + TQPtrListIterator<Sheet> it( m_lstSheets ); for( ; it; ++it ) { Sheet* sheet = it.current(); |