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 /kword/KWPictureFrameSet.cpp | |
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 'kword/KWPictureFrameSet.cpp')
-rw-r--r-- | kword/KWPictureFrameSet.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/kword/KWPictureFrameSet.cpp b/kword/KWPictureFrameSet.cpp index dcaf69bf..3237bc37 100644 --- a/kword/KWPictureFrameSet.cpp +++ b/kword/KWPictureFrameSet.cpp @@ -32,7 +32,7 @@ //#define DEBUG_DRAW -KWPictureFrameSet::KWPictureFrameSet( KWDocument *_doc, const QString & name ) +KWPictureFrameSet::KWPictureFrameSet( KWDocument *_doc, const TQString & name ) : KWFrameSet( _doc ), m_keepAspectRatio( true ), m_finalSize( false ) { if ( name.isEmpty() ) @@ -41,10 +41,10 @@ KWPictureFrameSet::KWPictureFrameSet( KWDocument *_doc, const QString & name ) m_name = name; } -KWPictureFrameSet::KWPictureFrameSet( KWDocument* doc, const QDomElement& frame, const QDomElement& imageTag, KoOasisContext& context ) +KWPictureFrameSet::KWPictureFrameSet( KWDocument* doc, const TQDomElement& frame, const TQDomElement& imageTag, KoOasisContext& context ) : KWFrameSet( doc ), m_keepAspectRatio( true ), m_finalSize( false ) { - m_name = frame.attributeNS( KoXmlNS::draw, "name", QString::null ); + m_name = frame.attributeNS( KoXmlNS::draw, "name", TQString() ); if ( doc->frameSetByName( m_name ) ) // already exists! m_name = doc->generateFramesetName( m_name + " %1" ); loadOasis( frame, imageTag, context ); @@ -61,7 +61,7 @@ KWordFrameSetIface* KWPictureFrameSet::dcopObject() return m_dcop; } -void KWPictureFrameSet::loadPicture( const QString & fileName ) +void KWPictureFrameSet::loadPicture( const TQString & fileName ) { KoPictureCollection *collection = m_doc->pictureCollection(); @@ -82,32 +82,32 @@ void KWPictureFrameSet::reloadPicture( const KoPictureKey& key ) m_picture = collection->insertPicture( key, KoPicture() ); } -QDomElement KWPictureFrameSet::save( QDomElement & parentElem, bool saveFrames ) +TQDomElement KWPictureFrameSet::save( TQDomElement & tqparentElem, bool saveFrames ) { if ( m_frames.isEmpty() ) // Deleted frameset -> don't save - return QDomElement(); - QDomElement framesetElem = parentElem.ownerDocument().createElement( "FRAMESET" ); - parentElem.appendChild( framesetElem ); + return TQDomElement(); + TQDomElement framesetElem = tqparentElem.ownerDocument().createElement( "FRAMESET" ); + tqparentElem.appendChild( framesetElem ); KWFrameSet::saveCommon( framesetElem, saveFrames ); - QDomElement imageElem = parentElem.ownerDocument().createElement( "PICTURE" ); + TQDomElement imageElem = tqparentElem.ownerDocument().createElement( "PICTURE" ); framesetElem.appendChild( imageElem ); imageElem.setAttribute( "keepAspectRatio", m_keepAspectRatio ? "true" : "false" ); - QDomElement elem = parentElem.ownerDocument().createElement( "KEY" ); + TQDomElement elem = tqparentElem.ownerDocument().createElement( "KEY" ); imageElem.appendChild( elem ); m_picture.getKey().saveAttributes( elem ); return framesetElem; } -void KWPictureFrameSet::load( QDomElement &attributes, bool loadFrames ) +void KWPictureFrameSet::load( TQDomElement &attributes, bool loadFrames ) { KWFrameSet::load( attributes, loadFrames ); - QString defaultRatio="true"; + TQString defaultRatio="true"; // <PICTURE> - QDomNode node=attributes.namedItem( "PICTURE" ); + TQDomNode node=attributes.namedItem( "PICTURE" ); if ( node.isNull() ) { node=attributes.namedItem( "IMAGE" ); @@ -118,11 +118,11 @@ void KWPictureFrameSet::load( QDomElement &attributes, bool loadFrames ) } } - QDomElement image = node.toElement(); + TQDomElement image = node.toElement(); if ( !image.isNull() ) { m_keepAspectRatio = image.attribute( "keepAspectRatio", defaultRatio ) == "true"; // <KEY> - QDomElement keyElement = image.namedItem( "KEY" ).toElement(); + TQDomElement keyElement = image.namedItem( "KEY" ).toElement(); if ( !keyElement.isNull() ) { KoPictureKey key; @@ -134,10 +134,10 @@ void KWPictureFrameSet::load( QDomElement &attributes, bool loadFrames ) else { // <FILENAME> (old format, up to KWord-1.1-beta2) - QDomElement filenameElement = image.namedItem( "FILENAME" ).toElement(); + TQDomElement filenameElement = image.namedItem( "FILENAME" ).toElement(); if ( !filenameElement.isNull() ) { - QString filename = filenameElement.attribute( "value" ); + TQString filename = filenameElement.attribute( "value" ); m_picture.clear(); m_picture.setKey( KoPictureKey( filename ) ); m_doc->addPictureRequest( this ); @@ -175,31 +175,31 @@ void KWPictureFrameSet::saveOasis( KoXmlWriter& writer, KoSavingContext& context } -void KWPictureFrameSet::loadOasis( const QDomElement& frame, const QDomElement& tag, KoOasisContext& context ) +void KWPictureFrameSet::loadOasis( const TQDomElement& frame, const TQDomElement& tag, KoOasisContext& context ) { kdDebug() << k_funcinfo << endl; KoPictureKey key; - QDomNode binaryData = KoDom::namedItemNS( tag, KoXmlNS::office, "binary-data" ); + TQDomNode binaryData = KoDom::namedItemNS( tag, KoXmlNS::office, "binary-data" ); if ( !binaryData.isNull() ) { - QCString data = binaryData.toElement().text().latin1(); + TQCString data = binaryData.toElement().text().latin1(); m_picture.loadFromBase64( data ); - key = KoPictureKey("nofile", QDateTime::currentDateTime(Qt::UTC)); + key = KoPictureKey("nofile", TQDateTime::tqcurrentDateTime(Qt::UTC)); m_picture.setKey(key); } else { - const QString href( tag.attributeNS( KoXmlNS::xlink, "href", QString::null) ); + const TQString href( tag.attributeNS( KoXmlNS::xlink, "href", TQString()) ); if ( !href.isEmpty() /*&& href[0] == '#'*/ ) { - QString strExtension; - const int result=href.findRev("."); + TQString strExtension; + const int result=href.tqfindRev("."); if (result>=0) { strExtension=href.mid(result+1); // As we are using KoPicture, the extension should be without the dot. } - QString filename(href/*.mid(1)*/); - key = KoPictureKey(filename, QDateTime::currentDateTime(Qt::UTC)); + TQString filename(href/*.mid(1)*/); + key = KoPictureKey(filename, TQDateTime::tqcurrentDateTime(Qt::UTC)); m_picture.setKey(key); KoStore* store = context.store(); @@ -221,8 +221,8 @@ void KWPictureFrameSet::loadOasis( const QDomElement& frame, const QDomElement& context.styleStack().restore(); } -void KWPictureFrameSet::drawFrameContents( KWFrame *frame, QPainter *painter, const QRect &crect, - const QColorGroup &, bool, bool, KWFrameSetEdit *, KWViewMode * ) +void KWPictureFrameSet::drawFrameContents( KWFrame *frame, TQPainter *painter, const TQRect &crect, + const TQColorGroup &, bool, bool, KWFrameSetEdit *, KWViewMode * ) { #ifdef DEBUG_DRAW kdDebug(32001) << "KWPictureFrameSet::drawFrameContents crect=" << crect << " size=" << kWordDocument()->zoomItX( frame->innerWidth() ) << "x" << kWordDocument()->zoomItY( frame->innerHeight() ) << endl; |