diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:32:11 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:32:11 -0600 |
commit | 94844816550ad672ccfcdc25659c625546239998 (patch) | |
tree | e35fc60fd736c645d59f6408af032774ad8023d3 /kpresenter/KPrDocument.cpp | |
parent | 2a811c38c74c03648ecf857e566c44483cbad706 (diff) | |
download | koffice-94844816550ad672ccfcdc25659c625546239998.tar.gz koffice-94844816550ad672ccfcdc25659c625546239998.zip |
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'kpresenter/KPrDocument.cpp')
-rw-r--r-- | kpresenter/KPrDocument.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/kpresenter/KPrDocument.cpp b/kpresenter/KPrDocument.cpp index 7a880406..17a8f0c6 100644 --- a/kpresenter/KPrDocument.cpp +++ b/kpresenter/KPrDocument.cpp @@ -43,7 +43,7 @@ #include "KPrSVGPathParser.h" #include <tqpopupmenu.h> -#include <tqclipboard.h> +#include <clipboard.h> #include <tqregexp.h> #include <tqfileinfo.h> #include <tqdom.h> @@ -272,7 +272,7 @@ KPrDocument::KPrDocument( TQWidget *parentWidget, const char *widgetName, TQObje saveOnlyPage = -1; m_maxRecentFiles = 10; - connect( TQApplication::tqclipboard(), TQT_SIGNAL( dataChanged() ), + connect( TQApplication::clipboard(), TQT_SIGNAL( dataChanged() ), this, TQT_SLOT( clipboardDataChanged() ) ); m_commandHistory = new KoCommandHistory( actionCollection(), true ) ; @@ -444,9 +444,9 @@ bool KPrDocument::saveChildren( KoStore* _store ) { int i = 0; - TQPtrListIterator<KoDocumentChild> it( tqchildren() ); + TQPtrListIterator<KoDocumentChild> it( children() ); for( ; it.current(); ++it ) { - // Don't save tqchildren that are only in the undo/redo history + // Don't save children that are only in the undo/redo history // but not anymore in the presentation TQPtrListIterator<KPrPage> pageIt( m_pageList ); for ( int pagePos = 0; pageIt.current(); ++pageIt, ++pagePos ) @@ -490,7 +490,7 @@ TQDomDocument KPrDocument::saveXML() emit sigProgress( 0 ); } - m_varColl->variableSetting()->setModificationDate(TQDateTime::tqcurrentDateTime()); + m_varColl->variableSetting()->setModificationDate(TQDateTime::currentDateTime()); recalcVariables( VT_DATE ); recalcVariables( VT_TIME ); recalcVariables( VT_STATISTIC ); @@ -669,9 +669,9 @@ TQDomDocument KPrDocument::saveXML() } // Write "OBJECT" tag for every child - TQPtrListIterator<KoDocumentChild> chl( tqchildren() ); + TQPtrListIterator<KoDocumentChild> chl( children() ); for( ; chl.current(); ++chl ) { - // Don't save tqchildren that are only in the undo/redo history + // Don't save children that are only in the undo/redo history // but not anymore in the presentation for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ ) { if ( saveOnlyPage != -1 && i != saveOnlyPage ) @@ -735,8 +735,8 @@ void KPrDocument::saveEmbeddedObject(KPrPage *page, KoDocumentChild *chl, TQDomD TQDomElement embedded=doc.createElement("EMBEDDED"); KPrChild* curr = (KPrChild*)chl; - // tqgeometry is no zoom value ! - TQRect _rect = curr->tqgeometry(); + // geometry is no zoom value ! + TQRect _rect = curr->geometry(); int tmpX = (int)zoomHandler()->unzoomItX( _rect.x() ); int tmpY = (int)zoomHandler()->unzoomItY( _rect.y() ); int tmpWidth = (int)zoomHandler()->unzoomItX( _rect.width() ); @@ -909,7 +909,7 @@ TQDomElement KPrDocument::saveUsedSoundFileToXML( TQDomDocument &_doc, TQStringL TQString soundFileName = *it; int position = soundFileName.findRev( '.' ); TQString format = soundFileName.right( soundFileName.length() - position - 1 ); - TQString _name = TQString( "sounds/sound%1.%2" ).tqarg( ++i ).tqarg( format.lower() ); + TQString _name = TQString( "sounds/sound%1.%2" ).arg( ++i ).arg( format.lower() ); TQDomElement fileElem = _doc.createElement( "FILE" ); soundFiles.appendChild( fileElem ); @@ -955,7 +955,7 @@ void KPrDocument::saveUsedSoundFileToStore( KoStore *_store, TQStringList _list TQString soundFileName = *it; int position = soundFileName.findRev( '.' ); TQString format = soundFileName.right( soundFileName.length() - position - 1 ); - TQString _storeURL = TQString( "sounds/sound%1.%2" ).tqarg( ++i ).tqarg( format.lower() ); + TQString _storeURL = TQString( "sounds/sound%1.%2" ).arg( ++i ).arg( format.lower() ); if ( _store->open( _storeURL ) ) { KoStoreDevice dev( _store ); @@ -973,7 +973,7 @@ bool KPrDocument::loadChildren( KoStore* _store ) { if ( objStartY == 0 && _clean) // Don't do this when inserting a template or a page... { - TQPtrListIterator<KoDocumentChild> it( tqchildren() ); + TQPtrListIterator<KoDocumentChild> it( children() ); for( ; it.current(); ++it ) { if ( !((KoDocumentChild*)it.current())->loadDocument( _store ) ) return false; @@ -981,7 +981,7 @@ bool KPrDocument::loadChildren( KoStore* _store ) } else // instead load form the correct child on, m_childCountBeforeInsert has the be set { - TQPtrListIterator<KoDocumentChild> it( tqchildren() ); + TQPtrListIterator<KoDocumentChild> it( children() ); for( int i = 0; it.current(); ++it, ++i ) { if ( i < m_childCountBeforeInsert ) continue; @@ -1006,7 +1006,7 @@ bool KPrDocument::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) KoXmlWriter* contentWriter = createOasisXmlWriter( &contentDev, "office:document-content" ); - m_varColl->variableSetting()->setModificationDate(TQDateTime::tqcurrentDateTime()); + m_varColl->variableSetting()->setModificationDate(TQDateTime::currentDateTime()); recalcVariables( VT_DATE ); recalcVariables( VT_TIME ); recalcVariables( VT_STATISTIC ); @@ -1535,7 +1535,7 @@ void KPrDocument::saveOasisDocumentStyles( KoStore* store, KoGenStyles& mainStyl Q_ASSERT( styles.count() == 1 ); it = styles.begin(); for ( ; it != styles.end() ; ++it ) { - (*it).style->writeStyle( stylesWriter, mainStyles, "style:page-tqlayout", (*it).name, "style:page-tqlayout-properties", false /*don't close*/ ); + (*it).style->writeStyle( stylesWriter, mainStyles, "style:page-layout", (*it).name, "style:page-layout-properties", false /*don't close*/ ); stylesWriter->endElement(); } @@ -1614,7 +1614,7 @@ bool KPrDocument::loadOasis( const TQDomDocument& doc, KoOasisStyles&oasisStyles if ( localName.isEmpty() ) setErrorMessage( i18n( "Invalid OASIS OpenDocument file. No tag found inside office:body." ) ); else - setErrorMessage( i18n( "This document is not a presentation, but a %1. Please try opening it with the appropriate application." ).tqarg( KoDocument::tagNameToDocumentType( localName ) ) ); + setErrorMessage( i18n( "This document is not a presentation, but a %1. Please try opening it with the appropriate application." ).arg( KoDocument::tagNameToDocumentType( localName ) ) ); return false; } @@ -1648,7 +1648,7 @@ bool KPrDocument::loadOasis( const TQDomDocument& doc, KoOasisStyles&oasisStyles kdDebug()<<" masterPageName:"<<masterPageName<<endl; if ( ! master ) { - masterPageName = "Standard"; // use default tqlayout as fallback (default in kpresenter) + masterPageName = "Standard"; // use default layout as fallback (default in kpresenter) master = oasisStyles.masterPages()[ masterPageName]; if ( !master ) //last test... master = oasisStyles.masterPages()["Default"]; @@ -1685,7 +1685,7 @@ bool KPrDocument::loadOasis( const TQDomDocument& doc, KoOasisStyles&oasisStyles kdDebug()<<" end load oasis master style \n"; Q_ASSERT( master ); - const TQDomElement *style = master ? oasisStyles.findStyle(master->attributeNS( KoXmlNS::style, "page-tqlayout-name", TQString() )) : 0; + const TQDomElement *style = master ? oasisStyles.findStyle(master->attributeNS( KoXmlNS::style, "page-layout-name", TQString() )) : 0; const TQDomElement *backgroundStyle = oasisStyles.findStyle( "Standard-background", "presentation" ); kdDebug()<<"Standard background "<<backgroundStyle<<endl; // parse all pages @@ -1857,7 +1857,7 @@ void KPrDocument::loadOasisObject( KPrPage * newpage, TQDomNode & drawPage, KoOa TQRect r; KPrPartObject *kppartobject = new KPrPartObject( ch ); kppartobject->loadOasis( o, context, m_loadingInfo ); - r = ch->tqgeometry(); + r = ch->geometry(); if ( groupObject ) groupObject->addObjects( kppartobject ); else @@ -1993,11 +1993,11 @@ void KPrDocument::loadOasisObject( KPrPage * newpage, TQDomNode & drawPage, KoOa break; } } - else if ( name == "custom-tqshape" && isDrawNS ) + else if ( name == "custom-shape" && isDrawNS ) { fillStyleStack( o, context, "graphic" ); - TQDomElement enhancedGeometry = KoDom::namedItemNS( o, KoXmlNS::draw, "enhanced-tqgeometry" ); + TQDomElement enhancedGeometry = KoDom::namedItemNS( o, KoXmlNS::draw, "enhanced-geometry" ); if ( !enhancedGeometry.isNull() ) { @@ -2054,13 +2054,13 @@ void KPrDocument::loadOasisObject( KPrPage * newpage, TQDomNode & drawPage, KoOa newpage->appendObject( kpClosedObject ); } break; default: - kdDebug(33001) << "draw:custom-tqshape found unsupported object type " << objType << " in draw:enhanced-path " << d << endl; + kdDebug(33001) << "draw:custom-shape found unsupported object type " << objType << " in draw:enhanced-path " << d << endl; break; } } else { - kdDebug(33001) << "draw:custom-tqshape not supported" << endl; + kdDebug(33001) << "draw:custom-shape not supported" << endl; } } } @@ -2089,7 +2089,7 @@ void KPrDocument::loadOasisObject( KPrPage * newpage, TQDomNode & drawPage, KoOa if ( !note.isEmpty() ) note += "\n"; - //todo load tqlayout for note. + //todo load layout for note. TQDomNode textBox = KoDom::namedItemNS( frameBox, KoXmlNS::draw, "text-box" ); if ( !textBox.isNull() ) @@ -2136,10 +2136,10 @@ int KPrDocument::createPresentationAnimation(const TQDomElement& element, int or { const bool isPresentationNS = e.namespaceURI() == KoXmlNS::presentation; if ( isPresentationNS && - ( tagName == "show-tqshape" || tagName == "hide-tqshape" ) ) + ( tagName == "show-shape" || tagName == "hide-shape" ) ) { - Q_ASSERT( e.hasAttributeNS( KoXmlNS::draw, "tqshape-id" ) ); - TQString name = e.attributeNS( KoXmlNS::draw, "tqshape-id", TQString() ); + Q_ASSERT( e.hasAttributeNS( KoXmlNS::draw, "shape-id" ) ); + TQString name = e.attributeNS( KoXmlNS::draw, "shape-id", TQString() ); kdDebug()<<" insert animation " << tagName << " name :" << name << endl; if ( e.hasAttributeNS( KoXmlNS::koffice, "order-id" ) ) @@ -2150,7 +2150,7 @@ int KPrDocument::createPresentationAnimation(const TQDomElement& element, int or lstAnimation *tmp = new lstAnimation; tmp->element = new TQDomElement( e ); tmp->order = orderAnimation; - if ( tagName == "show-tqshape" ) + if ( tagName == "show-shape" ) { m_loadingInfo->storePresentationShowAnimation( tmp, name ); } @@ -2246,7 +2246,7 @@ bool KPrDocument::loadXML( TQIODevice * dev, const TQDomDocument& doc ) << " Line: " << errorLine << " Column: " << errorColumn << endl << " Message: " << errorMsg << endl; setErrorMessage( i18n( "parsing error in the main document (converted from an old KPresenter format) at line %1, column %2\nError message: %3" ) - .tqarg( errorLine ).tqarg( errorColumn ).tqarg( i18n ( errorMsg.utf8() ) ) ); + .arg( errorLine ).arg( errorColumn ).arg( i18n ( errorMsg.utf8() ) ) ); return false; } b = loadXML( newdoc ); @@ -2294,7 +2294,7 @@ void KPrDocument::insertEmbedded( KoStore *store, TQDomElement topElem, KMacroCo TQDomElement object=elem.namedItem("OBJECT").toElement(); if(!object.isNull()) { ch->load(object, true); // true == uppercase - r = ch->tqgeometry(); + r = ch->geometry(); ch->loadDocument( store ); insertChild( ch ); kppartobject = new KPrPartObject( ch ); @@ -2376,7 +2376,7 @@ bool KPrDocument::loadXML( const TQDomDocument &doc ) document.attribute("mime")!="application/x-kpresenter" && document.attribute("mime")!="application/vnd.kde.kpresenter" ) ) { kdError(33001) << "Unknown mime type " << document.attribute("mime") << endl; - setErrorMessage( i18n("Invalid document, expected mimetype application/x-kpresenter or application/vnd.kde.kpresenter, got %1").tqarg(document.attribute("mime")) ); + setErrorMessage( i18n("Invalid document, expected mimetype application/x-kpresenter or application/vnd.kde.kpresenter, got %1").arg(document.attribute("mime")) ); return false; } if(document.hasAttribute("url")) @@ -2401,7 +2401,7 @@ bool KPrDocument::loadXML( const TQDomDocument &doc ) TQDomElement object=elem.namedItem("OBJECT").toElement(); if(!object.isNull()) { ch->load(object, true); // true == uppercase - r = ch->tqgeometry(); + r = ch->geometry(); insertChild( ch ); kppartobject = new KPrPartObject( ch ); //emit sig_insertObject( ch, kppartobject ); @@ -2514,7 +2514,7 @@ bool KPrDocument::loadXML( const TQDomDocument &doc ) else if(borders.hasAttribute("mmBottom")) //compatibility __pgLayout.ptBottom = MM_TO_POINT( borders.attribute("inchBottom").toDouble() ); } - // PAPER found and parsed -> apply page tqlayout + // PAPER found and parsed -> apply page layout // e.g. the text objects need it if ( _clean ) setPageLayout( __pgLayout ); @@ -3275,26 +3275,26 @@ void KPrDocument::setPageLayout( const KoPageLayout &pgLayout ) //for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ ) // m_pageList.at( i )->updateBackgroundSize(); - tqrepaint( false ); - tqlayout(); + repaint( false ); + layout(); // don't setModified(true) here, since this is called on startup } -//when we change pagetqlayout we must re-position header/footer +//when we change pagelayout we must re-position header/footer void KPrDocument::updateHeaderFooterPosition( ) { KoRect pageRect=m_masterPage->getPageRect(); TQRect oldBoundingRect = zoomHandler()->zoomRect( _header->getRepaintRect() ); _header->setOrig(pageRect.topLeft ()); _header->setSize(pageRect.width(),_header->getSize().height()); - tqrepaint( oldBoundingRect ); - tqrepaint(_header); + repaint( oldBoundingRect ); + repaint(_header); oldBoundingRect = zoomHandler()->zoomRect( _footer->getRepaintRect() ); _footer->setOrig(pageRect.left(),pageRect.bottom()-_footer->getSize().height()); _footer->setSize(pageRect.width(),_footer->getSize().height()); - tqrepaint(oldBoundingRect); - tqrepaint(_footer); + repaint(oldBoundingRect); + repaint(_footer); } bool KPrDocument::initDoc(InitDocFlags flags, TQWidget* parentWidget) @@ -3386,7 +3386,7 @@ void KPrDocument::setEmpty() { KoDocument::setEmpty(); // Whether loaded from template or from empty doc: this is a new one -> set creation date - m_varColl->variableSetting()->setCreationDate(TQDateTime::tqcurrentDateTime()); + m_varColl->variableSetting()->setCreationDate(TQDateTime::currentDateTime()); recalcVariables( VT_DATE ); // , VST_CREATION_DATE ... // If we then load a document, it will override that date. } @@ -3401,16 +3401,16 @@ void KPrDocument::setGridValue( double _x, double _y, bool _replace ) replaceObjs(); } -void KPrDocument::tqrepaint( bool erase ) +void KPrDocument::repaint( bool erase ) { TQPtrListIterator<KoView> it( views() ); for( ; it.current(); ++it ) { KPrCanvas* canvas = ((KPrView*)it.current())->getCanvas(); - canvas->tqrepaint( erase ); + canvas->repaint( erase ); } } -void KPrDocument::tqrepaint( const TQRect& rect ) +void KPrDocument::repaint( const TQRect& rect ) { TQRect r; TQPtrListIterator<KoView> it( views() ); @@ -3423,25 +3423,25 @@ void KPrDocument::tqrepaint( const TQRect& rect ) } } -void KPrDocument::tqlayout(KPrObject *kpobject) +void KPrDocument::layout(KPrObject *kpobject) { KPrTextObject * obj = dynamic_cast<KPrTextObject *>( kpobject ); if (obj) - obj->tqlayout(); + obj->layout(); } -void KPrDocument::tqlayout() +void KPrDocument::layout() { TQPtrListIterator<KoView> it( views() ); for( ; it.current(); ++it ) { KPrCanvas* canvas = ((KPrView*)it.current())->getCanvas(); - canvas->tqlayout(); + canvas->layout(); } } -void KPrDocument::tqrepaint( KPrObject *kpobject ) +void KPrDocument::repaint( KPrObject *kpobject ) { - tqrepaint( m_zoomHandler->zoomRect( kpobject->getRepaintRect() ) ); + repaint( m_zoomHandler->zoomRect( kpobject->getRepaintRect() ) ); } TQValueList<int> KPrDocument::getPageEffectSteps( unsigned int num ) @@ -3556,7 +3556,7 @@ void KPrDocument::takePage( KPrPage *page, int pageNum ) } } - tqrepaint( false ); + repaint( false ); } void KPrDocument::pageOrderChanged() @@ -3646,7 +3646,7 @@ int KPrDocument::insertNewPage( const TQString &cmdName, int _page, InsertPos _i KPrPage *newpage = new KPrPage( this, m_masterPage ); m_pageWhereLoadObject=newpage; - m_childCountBeforeInsert = tqchildren().count(); + m_childCountBeforeInsert = children().count(); bool ok = loadNativeFormat( fileName ); if ( !ok ) @@ -3726,7 +3726,7 @@ KCommand * KPrDocument::loadPastedObjs( const TQString &in, KPrPage* _page ) KCommand *cmd = loadObjects(document,true); m_pageWhereLoadObject=0L; - tqrepaint( false ); + repaint( false ); setModified( true ); return cmd; } @@ -3750,7 +3750,7 @@ void KPrDocument::setDisplayObjectMasterPage( bool b ) TQPtrListIterator<KoView> it( views() ); for (; it.current(); ++it ) ((KPrView*)it.current())->updateDisplayObjectMasterPageButton(); - tqrepaint(b); + repaint(b); } void KPrDocument::setDisplayBackground( bool b ) @@ -3758,7 +3758,7 @@ void KPrDocument::setDisplayBackground( bool b ) TQPtrListIterator<KoView> it( views() ); for (; it.current(); ++it ) ((KPrView*)it.current())->updateDisplayBackgroundButton(); - tqrepaint(b); + repaint(b); } void KPrDocument::setHeader( bool b ) @@ -3772,7 +3772,7 @@ void KPrDocument::setHeader( bool b ) } m_masterPage->setHeader( b, false ); updateHeaderFooterButton(); - tqrepaint(b); + repaint(b); } void KPrDocument::setFooter( bool b ) @@ -3786,7 +3786,7 @@ void KPrDocument::setFooter( bool b ) } m_masterPage->setFooter( b, false ); updateHeaderFooterButton(); - tqrepaint(b); + repaint(b); } void KPrDocument::updateHeaderFooterButton() @@ -3917,7 +3917,7 @@ void KPrDocument::movePage( int from, int to ) void KPrDocument::copyPage( int from ) { _clean = false; - m_childCountBeforeInsert = tqchildren().count(); + m_childCountBeforeInsert = children().count(); _duplicatePage=true; // ### now also set via savePage() parameter below @@ -3963,7 +3963,7 @@ void KPrDocument::copyPageToClipboard( int pgnum ) KURL url; url.setPath( tempFile.name() ); KURL::List lst; lst.append( url ); - TQApplication::tqclipboard()->setData( new KURLDrag( lst ) ); + TQApplication::clipboard()->setData( new KURLDrag( lst ) ); m_tempFileInClipboard = tempFile.name(); // do this last, the above calls clipboardDataChanged } @@ -3987,7 +3987,7 @@ void KPrDocument::clipboardDataChanged() } // TODO enable paste as well, when a txtobject is activated // and there is plain text in the clipboard. Then enable this code. - //TQMimeSource *data = TQApplication::tqclipboard()->data(); + //TQMimeSource *data = TQApplication::clipboard()->data(); //bool canPaste = data->provides( "text/uri-list" ) || data->provides( "application/x-kpresenter-selection" ); // emit enablePaste( canPaste ); } @@ -4145,7 +4145,7 @@ void KPrDocument::slotRepaintChanged( KPrTextObject *kptextobj ) { //todo //use this function for the moment - tqrepaint( kptextobj ); + repaint( kptextobj ); } @@ -4156,7 +4156,7 @@ void KPrDocument::recalcVariables( int type ) if ( modifiedVariables.isEmpty() ) return; - // TODO use the return value from recalcVariables to only tqrepaint what has changed. + // TODO use the return value from recalcVariables to only repaint what has changed. TQPtrListIterator<KPrPage> it( m_pageList ); for ( ; it.current(); ++it ) it.current()->slotRepaintVariable(); @@ -4295,7 +4295,7 @@ void KPrDocument::newZoomAndResolution( bool updateViews, bool /*forPrint*/ ) for (; it.current(); ++it ) { static_cast<KPrView *>( it.current() )->getCanvas()->update(); - static_cast<KPrView *>( it.current() )->getCanvas()->tqlayout(); + static_cast<KPrView *>( it.current() )->getCanvas()->layout(); } } } @@ -4665,7 +4665,7 @@ void KPrDocument::insertFile(const TQString & file ) { m_insertFilePage = m_pageList.count(); - m_childCountBeforeInsert = tqchildren().count(); + m_childCountBeforeInsert = children().count(); objStartY = 0; bool clean = _clean; _clean = false; |