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 /kpresenter/KPrObject.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 'kpresenter/KPrObject.cpp')
-rw-r--r-- | kpresenter/KPrObject.cpp | 498 |
1 files changed, 249 insertions, 249 deletions
diff --git a/kpresenter/KPrObject.cpp b/kpresenter/KPrObject.cpp index ad246527..8c0284a3 100644 --- a/kpresenter/KPrObject.cpp +++ b/kpresenter/KPrObject.cpp @@ -25,13 +25,13 @@ #include "KPrDocument.h" #include "KPrUtils.h" -#include <qpainter.h> -#include <qwmatrix.h> -#include <qpointarray.h> -#include <qregion.h> -#include <qdom.h> -#include <qbuffer.h> -#include <qregexp.h> +#include <tqpainter.h> +#include <tqwmatrix.h> +#include <tqpointarray.h> +#include <tqregion.h> +#include <tqdom.h> +#include <tqbuffer.h> +#include <tqregexp.h> #include <kapplication.h> #include <KoOasisContext.h> @@ -50,43 +50,43 @@ #include <KoDom.h> #include <kdebug.h> -const QString &KPrObject::tagORIG=KGlobal::staticQString("ORIG"); -const QString &KPrObject::attrX=KGlobal::staticQString("x"); -const QString &KPrObject::attrY=KGlobal::staticQString("y"); -const QString &KPrObject::tagSIZE=KGlobal::staticQString("SIZE"); -const QString &KPrObject::attrWidth=KGlobal::staticQString("width"); -const QString &KPrObject::attrHeight=KGlobal::staticQString("height"); -const QString &KPrObject::tagSHADOW=KGlobal::staticQString("SHADOW"); -const QString &KPrObject::attrDistance=KGlobal::staticQString("distance"); -const QString &KPrObject::attrDirection=KGlobal::staticQString("direction"); -const QString &KPrObject::attrColor=KGlobal::staticQString("color"); -const QString &KPrObject::tagEFFECTS=KGlobal::staticQString("EFFECTS"); -const QString &KPrObject::attrEffect=KGlobal::staticQString("effect"); -const QString &KPrObject::attrEffect2=KGlobal::staticQString("effect2"); -const QString &KPrObject::tagPRESNUM=KGlobal::staticQString("PRESNUM"); -const QString &KPrObject::tagANGLE=KGlobal::staticQString("ANGLE"); -const QString &KPrObject::tagDISAPPEAR=KGlobal::staticQString("DISAPPEAR"); -const QString &KPrObject::attrDoit=KGlobal::staticQString("doit"); -const QString &KPrObject::attrNum=KGlobal::staticQString("num"); -const QString &KPrObject::tagFILLTYPE=KGlobal::staticQString("FILLTYPE"); -const QString &KPrObject::tagGRADIENT=KGlobal::staticQString("GRADIENT"); -const QString &KPrObject::tagPEN=KGlobal::staticQString("PEN"); -const QString &KPrObject::tagBRUSH=KGlobal::staticQString("BRUSH"); -const QString &KPrObject::attrValue=KGlobal::staticQString("value"); -const QString &KPrObject::attrC1=KGlobal::staticQString("color1"); -const QString &KPrObject::attrC2=KGlobal::staticQString("color2"); -const QString &KPrObject::attrType=KGlobal::staticQString("type"); -const QString &KPrObject::attrUnbalanced=KGlobal::staticQString("unbalanced"); -const QString &KPrObject::attrXFactor=KGlobal::staticQString("xfactor"); -const QString &KPrObject::attrYFactor=KGlobal::staticQString("yfactor"); -const QString &KPrObject::attrStyle=KGlobal::staticQString("style"); +const TQString &KPrObject::tagORIG=KGlobal::staticQString("ORIG"); +const TQString &KPrObject::attrX=KGlobal::staticQString("x"); +const TQString &KPrObject::attrY=KGlobal::staticQString("y"); +const TQString &KPrObject::tagSIZE=KGlobal::staticQString("SIZE"); +const TQString &KPrObject::attrWidth=KGlobal::staticQString("width"); +const TQString &KPrObject::attrHeight=KGlobal::staticQString("height"); +const TQString &KPrObject::tagSHADOW=KGlobal::staticQString("SHADOW"); +const TQString &KPrObject::attrDistance=KGlobal::staticQString("distance"); +const TQString &KPrObject::attrDirection=KGlobal::staticQString("direction"); +const TQString &KPrObject::attrColor=KGlobal::staticQString("color"); +const TQString &KPrObject::tagEFFECTS=KGlobal::staticQString("EFFECTS"); +const TQString &KPrObject::attrEffect=KGlobal::staticQString("effect"); +const TQString &KPrObject::attrEffect2=KGlobal::staticQString("effect2"); +const TQString &KPrObject::tagPRESNUM=KGlobal::staticQString("PRESNUM"); +const TQString &KPrObject::tagANGLE=KGlobal::staticQString("ANGLE"); +const TQString &KPrObject::tagDISAPPEAR=KGlobal::staticQString("DISAPPEAR"); +const TQString &KPrObject::attrDoit=KGlobal::staticQString("doit"); +const TQString &KPrObject::attrNum=KGlobal::staticQString("num"); +const TQString &KPrObject::tagFILLTYPE=KGlobal::staticQString("FILLTYPE"); +const TQString &KPrObject::tagGRADIENT=KGlobal::staticQString("GRADIENT"); +const TQString &KPrObject::tagPEN=KGlobal::staticQString("PEN"); +const TQString &KPrObject::tagBRUSH=KGlobal::staticQString("BRUSH"); +const TQString &KPrObject::attrValue=KGlobal::staticQString("value"); +const TQString &KPrObject::attrC1=KGlobal::staticQString("color1"); +const TQString &KPrObject::attrC2=KGlobal::staticQString("color2"); +const TQString &KPrObject::attrType=KGlobal::staticQString("type"); +const TQString &KPrObject::attrUnbalanced=KGlobal::staticQString("unbalanced"); +const TQString &KPrObject::attrXFactor=KGlobal::staticQString("xfactor"); +const TQString &KPrObject::attrYFactor=KGlobal::staticQString("yfactor"); +const TQString &KPrObject::attrStyle=KGlobal::staticQString("style"); KPrStartEndLine::KPrStartEndLine( LineEnd _start, LineEnd _end ) : lineBegin( _start ), lineEnd( _end ) { } -void KPrStartEndLine::save( QDomDocumentFragment &fragment, QDomDocument& doc ) +void KPrStartEndLine::save( TQDomDocumentFragment &fragment, TQDomDocument& doc ) { if (lineBegin!=L_NORMAL) fragment.appendChild(KPrStartEndLine::createValueElement("LINEBEGIN", static_cast<int>(lineBegin), doc)); @@ -94,17 +94,17 @@ void KPrStartEndLine::save( QDomDocumentFragment &fragment, QDomDocument& doc ) fragment.appendChild(KPrStartEndLine::createValueElement("LINEEND", static_cast<int>(lineEnd), doc)); } -QDomElement KPrStartEndLine::createValueElement(const QString &tag, int value, QDomDocument &doc) +TQDomElement KPrStartEndLine::createValueElement(const TQString &tag, int value, TQDomDocument &doc) { - QDomElement elem=doc.createElement(tag); + TQDomElement elem=doc.createElement(tag); elem.setAttribute("value", value); return elem; } -void KPrStartEndLine::load( const QDomElement &element ) +void KPrStartEndLine::load( const TQDomElement &element ) { - QDomElement e=element.namedItem("LINEBEGIN").toElement(); + TQDomElement e=element.namedItem("LINEBEGIN").toElement(); if(!e.isNull()) { int tmp=0; if(e.hasAttribute("value")) @@ -120,26 +120,26 @@ void KPrStartEndLine::load( const QDomElement &element ) } } -void KPrStartEndLine::loadOasisMarkerElement( KoOasisContext & context, const QString & attr, LineEnd &_element ) +void KPrStartEndLine::loadOasisMarkerElement( KoOasisContext & context, const TQString & attr, LineEnd &_element ) { - //kdDebug()<<"void KPrStartEndLine::loadOasisMarkerElement( KoOasisContext & context, const QString & attr, LineEnd &_element ) :"<<attr<<endl; + //kdDebug()<<"void KPrStartEndLine::loadOasisMarkerElement( KoOasisContext & context, const TQString & attr, LineEnd &_element ) :"<<attr<<endl; KoStyleStack &styleStack = context.styleStack(); styleStack.setTypeProperties( "graphic" ); if ( styleStack.hasAttributeNS( KoXmlNS::draw,attr.latin1() ) ) { - QString style = styleStack.attributeNS( KoXmlNS::draw, attr.latin1() ); + TQString style = styleStack.attributeNS( KoXmlNS::draw, attr.latin1() ); //kdDebug()<<" marker style is : "<<style<<endl; //type not defined by default //try to use style. - QDomElement* draw = context.oasisStyles().drawStyles()[style]; + TQDomElement* draw = context.oasisStyles().drawStyles()[style]; //kdDebug()<<" marker have oasis style defined :"<<draw<<endl; if ( draw ) { if( draw->hasAttributeNS( KoXmlNS::svg, "d" )) { - QString str = draw->attributeNS( KoXmlNS::svg, "d", QString::null ); + TQString str = draw->attributeNS( KoXmlNS::svg, "d", TQString() ); kdDebug()<<" svg type = "<<str<<endl; if ( str == lineEndBeginSvg( L_ARROW ) ) _element = L_ARROW; @@ -179,7 +179,7 @@ void KPrStartEndLine::saveOasisMarkerElement( KoGenStyles& mainStyles, KoGenSty } } -QString KPrStartEndLine::saveOasisMarkerStyle( KoGenStyles &mainStyles, const LineEnd &_element ) const +TQString KPrStartEndLine::saveOasisMarkerStyle( KoGenStyles &mainStyles, const LineEnd &_element ) const { KoGenStyle marker( KPrDocument::STYLE_MARKER /*, "graphic"*/ /*no name*/ ); // value used from ooimpress filter I don't know if it's good @@ -219,7 +219,7 @@ QString KPrStartEndLine::saveOasisMarkerStyle( KoGenStyles &mainStyles, const Li } KPrObject::KPrObject() - : orig(), ext(), shadowColor( Qt::gray ) + : orig(), ext(), shadowColor( TQt::gray ) { appearStep = 0; disappearStep = 1; @@ -233,9 +233,9 @@ KPrObject::KPrObject() disappearTimer = 1; appearSoundEffect = false; disappearSoundEffect = false; - a_fileName = QString::null; - d_fileName = QString::null; - objectName = QString::null; + a_fileName = TQString(); + d_fileName = TQString(); + objectName = TQString(); angle = 0.0; shadowDirection = SD_RIGHT_BOTTOM; shadowDistance = 0; @@ -257,18 +257,18 @@ KPrObject::~KPrObject() delete dcop; } -QDomDocumentFragment KPrObject::save( QDomDocument& doc, double offset ) +TQDomDocumentFragment KPrObject::save( TQDomDocument& doc, double offset ) { - QDomDocumentFragment fragment=doc.createDocumentFragment(); - QDomElement elem=doc.createElement(tagORIG); + TQDomDocumentFragment fragment=doc.createDocumentFragment(); + TQDomElement elem=doc.createElement(tagORIG); elem.setAttribute(attrX, orig.x()); - elem.setAttribute(attrY, QString::number( orig.y() + offset, 'g', DBL_DIG ) ); + elem.setAttribute(attrY, TQString::number( orig.y() + offset, 'g', DBL_DIG ) ); fragment.appendChild(elem); elem=doc.createElement(tagSIZE); elem.setAttribute(attrWidth, ext.width()); elem.setAttribute(attrHeight, ext.height()); fragment.appendChild(elem); - if(shadowDistance!=0 || shadowDirection!=SD_RIGHT_BOTTOM || shadowColor!=Qt::gray) { + if(shadowDistance!=0 || shadowDirection!=SD_RIGHT_BOTTOM || shadowColor!=TQt::gray) { elem=doc.createElement(tagSHADOW); elem.setAttribute(attrDistance, shadowDistance); elem.setAttribute(attrDirection, static_cast<int>( shadowDirection )); @@ -337,7 +337,7 @@ QDomDocumentFragment KPrObject::save( QDomDocument& doc, double offset ) void KPrObject::saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const { - xmlWriter.addAttribute( "draw:id", "object" + QString::number( indexObj ) ); + xmlWriter.addAttribute( "draw:id", "object" + TQString::number( indexObj ) ); //save all into pt xmlWriter.addAttributePt( "svg:width", ext.width() ); xmlWriter.addAttributePt( "svg:height", ext.height() ); @@ -345,7 +345,7 @@ void KPrObject::saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const if ( kAbs( angle ) > 1E-6 ) { double angInRad = -angle * M_PI / 180.0; - QWMatrix m( cos( angInRad ), -sin( angInRad ), sin( angInRad ), cos( angInRad ), 0, 0 ); + TQWMatrix m( cos( angInRad ), -sin( angInRad ), sin( angInRad ), cos( angInRad ), 0, 0 ); KoPoint center( ext.width() / 2, ext.height() / 2 ); double rotX = 0.0; double rotY = 0.0; @@ -353,11 +353,11 @@ void KPrObject::saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const KoPoint rot( rotX, rotY ); KoPoint trans( center - rot + orig ); - QCString transX; + TQCString transX; transX.setNum( trans.x(), 'g', DBL_DIG ); - QCString transY; + TQCString transY; transY.setNum( trans.y(), 'g', DBL_DIG ); - QString str = QString( "rotate(%1) translate(%2pt %3pt)" ).arg( angInRad ).arg( transX ).arg( transY ); + TQString str = TQString( "rotate(%1) translate(%2pt %3pt)" ).tqarg( angInRad ).tqarg( transX.data() ).tqarg( transY.data() ); xmlWriter.addAttribute( "draw:transform", str ); } else @@ -376,7 +376,7 @@ void KPrObject::saveOasisObjectProtectStyle( KoGenStyle &styleobjectauto ) const } } -QString KPrObject::getStyle( KPOasisSaveContext &sc ) const +TQString KPrObject::getStyle( KPOasisSaveContext &sc ) const { kdDebug(33001) << "KPrObject::getStyle" << endl; KoGenStyle styleObjectAuto; @@ -422,8 +422,8 @@ bool KPrObject::saveOasisObjectStyleShowAnimation( KoXmlWriter &animation, int o { if ( effect != EF_NONE || appearStep != 0 || !a_fileName.isEmpty() ) { - animation.startElement( "presentation:show-shape" ); - animation.addAttribute( "draw:shape-id", "object" + QString::number( objectId ) ); + animation.startElement( "presentation:show-tqshape" ); + animation.addAttribute( "draw:tqshape-id", "object" + TQString::number( objectId ) ); animation.addAttribute( "koffice:order-id", appearStep ); switch( effect ) @@ -522,8 +522,8 @@ bool KPrObject::saveOasisObjectStyleHideAnimation( KoXmlWriter &animation, int o //FIXME oo doesn't support hide animation object if ( effect3 != EF3_NONE || disappearStep != 0 || !d_fileName.isEmpty()) { - animation.startElement( "presentation:hide-shape" ); - animation.addAttribute( "draw:shape-id", "object" + QString::number( objectId ) ); + animation.startElement( "presentation:hide-tqshape" ); + animation.addAttribute( "draw:tqshape-id", "object" + TQString::number( objectId ) ); animation.addAttribute( "koffice:order-id", disappearStep ); switch( effect3 ) { @@ -611,14 +611,14 @@ bool KPrObject::saveOasisObjectStyleHideAnimation( KoXmlWriter &animation, int o return true; } -void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info) +void KPrObject::loadOasis(const TQDomElement &element, KoOasisContext & context, KPrLoadingInfo *info) { if(element.hasAttributeNS( KoXmlNS::draw, "name" )) - objectName = element.attributeNS( KoXmlNS::draw, "name", QString::null); - orig.setX( KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "x", QString::null ) ) ); - orig.setY( KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "y", QString::null ) ) ); - ext.setWidth(KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "width", QString::null )) ); - ext.setHeight(KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "height", QString::null ) ) ); + objectName = element.attributeNS( KoXmlNS::draw, "name", TQString()); + orig.setX( KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "x", TQString() ) ) ); + orig.setY( KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "y", TQString() ) ) ); + ext.setWidth(KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "width", TQString() )) ); + ext.setHeight(KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "height", TQString() ) ) ); //kdDebug()<<" orig.x() :"<<orig.x() <<" orig.y() :"<<orig.y() <<"ext.width() :"<<ext.width()<<" ext.height(): "<<ext.height()<<endl; KoStyleStack &styleStack = context.styleStack(); styleStack.setTypeProperties( "" ); //no type default type @@ -626,9 +626,9 @@ void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, { // there is some more stuff in the spezification // TODO make it work for all cases - QString transform = element.attributeNS( KoXmlNS::draw, "transform", QString::null ); + TQString transform = element.attributeNS( KoXmlNS::draw, "transform", TQString() ); kdDebug()<<" transform action :"<<transform<<endl; - QRegExp rx( "rotate ?\\(([^)]+)\\) translate ?\\(([^ ]+) ([^)]+)\\)" ); + TQRegExp rx( "rotate ?\\(([^)]+)\\) translate ?\\(([^ ]+) ([^)]+)\\)" ); if ( rx.search( transform ) != - 1 && rx.numCaptures() == 3 ) { bool ok = false; @@ -642,7 +642,7 @@ void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, angle = 0.0; angInRad = 0.0; } - QWMatrix m( cos( angInRad ), -sin( angInRad ), sin( angInRad ), cos( angInRad ), 0, 0 ); + TQWMatrix m( cos( angInRad ), -sin( angInRad ), sin( angInRad ), cos( angInRad ), 0, 0 ); KoPoint center( ext.width() / 2, ext.height() / 2 ); double transX = 0.0; double transY = 0.0; @@ -653,20 +653,20 @@ void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, kdDebug(33001) << "trans = " << trans << ", center = " << center << ", diff = " << diff << ", orig = " << orig << endl; } } - QDomElement *animation = 0L; + TQDomElement *animation = 0L; lstAnimation *tmp = 0L; if( element.hasAttributeNS( KoXmlNS::draw, "id")) { - tmp = info->animationShowById(element.attributeNS( KoXmlNS::draw, "id", QString::null) ); + tmp = info->animationShowById(element.attributeNS( KoXmlNS::draw, "id", TQString()) ); if ( tmp ) animation = tmp->element; } if( animation) { - QString effectStr = animation->attributeNS( KoXmlNS::presentation, "effect", QString::null); - QString dir = animation->attributeNS( KoXmlNS::presentation, "direction", QString::null); - QString speed = animation->attributeNS( KoXmlNS::presentation, "speed", QString::null ); + TQString effectStr = animation->attributeNS( KoXmlNS::presentation, "effect", TQString()); + TQString dir = animation->attributeNS( KoXmlNS::presentation, "direction", TQString()); + TQString speed = animation->attributeNS( KoXmlNS::presentation, "speed", TQString() ); appearStep = tmp->order; kdDebug()<<" appear direction : "<<dir<<" effect :"<< effectStr <<" speed :"<<speed<<endl; @@ -687,7 +687,7 @@ void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, if ( animation->hasAttributeNS( KoXmlNS::presentation, "animation-delay" ) ) { - appearTimer = loadOasisTimer(animation->attributeNS( KoXmlNS::presentation, "animation-delay", QString::null ) ); + appearTimer = loadOasisTimer(animation->attributeNS( KoXmlNS::presentation, "animation-delay", TQString() ) ); } if (effectStr=="fade") { @@ -733,19 +733,19 @@ void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, effect = EF_NONE; } - QString byParagaph = animation->attributeNS( KoXmlNS::koffice, "by-paragraph", QString::null ); + TQString byParagaph = animation->attributeNS( KoXmlNS::koffice, "by-paragraph", TQString() ); if ( byParagaph == "true" ) { effect2 = EF2T_PARA; } - QDomElement sound = KoDom::namedItemNS( *animation, KoXmlNS::presentation, "sound" ); + TQDomElement sound = KoDom::namedItemNS( *animation, KoXmlNS::presentation, "sound" ); if ( !sound.isNull() ) { kdDebug()<<" object has sound effect \n"; if ( sound.hasAttributeNS( KoXmlNS::xlink, "href" ) ) { - a_fileName =sound.attributeNS( KoXmlNS::xlink, "href", QString::null ); + a_fileName =sound.attributeNS( KoXmlNS::xlink, "href", TQString() ); appearSoundEffect = true; } } @@ -755,16 +755,16 @@ void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, tmp = 0L; if( element.hasAttributeNS( KoXmlNS::draw, "id")) { - tmp = info->animationHideById(element.attributeNS( KoXmlNS::draw, "id", QString::null) ); + tmp = info->animationHideById(element.attributeNS( KoXmlNS::draw, "id", TQString()) ); if ( tmp ) animation = tmp->element; } if( animation) { - QString effectStr = animation->attributeNS( KoXmlNS::presentation, "effect", QString::null); - QString dir = animation->attributeNS( KoXmlNS::presentation, "direction", QString::null); - QString speed = animation->attributeNS( KoXmlNS::presentation, "speed", QString::null ); + TQString effectStr = animation->attributeNS( KoXmlNS::presentation, "effect", TQString()); + TQString dir = animation->attributeNS( KoXmlNS::presentation, "direction", TQString()); + TQString speed = animation->attributeNS( KoXmlNS::presentation, "speed", TQString() ); kdDebug()<<" disappear direction : "<<dir<<" effect :"<< effectStr <<" speed :"<<speed<<endl; disappearStep = tmp->order; @@ -785,7 +785,7 @@ void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, if ( animation->hasAttributeNS( KoXmlNS::presentation, "animation-delay" ) ) { - disappearTimer = loadOasisTimer(animation->attributeNS( KoXmlNS::presentation, "animation-delay", QString::null ) ); + disappearTimer = loadOasisTimer(animation->attributeNS( KoXmlNS::presentation, "animation-delay", TQString() ) ); } if (effectStr=="fade") { @@ -833,13 +833,13 @@ void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, disappear = true; - QDomElement sound = KoDom::namedItemNS( *animation, KoXmlNS::presentation, "sound" ); + TQDomElement sound = KoDom::namedItemNS( *animation, KoXmlNS::presentation, "sound" ); if ( !sound.isNull() ) { kdDebug()<<" object has sound effect \n"; if ( sound.hasAttributeNS( KoXmlNS::xlink, "href" ) ) { - d_fileName =sound.attributeNS( KoXmlNS::xlink, "href", QString::null ); + d_fileName =sound.attributeNS( KoXmlNS::xlink, "href", TQString() ); disappearSoundEffect = true; } } @@ -853,11 +853,11 @@ void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, if ( styleStack.hasAttributeNS( KoXmlNS::fo, "text-shadow" ) && styleStack.attributeNS( KoXmlNS::fo, "text-shadow" ) != "none" ) { - QString distance = styleStack.attributeNS( KoXmlNS::fo, "text-shadow" ); - distance.truncate( distance.find( ' ' ) ); + TQString distance = styleStack.attributeNS( KoXmlNS::fo, "text-shadow" ); + distance.truncate( distance.tqfind( ' ' ) ); shadowDistance = (int)KoUnit::parseValue( distance ); shadowDirection = SD_RIGHT_BOTTOM; - shadowColor= QColor("#a0a0a0" ); + shadowColor= TQColor("#a0a0a0" ); } } #endif @@ -933,8 +933,8 @@ void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, shadowDistance = (int) fabs ( x ); } if ( styleStack.hasAttributeNS( KoXmlNS::draw, "shadow-color" ) ) - shadowColor= QColor(styleStack.attributeNS( KoXmlNS::draw, "shadow-color" ) ); - kdDebug()<<" shadow color : "<<shadowColor.name()<<endl; + shadowColor= TQColor(styleStack.attributeNS( KoXmlNS::draw, "shadow-color" ) ); + kdDebug()<<" shadow color : "<<TQString(shadowColor.name())<<endl; } } @@ -955,7 +955,7 @@ bool KPrObject::saveOasisObject( KPOasisSaveContext &sc ) const void KPrObject::saveOasisShadowElement( KoGenStyle &styleobjectauto ) const { //FIXME default value - if(shadowDistance!=0 || shadowDirection!=SD_RIGHT_BOTTOM || shadowColor!=Qt::gray) { + if(shadowDistance!=0 || shadowDirection!=SD_RIGHT_BOTTOM || shadowColor!=TQt::gray) { styleobjectauto.addProperty( "draw:shadow", "visible" ); switch( shadowDirection ) { @@ -996,10 +996,10 @@ void KPrObject::saveOasisShadowElement( KoGenStyle &styleobjectauto ) const } } -double KPrObject::load(const QDomElement &element) { +double KPrObject::load(const TQDomElement &element) { double offset=-1.0; - QDomElement e=element.namedItem(tagORIG).toElement(); + TQDomElement e=element.namedItem(tagORIG).toElement(); if(!e.isNull()) { if(e.hasAttribute(attrX)) orig.setX(e.attribute(attrX).toDouble()); @@ -1027,7 +1027,7 @@ double KPrObject::load(const QDomElement &element) { else { shadowDistance=0; shadowDirection=SD_RIGHT_BOTTOM; - shadowColor=Qt::gray; + shadowColor=TQt::gray; } e=element.namedItem(tagEFFECTS).toElement(); if(!e.isNull()) { @@ -1100,7 +1100,7 @@ double KPrObject::load(const QDomElement &element) { } else { appearSoundEffect = false; - a_fileName = QString::null; + a_fileName = TQString(); } e=element.namedItem("DISAPPEARSOUNDEFFECT").toElement(); if(!e.isNull()) { @@ -1111,7 +1111,7 @@ double KPrObject::load(const QDomElement &element) { } else { disappearSoundEffect = false; - d_fileName = QString::null; + d_fileName = TQString(); } e=element.namedItem("OBJECTNAME").toElement(); if(!e.isNull()) { @@ -1119,7 +1119,7 @@ double KPrObject::load(const QDomElement &element) { objectName = e.attribute("objectName"); } else { - objectName = QString::null; + objectName = TQString(); } e=element.namedItem("PROTECT").toElement(); if (!e.isNull()) @@ -1223,20 +1223,20 @@ KoRect KPrObject::rotateRectObject() const double yPos = -rr.y(); double xPos = -rr.x(); rr.moveTopLeft( KoPoint( -rr.width() / 2.0, -rr.height() / 2.0 ) ); - QWMatrix m; + TQWMatrix m; m.translate( pw / 2.0, ph / 2.0 ); m.rotate( angle ); m.translate( rr.left() + xPos, rr.top() + yPos ); - KoRect r = KoRect::fromQRect(m.mapRect( br.toQRect() )); // see above TODO + KoRect r = KoRect::fromTQRect(m.mapRect( br.toTQRect() )); // see above TODO r.moveBy( orig.x() , orig.y() ); return r; } -void KPrObject::rotateObject(QPainter *paint,KoTextZoomHandler *_zoomHandler) +void KPrObject::rotateObject(TQPainter *paint,KoTextZoomHandler *_zoomHandler) { KoRect rr = KoRect( 0, 0, ext.width(), ext.height() ); rr.moveTopLeft( KoPoint( -ext.width() / 2.0, -ext.height() / 2.0 ) ); - QWMatrix m; + TQWMatrix m; m.translate( _zoomHandler->zoomItX(ext.width() / 2.0), _zoomHandler->zoomItY(ext.height() / 2.0 )); m.rotate( angle ); m.translate( _zoomHandler->zoomItX(rr.left()), _zoomHandler->zoomItY(rr.top()) ); @@ -1244,9 +1244,9 @@ void KPrObject::rotateObject(QPainter *paint,KoTextZoomHandler *_zoomHandler) paint->setWorldMatrix( m, true ); } -bool KPrObject::contains( const KoPoint &point ) const +bool KPrObject::tqcontains( const KoPoint &point ) const { - return getRealRect().contains( point ); + return getRealRect().tqcontains( point ); } bool KPrObject::intersects( const KoRect &rect ) const @@ -1254,14 +1254,14 @@ bool KPrObject::intersects( const KoRect &rect ) const return getRealRect().intersects( rect ); } -QCursor KPrObject::getCursor( const KoPoint &_point, ModifyType &_modType, +TQCursor KPrObject::getCursor( const KoPoint &_point, ModifyType &_modType, KPrDocument *doc ) const { KoTextZoomHandler * zh = doc->zoomHandler(); int px = zh->zoomItX(_point.x()); int py = zh->zoomItY(_point.y()); - QRect rect = zh->zoomRect( getRealRect() ); + TQRect rect = zh->zoomRect( getRealRect() ); int ox = rect.left(); int oy = rect.top(); int ow = rect.width(); @@ -1270,84 +1270,84 @@ QCursor KPrObject::getCursor( const KoPoint &_point, ModifyType &_modType, bool headerFooter=doc->isHeaderFooter(this); int sz = 4; - if ( px >= ox && py >= oy && px <= ox + QMIN( ow / 3, sz ) && py <= oy + QMIN( oh / 3, sz ) ) + if ( px >= ox && py >= oy && px <= ox + TQMIN( ow / 3, sz ) && py <= oy + TQMIN( oh / 3, sz ) ) { _modType = MT_RESIZE_LU; if ( protect) - return Qt::ForbiddenCursor; - return Qt::sizeFDiagCursor; + return TQt::ForbiddenCursor; + return TQt::sizeFDiagCursor; } - if ( px >= ox && py >= oy + oh / 2 - QMIN( oh / 6, sz / 2 ) - && px <= ox + QMIN( ow / 3, sz) - && py <= oy + oh / 2 + QMIN( oh / 6, sz / 2 ) ) + if ( px >= ox && py >= oy + oh / 2 - TQMIN( oh / 6, sz / 2 ) + && px <= ox + TQMIN( ow / 3, sz) + && py <= oy + oh / 2 + TQMIN( oh / 6, sz / 2 ) ) { _modType = MT_RESIZE_LF; if ( protect) - return Qt::ForbiddenCursor; - return Qt::sizeHorCursor; + return TQt::ForbiddenCursor; + return TQt::sizeHorCursor; } - if ( px >= ox && py >= oy + oh - QMIN( oh / 3, sz ) && px <= ox + QMIN( ow / 3, sz ) && py <= oy + oh ) + if ( px >= ox && py >= oy + oh - TQMIN( oh / 3, sz ) && px <= ox + TQMIN( ow / 3, sz ) && py <= oy + oh ) { _modType = MT_RESIZE_LD; if ( protect) - return Qt::ForbiddenCursor; - return Qt::sizeBDiagCursor; + return TQt::ForbiddenCursor; + return TQt::sizeBDiagCursor; } - if ( px >= ox + ow / 2 - QMIN( ow / 6, sz / 2 ) && py >= oy - && px <= ox + ow / 2 + QMIN( ow / 6, sz / 2 ) - && py <= oy + QMIN( oh / 3, sz ) ) + if ( px >= ox + ow / 2 - TQMIN( ow / 6, sz / 2 ) && py >= oy + && px <= ox + ow / 2 + TQMIN( ow / 6, sz / 2 ) + && py <= oy + TQMIN( oh / 3, sz ) ) { _modType = MT_RESIZE_UP; if ( protect) - return Qt::ForbiddenCursor; - return Qt::sizeVerCursor; + return TQt::ForbiddenCursor; + return TQt::sizeVerCursor; } - if ( px >= ox + ow / 2 - QMIN( ow / 6, sz / 2 ) && py >= oy + oh - QMIN( oh / 3, sz ) - && px <= ox + ow / 2 + QMIN( ow / 6, sz / 2 ) && py <= oy + oh ) + if ( px >= ox + ow / 2 - TQMIN( ow / 6, sz / 2 ) && py >= oy + oh - TQMIN( oh / 3, sz ) + && px <= ox + ow / 2 + TQMIN( ow / 6, sz / 2 ) && py <= oy + oh ) { _modType = MT_RESIZE_DN; if ( protect) - return Qt::ForbiddenCursor; - return Qt::sizeVerCursor; + return TQt::ForbiddenCursor; + return TQt::sizeVerCursor; } - if ( px >= ox + ow - QMIN( ow / 3, sz ) && py >= oy && px <= ox + ow && py <= oy + QMIN( oh / 3, sz) ) + if ( px >= ox + ow - TQMIN( ow / 3, sz ) && py >= oy && px <= ox + ow && py <= oy + TQMIN( oh / 3, sz) ) { _modType = MT_RESIZE_RU; if ( protect) - return Qt::ForbiddenCursor; - return Qt::sizeBDiagCursor; + return TQt::ForbiddenCursor; + return TQt::sizeBDiagCursor; } - if ( px >= ox + ow - QMIN( ow / 3, sz ) && py >= oy + oh / 2 - QMIN( oh / 6, sz / 2 ) - && px <= ox + ow && py <= oy + oh / 2 + QMIN( oh / 6, sz / 2) ) + if ( px >= ox + ow - TQMIN( ow / 3, sz ) && py >= oy + oh / 2 - TQMIN( oh / 6, sz / 2 ) + && px <= ox + ow && py <= oy + oh / 2 + TQMIN( oh / 6, sz / 2) ) { _modType = MT_RESIZE_RT; if ( protect) - return Qt::ForbiddenCursor; - return Qt::sizeHorCursor; + return TQt::ForbiddenCursor; + return TQt::sizeHorCursor; } - if ( px >= ox + ow - QMIN( ow / 3, sz ) && py >= oy + oh - QMIN( oh / 3, sz) + if ( px >= ox + ow - TQMIN( ow / 3, sz ) && py >= oy + oh - TQMIN( oh / 3, sz) && px <= ox + ow && py <= oy + oh ) { _modType = MT_RESIZE_RD; if ( protect) - return Qt::ForbiddenCursor; - return Qt::sizeFDiagCursor; + return TQt::ForbiddenCursor; + return TQt::sizeFDiagCursor; } //header footer can't move if(!headerFooter) _modType = MT_MOVE; if ( protect ) - return Qt::ForbiddenCursor; + return TQt::ForbiddenCursor; else - return Qt::sizeAllCursor; + return TQt::sizeAllCursor; } void KPrObject::getShadowCoords( double& _x, double& _y ) const @@ -1401,15 +1401,15 @@ void KPrObject::getShadowCoords( double& _x, double& _y ) const _x = sx; _y = sy; } -void KPrObject::paintSelection( QPainter *_painter, KoTextZoomHandler *_zoomHandler, SelectionMode mode ) +void KPrObject::paintSelection( TQPainter *_painter, KoTextZoomHandler *_zoomHandler, SelectionMode mode ) { if ( !selected || mode == SM_NONE ) return; _painter->save(); _painter->translate( _zoomHandler->zoomItX(orig.x()), _zoomHandler->zoomItY(orig.y()) ); - _painter->setPen( QPen( Qt::black, 1, QPen::SolidLine ) ); - _painter->setBrush( kapp->palette().color( QPalette::Active, QColorGroup::Highlight ) ); + _painter->setPen( TQPen( TQt::black, 1, TQPen::SolidLine ) ); + _painter->setBrush( kapp->palette().color( TQPalette::Active, TQColorGroup::Highlight ) ); KoRect r = getRealRect(); @@ -1445,7 +1445,7 @@ void KPrObject::paintSelection( QPainter *_painter, KoTextZoomHandler *_zoomHand zX6=zX6-2; zY6=zY6-2; - QBrush brush=kapp->palette().color( QPalette::Active,QColorGroup::Base ); + TQBrush brush=kapp->palette().color( TQPalette::Active,TQColorGroup::Base ); _painter->fillRect( x, y, zX6, zY6, brush ); _painter->fillRect( x, y + h / 2, zX6, zY6, brush); _painter->fillRect( x, y + h, zX6, zY6, brush ); @@ -1479,27 +1479,27 @@ DCOPObject* KPrObject::dcopObject() return dcop; } -void KPrObject::setupClipRegion( QPainter *painter, const QRegion &clipRegion ) +void KPrObject::setupClipRegion( TQPainter *painter, const TQRegion &clipRegion ) { - QRegion region = painter->clipRegion( QPainter::CoordPainter ); + TQRegion region = painter->clipRegion( TQPainter::CoordPainter ); if ( region.isEmpty() ) region = clipRegion; else region.unite( clipRegion ); - painter->setClipRegion( region, QPainter::CoordPainter ); + painter->setClipRegion( region, TQPainter::CoordPainter ); } -QDomElement KPrObject::createValueElement(const QString &tag, int value, QDomDocument &doc) { - QDomElement elem=doc.createElement(tag); +TQDomElement KPrObject::createValueElement(const TQString &tag, int value, TQDomDocument &doc) { + TQDomElement elem=doc.createElement(tag); elem.setAttribute(attrValue, value); return elem; } -QDomElement KPrObject::createGradientElement(const QString &tag, const QColor &c1, const QColor &c2, +TQDomElement KPrObject::createGradientElement(const TQString &tag, const TQColor &c1, const TQColor &c2, int type, bool unbalanced, int xfactor, - int yfactor, QDomDocument &doc) { - QDomElement elem=doc.createElement(tag); + int yfactor, TQDomDocument &doc) { + TQDomElement elem=doc.createElement(tag); elem.setAttribute(attrC1, c1.name()); elem.setAttribute(attrC2, c2.name()); elem.setAttribute(attrType, type); @@ -1509,16 +1509,16 @@ QDomElement KPrObject::createGradientElement(const QString &tag, const QColor &c return elem; } -QDomElement KPrObject::createPenElement(const QString &tag, const KoPen &pen, QDomDocument &doc) { +TQDomElement KPrObject::createPenElement(const TQString &tag, const KoPen &pen, TQDomDocument &doc) { - QDomElement elem=doc.createElement(tag); + TQDomElement elem=doc.createElement(tag); elem.setAttribute(attrColor, pen.color().name()); elem.setAttribute(attrWidth, pen.pointWidth()); elem.setAttribute(attrStyle, static_cast<int>(pen.style())); return elem; } -KoPen KPrObject::toPen(const QDomElement &element) const { +KoPen KPrObject::toPen(const TQDomElement &element) const { KoPen pen; pen.setColor(retrieveColor(element)); @@ -1529,26 +1529,26 @@ KoPen KPrObject::toPen(const QDomElement &element) const { return pen; } -QDomElement KPrObject::createBrushElement(const QString &tag, const QBrush &brush, QDomDocument &doc) { +TQDomElement KPrObject::createBrushElement(const TQString &tag, const TQBrush &brush, TQDomDocument &doc) { - QDomElement elem=doc.createElement(tag); + TQDomElement elem=doc.createElement(tag); elem.setAttribute(attrColor, brush.color().name()); elem.setAttribute(attrStyle, static_cast<int>(brush.style())); return elem; } -QBrush KPrObject::toBrush(const QDomElement &element) const { +TQBrush KPrObject::toBrush(const TQDomElement &element) const { - QBrush brush; + TQBrush brush; brush.setColor(retrieveColor(element)); if(element.hasAttribute(attrStyle)) brush.setStyle(static_cast<Qt::BrushStyle>(element.attribute(attrStyle).toInt())); return brush; } -QColor KPrObject::retrieveColor(const QDomElement &element, const QString &cattr, - const QString &rattr, const QString &gattr, const QString &battr) const { - QColor ret; +TQColor KPrObject::retrieveColor(const TQDomElement &element, const TQString &cattr, + const TQString &rattr, const TQString &gattr, const TQString &battr) const { + TQColor ret; if(element.hasAttribute(cattr)) ret.setNamedColor(element.attribute(cattr)); else { @@ -1564,7 +1564,7 @@ QColor KPrObject::retrieveColor(const QDomElement &element, const QString &cattr return ret; } -void KPrObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler, +void KPrObject::draw( TQPainter *_painter, KoTextZoomHandler*_zoomHandler, int /*pageNum*/, SelectionMode selectionMode, bool drawContour ) { if ( selectionMode != SM_NONE && !drawContour ) @@ -1622,7 +1622,7 @@ void KPrObject::getRealSizeAndOrigFromPoints( KoPointArray &points, float angle, orig.setY( orig.y() + mid_y + min_y ); } -void KPrObject::addSelfToGuides(QValueList<double> &horizontalPos, QValueList<double> &verticalPos ) +void KPrObject::addSelfToGuides(TQValueList<double> &horizontalPos, TQValueList<double> &verticalPos ) { KoRect bounds = getRealRect(); @@ -1647,9 +1647,9 @@ KPrShadowObject &KPrShadowObject::operator=( const KPrShadowObject & ) return *this; } -QDomDocumentFragment KPrShadowObject::save( QDomDocument& doc,double offset ) +TQDomDocumentFragment KPrShadowObject::save( TQDomDocument& doc,double offset ) { - QDomDocumentFragment fragment=KPrObject::save(doc, offset); + TQDomDocumentFragment fragment=KPrObject::save(doc, offset); if(pen!=defaultPen()) fragment.appendChild(KPrObject::createPenElement(tagPEN, pen, doc)); @@ -1660,16 +1660,16 @@ void KPrShadowObject::saveOasisStrokeElement( KoGenStyles& mainStyles, KoGenStyl { switch( pen.style() ) { - case Qt::NoPen: + case TQt::NoPen: styleobjectauto.addProperty( "draw:stroke" , "none" ); break; - case Qt::SolidLine: + case TQt::SolidLine: styleobjectauto.addProperty( "draw:stroke" , "solid" ); break; - case Qt::DashLine: - case Qt::DotLine: - case Qt::DashDotLine: - case Qt::DashDotDotLine: + case TQt::DashLine: + case TQt::DotLine: + case TQt::DashDotLine: + case TQt::DashDotDotLine: styleobjectauto.addProperty( "draw:stroke" , "dash" ); //TODO FIXME styleobjectauto.addProperty( "draw:stroke-dash", saveOasisStrokeStyle( mainStyles ) ); @@ -1677,25 +1677,25 @@ void KPrShadowObject::saveOasisStrokeElement( KoGenStyles& mainStyles, KoGenStyl default: break; } - if ( pen.style() != Qt::NoPen ) + if ( pen.style() != TQt::NoPen ) { styleobjectauto.addProperty( "svg:stroke-color", pen.color().name() ); styleobjectauto.addPropertyPt( "svg:stroke-width", pen.pointWidth() ); } } -QString KPrShadowObject::saveOasisStrokeStyle( KoGenStyles& mainStyles ) const +TQString KPrShadowObject::saveOasisStrokeStyle( KoGenStyles& mainStyles ) const { KoGenStyle stroke( KPrDocument::STYLE_STROKE /*, "graphic"*/ /*no name*/ ); switch( pen.style() ) { - case Qt::NoPen: + case TQt::NoPen: //nothing break; - case Qt::SolidLine: + case TQt::SolidLine: //nothing break; - case Qt::DashLine: //value from ooimpress filter + case TQt::DashLine: //value from ooimpress filter stroke.addAttribute( "draw:style", "rect" ); stroke.addAttribute( "draw:dots1", "1" ); stroke.addAttribute( "draw:dots2", "1" ); @@ -1703,12 +1703,12 @@ QString KPrShadowObject::saveOasisStrokeStyle( KoGenStyles& mainStyles ) const stroke.addAttribute( "draw:dots2-length", "0.508cm" ); stroke.addAttribute( "draw:distance", "0.508cm" ); break; - case Qt::DotLine: + case TQt::DotLine: stroke.addAttribute( "draw:style", "rect" ); stroke.addAttribute( "draw:dots1", "1" ); stroke.addAttribute( "draw:distance", "0.257cm" ); break; - case Qt::DashDotLine: + case TQt::DashDotLine: stroke.addAttribute( "draw:style", "rect" ); stroke.addAttribute( "draw:dots1", "1" ); stroke.addAttribute( "draw:dots2", "1" ); @@ -1716,7 +1716,7 @@ QString KPrShadowObject::saveOasisStrokeStyle( KoGenStyles& mainStyles ) const stroke.addAttribute( "draw:dots2-length", "0.254cm" ); stroke.addAttribute( "draw:distance", "0.127cm" ); break; - case Qt::DashDotDotLine: + case TQt::DashDotDotLine: stroke.addAttribute( "draw:style", "rect" ); stroke.addAttribute( "draw:dots1", "2" ); stroke.addAttribute( "draw:dots2", "1" ); @@ -1732,7 +1732,7 @@ QString KPrShadowObject::saveOasisStrokeStyle( KoGenStyles& mainStyles ) const bool KPrShadowObject::saveOasisDrawPoints( const KoPointArray &points, KPOasisSaveContext &sc ) { - QString listOfPoint; + TQString listOfPoint; int maxX=0; int maxY=0; KoPointArray::ConstIterator it( points.begin() ); @@ -1743,26 +1743,26 @@ bool KPrShadowObject::saveOasisDrawPoints( const KoPointArray &points, KPOasisSa int tmpY = int( ( *it ).y() * 10000 ); // no space allows before first element if ( !listOfPoint.isEmpty() ) - listOfPoint += QString( " %1,%2" ).arg( tmpX ).arg( tmpY ); + listOfPoint += TQString( " %1,%2" ).tqarg( tmpX ).tqarg( tmpY ); else - listOfPoint = QString( "%1,%2" ).arg( tmpX ).arg( tmpY ); - maxX = QMAX( maxX, tmpX ); - maxY = QMAX( maxY, tmpY ); + listOfPoint = TQString( "%1,%2" ).tqarg( tmpX ).tqarg( tmpY ); + maxX = TQMAX( maxX, tmpX ); + maxY = TQMAX( maxY, tmpY ); } sc.xmlWriter.addAttribute("draw:points", listOfPoint ); - sc.xmlWriter.addAttribute("svg:viewBox", QString( "0 0 %1 %2" ).arg( maxX ).arg( maxY ) ); + sc.xmlWriter.addAttribute("svg:viewBox", TQString( "0 0 %1 %2" ).tqarg( maxX ).tqarg( maxY ) ); return true; } -bool KPrShadowObject::loadOasisDrawPoints( KoPointArray &points, const QDomElement &element, +bool KPrShadowObject::loadOasisDrawPoints( KoPointArray &points, const TQDomElement &element, KoOasisContext & context, KPrLoadingInfo *info ) { Q_UNUSED( context ); Q_UNUSED( info ); - QStringList ptList = QStringList::split(' ', element.attributeNS( KoXmlNS::draw, "points", QString::null)); + TQStringList ptList = TQStringList::split(' ', element.attributeNS( KoXmlNS::draw, "points", TQString())); unsigned int index = 0; - for (QStringList::Iterator it = ptList.begin(); it != ptList.end(); ++it) + for (TQStringList::Iterator it = ptList.begin(); it != ptList.end(); ++it) { points.putPoints( index++, 1, ( *it ).section( ',', 0, 0 ).toInt(), ( *it ).section( ',', 1, 1 ).toInt() ); } @@ -1771,15 +1771,15 @@ bool KPrShadowObject::loadOasisDrawPoints( KoPointArray &points, const QDomEleme } -bool KPrShadowObject::loadOasisApplyViewBox( const QDomElement &element, KoPointArray &points ) +bool KPrShadowObject::loadOasisApplyViewBox( const TQDomElement &element, KoPointArray &points ) { - kdDebug(33001) << "loadOasisApplayViewBox svg:viewBox = " << element.attributeNS( KoXmlNS::svg, "viewBox", QString::null ) << endl; - QStringList viewBoxPoints = QStringList::split( ' ', element.attributeNS( KoXmlNS::svg, "viewBox", QString::null ) ); + kdDebug(33001) << "loadOasisApplayViewBox svg:viewBox = " << element.attributeNS( KoXmlNS::svg, "viewBox", TQString() ) << endl; + TQStringList viewBoxPoints = TQStringList::split( ' ', element.attributeNS( KoXmlNS::svg, "viewBox", TQString() ) ); KoRect viewBox; if ( viewBoxPoints.size() == 4 ) { - QStringList::Iterator it = viewBoxPoints.begin(); + TQStringList::Iterator it = viewBoxPoints.begin(); //viewBox.setCoords( ( *it++ ).toInt(), ( *it++ ).toInt(), ( *it++ ).toInt(), ( *it ).toInt() ); viewBox.setLeft( ( *it++ ).toInt() ); viewBox.setTop( ( *it++ ).toInt() ); @@ -1803,10 +1803,10 @@ bool KPrShadowObject::loadOasisApplyViewBox( const QDomElement &element, KoPoint } else { - viewBox.setLeft( QMIN( viewBox.left(), p.x() ) ); - viewBox.setRight( QMAX( viewBox.right(), p.x() ) ); - viewBox.setTop( QMIN( viewBox.top(), p.y() ) ); - viewBox.setBottom( QMAX( viewBox.bottom(), p.y() ) ); + viewBox.setLeft( TQMIN( viewBox.left(), p.x() ) ); + viewBox.setRight( TQMAX( viewBox.right(), p.x() ) ); + viewBox.setTop( TQMIN( viewBox.top(), p.y() ) ); + viewBox.setBottom( TQMAX( viewBox.bottom(), p.y() ) ); } } kdDebug(33001) << "viewBox calculated = " << viewBox << endl; @@ -1837,9 +1837,9 @@ void KPrShadowObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainS saveOasisStrokeElement( mainStyles, styleObjectAuto ); } -void KPrShadowObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info) +void KPrShadowObject::loadOasis(const TQDomElement &element, KoOasisContext & context, KPrLoadingInfo *info) { - //kdDebug()<<"void KPrShadowObject::loadOasis(const QDomElement &element)**********************\n"; + //kdDebug()<<"void KPrShadowObject::loadOasis(const TQDomElement &element)**********************\n"; KPrObject::loadOasis(element, context, info); KoStyleStack &styleStack = context.styleStack(); styleStack.setTypeProperties( "graphic" ); @@ -1851,37 +1851,37 @@ void KPrShadowObject::loadOasis(const QDomElement &element, KoOasisContext & con pen.setStyle(Qt::SolidLine ); else if ( styleStack.attributeNS( KoXmlNS::draw, "stroke" ) == "dash" ) { - QString style = styleStack.attributeNS( KoXmlNS::draw, "stroke-dash" ); + TQString style = styleStack.attributeNS( KoXmlNS::draw, "stroke-dash" ); kdDebug()<<" stroke style is : "<<style<<endl; //type not defined by default //try to use style. - QDomElement* draw = context.oasisStyles().drawStyles()[style]; + TQDomElement* draw = context.oasisStyles().drawStyles()[style]; kdDebug()<<" stroke have oasis style defined :"<<draw<<endl; if ( draw ) { //FIXME - if ( draw->attributeNS( KoXmlNS::draw, "style", QString::null )=="rect" ) + if ( draw->attributeNS( KoXmlNS::draw, "style", TQString() )=="rect" ) { - if ( draw->attributeNS( KoXmlNS::draw, "dots1", QString::null )=="1" && - draw->attributeNS( KoXmlNS::draw, "dots2", QString::null )=="1" && - draw->attributeNS( KoXmlNS::draw, "dots1-length", QString::null )=="0.508cm" && - draw->attributeNS( KoXmlNS::draw, "dots2-length", QString::null )=="0.508cm" && - draw->attributeNS( KoXmlNS::draw, "distance", QString::null )=="0.508cm" ) - pen.setStyle( Qt::DashLine ); - else if ( draw->attributeNS( KoXmlNS::draw, "dots1", QString::null )=="1" && - draw->attributeNS( KoXmlNS::draw, "distance", QString::null )=="0.257cm" ) + if ( draw->attributeNS( KoXmlNS::draw, "dots1", TQString() )=="1" && + draw->attributeNS( KoXmlNS::draw, "dots2", TQString() )=="1" && + draw->attributeNS( KoXmlNS::draw, "dots1-length", TQString() )=="0.508cm" && + draw->attributeNS( KoXmlNS::draw, "dots2-length", TQString() )=="0.508cm" && + draw->attributeNS( KoXmlNS::draw, "distance", TQString() )=="0.508cm" ) + pen.setStyle(Qt::DashLine ); + else if ( draw->attributeNS( KoXmlNS::draw, "dots1", TQString() )=="1" && + draw->attributeNS( KoXmlNS::draw, "distance", TQString() )=="0.257cm" ) pen.setStyle(Qt::DotLine ); - else if ( draw->attributeNS( KoXmlNS::draw, "dots1", QString::null )=="1" && - draw->attributeNS( KoXmlNS::draw, "dots2", QString::null )=="1" && - draw->attributeNS( KoXmlNS::draw, "dots1-length", QString::null )=="0.051cm" && - draw->attributeNS( KoXmlNS::draw, "dots2-length", QString::null )=="0.254cm" && - draw->attributeNS( KoXmlNS::draw, "distance", QString::null )=="0.127cm" ) + else if ( draw->attributeNS( KoXmlNS::draw, "dots1", TQString() )=="1" && + draw->attributeNS( KoXmlNS::draw, "dots2", TQString() )=="1" && + draw->attributeNS( KoXmlNS::draw, "dots1-length", TQString() )=="0.051cm" && + draw->attributeNS( KoXmlNS::draw, "dots2-length", TQString() )=="0.254cm" && + draw->attributeNS( KoXmlNS::draw, "distance", TQString() )=="0.127cm" ) pen.setStyle(Qt::DashDotLine ); - else if ( draw->attributeNS( KoXmlNS::draw, "dots1", QString::null )=="2" && - draw->attributeNS( KoXmlNS::draw, "dots2", QString::null )=="1" && - draw->attributeNS( KoXmlNS::draw, "dots2-length", QString::null )=="0.203cm" && - draw->attributeNS( KoXmlNS::draw, "distance", QString::null )=="0.203cm" ) + else if ( draw->attributeNS( KoXmlNS::draw, "dots1", TQString() )=="2" && + draw->attributeNS( KoXmlNS::draw, "dots2", TQString() )=="1" && + draw->attributeNS( KoXmlNS::draw, "dots2-length", TQString() )=="0.203cm" && + draw->attributeNS( KoXmlNS::draw, "distance", TQString() )=="0.203cm" ) pen.setStyle(Qt::DashDotDotLine ); else { @@ -1903,10 +1903,10 @@ void KPrShadowObject::loadOasis(const QDomElement &element, KoOasisContext & con kdDebug()<<"pen style :"<<pen<<endl; } -double KPrShadowObject::load(const QDomElement &element) +double KPrShadowObject::load(const TQDomElement &element) { double offset=KPrObject::load(element); - QDomElement e=element.namedItem(tagPEN).toElement(); + TQDomElement e=element.namedItem(tagPEN).toElement(); if(!e.isNull()) setPen(KPrObject::toPen(e)); else @@ -1914,7 +1914,7 @@ double KPrShadowObject::load(const QDomElement &element) return offset; } -void KPrShadowObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler, +void KPrShadowObject::draw( TQPainter *_painter, KoTextZoomHandler*_zoomHandler, int pageNum, SelectionMode selectionMode, bool drawContour ) { double ox = orig.x(); @@ -1928,7 +1928,7 @@ void KPrShadowObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler, // tz TODO fix tmpPen usage KoPen tmpPen( pen ); pen.setColor( shadowColor ); - QBrush brush; + TQBrush brush; brush.setColor( shadowColor ); double sx = ox; @@ -1964,7 +1964,7 @@ KoPen KPrShadowObject::defaultPen() const return KoPen(); } -void KPrShadowObject::paint(QPainter* painter, KoTextZoomHandler* zoomHandler, int pageNum, bool drawingShadow, bool drawContour) { +void KPrShadowObject::paint(TQPainter* painter, KoTextZoomHandler* zoomHandler, int pageNum, bool drawingShadow, bool drawContour) { Q_UNUSED(painter); Q_UNUSED(zoomHandler); Q_UNUSED(pageNum); @@ -1979,8 +1979,8 @@ KPr2DObject::KPr2DObject() { } -KPr2DObject::KPr2DObject( const KoPen &_pen, const QBrush &_brush, FillType _fillType, - const QColor &_gColor1, const QColor &_gColor2, BCType _gType, +KPr2DObject::KPr2DObject( const KoPen &_pen, const TQBrush &_brush, FillType _fillType, + const TQColor &_gColor1, const TQColor &_gColor2, BCType _gType, bool _unbalanced, int _xfactor, int _yfactor ) : KPrShadowObject( _pen ) , m_brush( _brush, _gColor1, _gColor2, _gType, _fillType, _unbalanced, _xfactor, _yfactor ) @@ -2014,23 +2014,23 @@ void KPr2DObject::setFillType( FillType _fillType ) } } -QDomDocumentFragment KPr2DObject::save( QDomDocument& doc,double offset ) +TQDomDocumentFragment KPr2DObject::save( TQDomDocument& doc,double offset ) { - QDomDocumentFragment fragment=KPrShadowObject::save(doc, offset); - QBrush brush = getBrush(); - if ( brush != QBrush() ) + TQDomDocumentFragment fragment=KPrShadowObject::save(doc, offset); + TQBrush brush = getBrush(); + if ( brush != TQBrush() ) fragment.appendChild( KPrObject::createBrushElement( tagBRUSH, brush, doc ) ); FillType fillType = getFillType(); if ( fillType != FT_BRUSH ) fragment.appendChild( KPrObject::createValueElement( tagFILLTYPE, static_cast<int>(fillType), doc ) ); - QColor gColor1 = getGColor1(); - QColor gColor2 = getGColor2(); + TQColor gColor1 = getGColor1(); + TQColor gColor2 = getGColor2(); BCType gType = getGType(); bool unbalanced = getGUnbalanced(); int xfactor = getGXFactor(); int yfactor = getGYFactor(); - if ( gColor1!=Qt::red || gColor2!=Qt::green || gType!=BCT_GHORZ || unbalanced || xfactor != 100 || yfactor != 100 ) + if ( gColor1!=TQt::red || gColor2!=TQt::green || gType!=BCT_GHORZ || unbalanced || xfactor != 100 || yfactor != 100 ) fragment.appendChild( KPrObject::createGradientElement( tagGRADIENT, gColor1, gColor2, static_cast<int>(gType), unbalanced, xfactor, yfactor, doc)); return fragment; @@ -2044,21 +2044,21 @@ void KPr2DObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyle } -void KPr2DObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info) +void KPr2DObject::loadOasis(const TQDomElement &element, KoOasisContext & context, KPrLoadingInfo *info) { - kdDebug()<<"void KPr2DObject::loadOasis(const QDomElement &element)\n"; - QBrush tmpBrush; + kdDebug()<<"void KPr2DObject::loadOasis(const TQDomElement &element)\n"; + TQBrush tmpBrush; KPrShadowObject::loadOasis(element, context, info); m_brush.loadOasisFillStyle( context, "graphic" ); setFillType( m_brush.getFillType() ); } -double KPr2DObject::load(const QDomElement &element) +double KPr2DObject::load(const TQDomElement &element) { double offset=KPrShadowObject::load(element); - QDomElement e=element.namedItem(tagFILLTYPE).toElement(); + TQDomElement e=element.namedItem(tagFILLTYPE).toElement(); if(!e.isNull()) { if(e.hasAttribute(attrValue)) setFillType(static_cast<FillType>(e.attribute(attrValue).toInt())); @@ -2070,7 +2070,7 @@ double KPr2DObject::load(const QDomElement &element) if(!e.isNull()) setBrush(KPrObject::toBrush(e)); else - setBrush( QBrush() ); + setBrush( TQBrush() ); e=element.namedItem(tagGRADIENT).toElement(); if(!e.isNull()) { @@ -2088,8 +2088,8 @@ double KPr2DObject::load(const QDomElement &element) gradient->setParameters(getGColor1(), getGColor2(), getGType(), getGUnbalanced(), getGXFactor(), getGYFactor() ); } else { - setGColor1( Qt::red ); - setGColor2( Qt::green ); + setGColor1( TQt::red ); + setGColor2( TQt::green ); setGType( BCT_GHORZ ); setGUnbalanced( false ); setGXFactor( 100 ); @@ -2098,7 +2098,7 @@ double KPr2DObject::load(const QDomElement &element) return offset; } -void KPr2DObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler, +void KPr2DObject::draw( TQPainter *_painter, KoTextZoomHandler*_zoomHandler, int pageNum, SelectionMode selectionMode, bool drawContour ) { double ox = orig.x(); @@ -2111,8 +2111,8 @@ void KPr2DObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler, _painter->save(); KoPen tmpPen( pen ); pen.setColor( shadowColor ); - QBrush tmpBrush( m_brush.getBrush() ); - QBrush shadowBrush( tmpBrush ); + TQBrush tmpBrush( m_brush.getBrush() ); + TQBrush shadowBrush( tmpBrush ); shadowBrush.setColor( shadowColor ); m_brush.setBrush( shadowBrush ); @@ -2161,7 +2161,7 @@ void KPr2DObject::flip( bool horizontal ) { ( ! horizontal && gType == BCT_GDIAGONAL2 ) || ( ! horizontal && gType == BCT_GHORZ ) || ( horizontal && gType == BCT_GVERT ) ) { - QColor gColorTemp; + TQColor gColorTemp; gColorTemp = getGColor1(); setGColor1( getGColor2() ); setGColor2( gColorTemp ); |