diff options
Diffstat (limited to 'kspread/kspread_object.cc')
-rw-r--r-- | kspread/kspread_object.cc | 520 |
1 files changed, 260 insertions, 260 deletions
diff --git a/kspread/kspread_object.cc b/kspread/kspread_object.cc index 29a5162a..71cbbd75 100644 --- a/kspread/kspread_object.cc +++ b/kspread/kspread_object.cc @@ -29,15 +29,15 @@ #include <kparts/partmanager.h> #include <koChart.h> -#include <qbitmap.h> -#include <qbuffer.h> -#include <qcursor.h> -#include <qdom.h> -#include <qfileinfo.h> -#include <qimage.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qwmatrix.h> +#include <tqbitmap.h> +#include <tqbuffer.h> +#include <tqcursor.h> +#include <tqdom.h> +#include <tqfileinfo.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqwmatrix.h> #include <KoDocument.h> #include <KoDocumentChild.h> @@ -55,8 +55,8 @@ class View; * EmbeddedObject * **********************************************************/ -EmbeddedObject::EmbeddedObject( Sheet *_sheet, const KoRect& _geometry ) - : m_geometry( _geometry), m_sheet(_sheet), m_objectName(""), m_selected(false), m_protect(false), m_keepRatio(false), pen( Qt::black, 1, QPen::SolidLine ) +EmbeddedObject::EmbeddedObject( Sheet *_sheet, const KoRect& _tqgeometry ) + : m_tqgeometry( _tqgeometry), m_sheet(_sheet), m_objectName(""), m_selected(false), m_protect(false), m_keepRatio(false), pen( TQt::black, 1, Qt::SolidLine ) { angle = 0.0; inObjList = true; @@ -66,23 +66,23 @@ EmbeddedObject::EmbeddedObject( Sheet *_sheet, const KoRect& _geometry ) EmbeddedObject::~EmbeddedObject() { } -KoRect EmbeddedObject::geometry() +KoRect EmbeddedObject::tqgeometry() { - return m_geometry; + return m_tqgeometry; } void EmbeddedObject::setGeometry( const KoRect &rect ) { - m_geometry = rect; + m_tqgeometry = rect; } void EmbeddedObject::moveBy( const KoPoint &_point ) { - m_geometry.moveTopLeft( m_geometry.topLeft() + _point ); + m_tqgeometry.moveTopLeft( m_tqgeometry.topLeft() + _point ); } void EmbeddedObject::moveBy( double _dx, double _dy ) { - m_geometry.moveTopLeft( m_geometry.topLeft() + KoPoint( _dx, _dy ) ); + m_tqgeometry.moveTopLeft( m_tqgeometry.topLeft() + KoPoint( _dx, _dy ) ); } void EmbeddedObject::resizeBy( const KoSize & _size ) @@ -92,23 +92,23 @@ void EmbeddedObject::resizeBy( const KoSize & _size ) void EmbeddedObject::resizeBy( double _dx, double _dy) { - m_geometry.setSize( KoSize( m_geometry.width()+_dx, m_geometry.height()+_dy) ); + m_tqgeometry.setSize( KoSize( m_tqgeometry.width()+_dx, m_tqgeometry.height()+_dy) ); } // call (possibly reimplemented) setSize -bool EmbeddedObject::load( const QDomElement& /*element*/ ) +bool EmbeddedObject::load( const TQDomElement& /*element*/ ) { kdDebug() << "Loading EmbeddedObject" << endl; return false; } -void EmbeddedObject::loadOasis(const QDomElement &element, KoOasisLoadingContext & context ) +void EmbeddedObject::loadOasis(const TQDomElement &element, KoOasisLoadingContext & context ) { if(element.hasAttributeNS( KoXmlNS::draw, "name" )) - m_objectName = element.attributeNS( KoXmlNS::draw, "name", QString::null); - m_geometry.setX( KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "x", QString::null ) ) ); - m_geometry.setY( KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "y", QString::null ) ) ); - m_geometry.setWidth(KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "width", QString::null )) ); - m_geometry.setHeight(KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "height", QString::null ) ) ); + m_objectName = element.attributeNS( KoXmlNS::draw, "name", TQString()); + m_tqgeometry.setX( KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "x", TQString() ) ) ); + m_tqgeometry.setY( KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "y", TQString() ) ) ); + m_tqgeometry.setWidth(KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "width", TQString() )) ); + m_tqgeometry.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(); @@ -116,25 +116,25 @@ void EmbeddedObject::loadOasis(const QDomElement &element, KoOasisLoadingContext } -QDomElement EmbeddedObject::save( QDomDocument& /*doc*/ ) +TQDomElement EmbeddedObject::save( TQDomDocument& /*doc*/ ) { kdDebug() << "Saving EmbeddedObject..." << endl; - return QDomElement(); + return TQDomElement(); } void EmbeddedObject::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:x", sheet()->doc()->savingWholeDocument() ? m_geometry.x() : m_geometry.x() + 20.0 ); - xmlWriter.addAttributePt( "svg:y", sheet()->doc()->savingWholeDocument() ? m_geometry.y() : m_geometry.y() + 20.0 ); - xmlWriter.addAttributePt( "svg:width", m_geometry.width() ); - xmlWriter.addAttributePt( "svg:height", m_geometry.height() ); + xmlWriter.addAttributePt( "svg:x", sheet()->doc()->savingWholeDocument() ? m_tqgeometry.x() : m_tqgeometry.x() + 20.0 ); + xmlWriter.addAttributePt( "svg:y", sheet()->doc()->savingWholeDocument() ? m_tqgeometry.y() : m_tqgeometry.y() + 20.0 ); + xmlWriter.addAttributePt( "svg:width", m_tqgeometry.width() ); + xmlWriter.addAttributePt( "svg:height", m_tqgeometry.height() ); // if ( kAbs( angle ) > 1E-6 ) // { // double value = -1 * ( ( double )angle* M_PI )/180.0; -// QString str=QString( "rotate (%1)" ).arg( value ); +// TQString str=TQString( "rotate (%1)" ).tqarg( value ); // xmlWriter.addAttribute( "draw:transform", str ); // } } @@ -159,17 +159,17 @@ bool EmbeddedObject::saveOasisObject( KSpreadOasisSaveContext &sc ) const return true; } -void EmbeddedObject::draw( QPainter *_painter ) +void EmbeddedObject::draw( TQPainter *_painter ) { paintSelection(_painter, SM_MOVERESIZE ); } -QPixmap EmbeddedObject::toPixmap() +TQPixmap EmbeddedObject::toPixmap() { return toPixmap( 1.0 , 1.0 ); } -QPixmap EmbeddedObject::toPixmap(QSize size) +TQPixmap EmbeddedObject::toPixmap(TQSize size) { double xZoom; double yZoom; @@ -179,36 +179,36 @@ QPixmap EmbeddedObject::toPixmap(QSize size) return toPixmap(xZoom,yZoom); } -QPixmap EmbeddedObject::toPixmap(double /*xZoom*/ , double /*yZoom*/) +TQPixmap EmbeddedObject::toPixmap(double /*xZoom*/ , double /*yZoom*/) { - return QPixmap(); + return TQPixmap(); } -void EmbeddedObject::calculateRequiredZoom( QSize desiredSize, double& xZoom, double& yZoom) +void EmbeddedObject::calculateRequiredZoom( TQSize desiredSize, double& xZoom, double& yZoom) { - QSize actualSize = geometry().size().toQSize(); + TQSize actualSize = tqgeometry().size().toTQSize(); xZoom = (double) desiredSize.width() / (double)actualSize.width(); yZoom = (double) desiredSize.height() / (double)actualSize.height(); } -void EmbeddedObject::paintSelection( QPainter *_painter, SelectionMode mode ) +void EmbeddedObject::paintSelection( TQPainter *_painter, SelectionMode mode ) { if ( !m_selected || mode == SM_NONE ) return; _painter->save(); - KoRect bound( geometry().left(), geometry().top(), - geometry().width() , geometry().height() ); - QRect zoomedBound = sheet()->doc()->zoomRect( bound ) ; + KoRect bound( tqgeometry().left(), tqgeometry().top(), + tqgeometry().width() , tqgeometry().height() ); + TQRect zoomedBound = sheet()->doc()->zoomRect( bound ) ; - //_painter->setPen( QPen( Qt::black, 1, QPen::SolidLine ) ); + //_painter->setPen( TQPen( TQt::black, 1, TQPen::SolidLine ) ); _painter->setPen( pen ); - _painter->setBrush( kapp->palette().color( QPalette::Active, QColorGroup::Highlight ) ); + _painter->setBrush( kapp->palette().color( TQPalette::Active, TQColorGroup::Highlight ) ); //KoRect r = rotateRectObject(); // TODO: rotation - KoRect r = /*KoRect::fromQRect*/( bound ); + KoRect r = /*KoRect::fromTQRect*/( bound ); int x = sheet()->doc()->zoomItX( r.left() /*- orig.x()*/); int y = sheet()->doc()->zoomItY( r.top() /*- orig.y()*/); int zX6 = /*sheet()->doc()->zoomItX*/( 6 ); @@ -241,7 +241,7 @@ void EmbeddedObject::paintSelection( QPainter *_painter, SelectionMode mode ) 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 ); @@ -261,18 +261,18 @@ void EmbeddedObject::paintSelection( QPainter *_painter, SelectionMode mode ) _painter->restore(); } -QCursor EmbeddedObject::getCursor( const QPoint &_point, ModifyType &_modType, QRect &geometry) const +TQCursor EmbeddedObject::getCursor( const TQPoint &_point, ModifyType &_modType, TQRect &tqgeometry) const { int px = /*sheet()->doc()->zoomItX*/(_point.x()); int py = /*sheet()->doc()->zoomItY*/(_point.y()); - int ox = /*sheet()->doc()->zoomItX*/(/*orig*/geometry.x()); - int oy = /*sheet()->doc()->zoomItY*/(/*orig*/geometry.y()); - int ow = /*sheet()->doc()->zoomItX*/(/*ext*/geometry.width()); - int oh = /*sheet()->doc()->zoomItY*/(/*ext*/geometry.height()); + int ox = /*sheet()->doc()->zoomItX*/(/*orig*/tqgeometry.x()); + int oy = /*sheet()->doc()->zoomItY*/(/*orig*/tqgeometry.y()); + int ow = /*sheet()->doc()->zoomItX*/(/*ext*/tqgeometry.width()); + int oh = /*sheet()->doc()->zoomItY*/(/*ext*/tqgeometry.height()); // if ( angle != 0.0 ) // { -// QRect rr = sheet()->doc()->zoomRect( rotateRectObject() ); +// TQRect rr = sheet()->doc()->zoomRect( rotateRectObject() ); // ox = rr.x(); // oy = rr.y(); // ow = rr.width(); @@ -280,79 +280,79 @@ QCursor EmbeddedObject::getCursor( const QPoint &_point, ModifyType &_modType, Q // } 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 ( m_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 ( m_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 ( m_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 ( m_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 ( m_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 ( m_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 ( m_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 ( m_protect ) - return Qt::ForbiddenCursor; - return Qt::sizeFDiagCursor; + return TQt::ForbiddenCursor; + return TQt::sizeFDiagCursor; } _modType = MT_MOVE; - return Qt::sizeAllCursor; + return TQt::sizeAllCursor; } @@ -367,16 +367,16 @@ void EmbeddedObject::doDelete() * EmbeddedKOfficeObject * **********************************************************/ -EmbeddedKOfficeObject::EmbeddedKOfficeObject( Doc *parent, Sheet *_sheet, KoDocument* doc, const KoRect& geometry ) - : EmbeddedObject( _sheet, geometry ), m_parent(parent) +EmbeddedKOfficeObject::EmbeddedKOfficeObject( Doc *tqparent, Sheet *_sheet, KoDocument* doc, const KoRect& tqgeometry ) + : EmbeddedObject( _sheet, tqgeometry ), m_parent(tqparent) { - m_embeddedObject = new KoDocumentChild(parent, doc, geometry.toQRect() ); + m_embeddedObject = new KoDocumentChild(tqparent, doc, tqgeometry.toTQRect() ); } -EmbeddedKOfficeObject::EmbeddedKOfficeObject( Doc *parent, Sheet *_sheet ) - : EmbeddedObject( _sheet, KoRect() ), m_parent(parent) +EmbeddedKOfficeObject::EmbeddedKOfficeObject( Doc *tqparent, Sheet *_sheet ) + : EmbeddedObject( _sheet, KoRect() ), m_parent(tqparent) { - m_embeddedObject = new KoDocumentChild( parent ); + m_embeddedObject = new KoDocumentChild( tqparent ); } EmbeddedKOfficeObject::~EmbeddedKOfficeObject() @@ -384,7 +384,7 @@ EmbeddedKOfficeObject::~EmbeddedKOfficeObject() delete m_embeddedObject; } -Doc* EmbeddedKOfficeObject::parent() +Doc* EmbeddedKOfficeObject::tqparent() { return m_parent; } @@ -399,7 +399,7 @@ bool EmbeddedKOfficeObject::saveOasisObjectAttributes( KSpreadOasisSaveContext & kdDebug() << "EmbeddedKOfficeObject::saveOasisPart " << sc.partIndexObj << endl; sc.xmlWriter.startElement( "draw:object" ); - const QString name = QString( "Object_%1" ).arg( sc.partIndexObj + 1 ); + const TQString name = TQString( "Object_%1" ).tqarg( sc.partIndexObj + 1 ); ++sc.partIndexObj; m_embeddedObject->saveOasisAttributes( sc.xmlWriter, name ); @@ -413,57 +413,57 @@ const char * EmbeddedKOfficeObject::getOasisElementName() const return "draw:frame"; } -bool EmbeddedKOfficeObject::load( const QDomElement& element ) +bool EmbeddedKOfficeObject::load( const TQDomElement& element ) { kdDebug() << "Loading EmbeddedKOfficeObject" << endl; bool result = embeddedObject()->load( element ); - setGeometry( KoRect::fromQRect( embeddedObject()->geometry() ) ); + setGeometry( KoRect::fromTQRect( embeddedObject()->tqgeometry() ) ); return result; } -void EmbeddedKOfficeObject::loadOasis(const QDomElement &element, KoOasisLoadingContext &context/*, KPRLoadingInfo *info*/) +void EmbeddedKOfficeObject::loadOasis(const TQDomElement &element, KoOasisLoadingContext &context/*, KPRLoadingInfo *info*/) { - kdDebug()<<"void EmbeddedKOfficeObject::loadOasis(const QDomElement &element)******************\n"; + kdDebug()<<"void EmbeddedKOfficeObject::loadOasis(const TQDomElement &element)******************\n"; EmbeddedObject::loadOasis( element, context ); - QDomElement objectElement = KoDom::namedItemNS( element, KoXmlNS::draw, "object" ); + TQDomElement objectElement = KoDom::namedItemNS( element, KoXmlNS::draw, "object" ); m_embeddedObject->loadOasis( element, objectElement ); if( element.hasAttributeNS( KoXmlNS::draw, "name" ) ) - m_objectName = element.attributeNS( KoXmlNS::draw, "name", QString::null); + m_objectName = element.attributeNS( KoXmlNS::draw, "name", TQString()); (void)m_embeddedObject->loadOasisDocument( context.store(), context.manifestDocument() ); } -QDomElement EmbeddedKOfficeObject::save( QDomDocument& doc ) +TQDomElement EmbeddedKOfficeObject::save( TQDomDocument& doc ) { kdDebug() << "Saving EmbeddedKOfficeObject" << endl; - embeddedObject()->setGeometry( geometry().toQRect() ); + embeddedObject()->setGeometry( tqgeometry().toTQRect() ); return m_embeddedObject->save( doc ); } -void EmbeddedKOfficeObject::draw( QPainter *_painter ) +void EmbeddedKOfficeObject::draw( TQPainter *_painter ) { kdDebug() << "Painting..." << endl; int const penw = pen.width() ; KoRect bound( 0, 0, - geometry().width() - ( 2 * penw ), geometry().height() - ( 2 * penw ) ); - QRect const zoomedBound = sheet()->doc()->zoomRect( bound ); + tqgeometry().width() - ( 2 * penw ), tqgeometry().height() - ( 2 * penw ) ); + TQRect const zoomedBound = sheet()->doc()->zoomRect( bound ); _painter->save(); - int const xOffset = sheet()->doc()->zoomItX( geometry().left() + penw); - int const yOffset = sheet()->doc()->zoomItY( geometry().top() + penw ); + int const xOffset = sheet()->doc()->zoomItX( tqgeometry().left() + penw); + int const yOffset = sheet()->doc()->zoomItY( tqgeometry().top() + penw ); - QRect new_geometry = zoomedBound; + TQRect new_tqgeometry = zoomedBound; //if ( translate ) //{ _painter->translate( xOffset , yOffset ); - new_geometry.moveBy( xOffset , yOffset ); - new_geometry.moveBy( -_painter->window().x(), -_painter->window().y() ); + new_tqgeometry.moveBy( xOffset , yOffset ); + new_tqgeometry.moveBy( -_painter->window().x(), -_painter->window().y() ); //} - _painter->setClipRect( zoomedBound, QPainter::CoordPainter ); + _painter->setClipRect( zoomedBound, TQPainter::CoordPainter ); assert( embeddedObject()->document() != 0 ); @@ -477,18 +477,18 @@ void EmbeddedKOfficeObject::draw( QPainter *_painter ) zoomY ); - embeddedObject()->setGeometry( new_geometry ); + embeddedObject()->setGeometry( new_tqgeometry ); _painter->restore(); EmbeddedObject::draw( _painter ); } -QPixmap EmbeddedKOfficeObject::toPixmap( double xZoom , double yZoom ) +TQPixmap EmbeddedKOfficeObject::toPixmap( double xZoom , double yZoom ) { - QPixmap pixmap( (int)( geometry().width()*xZoom ), (int)( geometry().height()*yZoom ) ); + TQPixmap pixmap( (int)( tqgeometry().width()*xZoom ), (int)( tqgeometry().height()*yZoom ) ); - QPainter painter(&pixmap); - QRect bound( 0,0,(int)( geometry().width()*xZoom ), (int)(geometry().height()*yZoom) ); + TQPainter painter(&pixmap); + TQRect bound( 0,0,(int)( tqgeometry().width()*xZoom ), (int)(tqgeometry().height()*yZoom) ); embeddedObject()->document()->paintEverything(painter,bound, embeddedObject()->isTransparent(), 0, @@ -516,10 +516,10 @@ void EmbeddedKOfficeObject::deactivate() void EmbeddedKOfficeObject::updateChildGeometry() { // KoZoomHandler* zh = m_sheet->doc(); -// embeddedObject()->setGeometry( zh->zoomRect( geometry() ), true ); +// embeddedObject()->setGeometry( zh->zoomRect( tqgeometry() ), true ); // return; -// QRect r = sheet()->doc()->zoomRect( geometry() ); +// TQRect r = sheet()->doc()->zoomRect( tqgeometry() ); // if ( _canvas ) // { // kdDebug() << "_canvas->xOffset():" << _canvas->xOffset() << endl; @@ -537,8 +537,8 @@ void EmbeddedKOfficeObject::updateChildGeometry() * **********************************************************/ -EmbeddedChart::EmbeddedChart( Doc *_spread, Sheet *_sheet, KoDocument* doc, const KoRect& geometry ) - : EmbeddedKOfficeObject( _spread, _sheet, doc, geometry ) +EmbeddedChart::EmbeddedChart( Doc *_spread, Sheet *_sheet, KoDocument* doc, const KoRect& tqgeometry ) + : EmbeddedKOfficeObject( _spread, _sheet, doc, tqgeometry ) { m_pBinding = 0; } @@ -555,7 +555,7 @@ EmbeddedChart::~EmbeddedChart() delete m_pBinding; } -void EmbeddedChart::setDataArea( const QRect& _data ) +void EmbeddedChart::setDataArea( const TQRect& _data ) { if ( m_pBinding == 0L ) m_pBinding = new ChartBinding( m_sheet, _data, this ); @@ -574,7 +574,7 @@ const char * EmbeddedChart::getOasisElementName() const return "draw:frame"; } -bool EmbeddedChart::load( const QDomElement& element ) +bool EmbeddedChart::load( const TQDomElement& element ) { kdDebug() << "Loading EmbeddedChart" << endl; if ( !EmbeddedKOfficeObject::load( element ) ) @@ -585,7 +585,7 @@ bool EmbeddedChart::load( const QDomElement& element ) element.hasAttribute( "right-cell" ) && element.hasAttribute( "bottom-cell" ) ) { - QRect r; + TQRect r; r.setCoords( element.attribute( "left-cell" ).toInt(), element.attribute( "top-cell" ).toInt(), element.attribute( "right-cell" ).toInt(), @@ -597,13 +597,13 @@ bool EmbeddedChart::load( const QDomElement& element ) return true; } -void EmbeddedChart::loadOasis(const QDomElement &element, KoOasisLoadingContext &context/*, KPRLoadingInfo *info*/) +void EmbeddedChart::loadOasis(const TQDomElement &element, KoOasisLoadingContext &context/*, KPRLoadingInfo *info*/) { - kdDebug()<<"void EmbeddedChart::loadOasis(const QDomElement &element)******************\n"; + kdDebug()<<"void EmbeddedChart::loadOasis(const TQDomElement &element)******************\n"; EmbeddedKOfficeObject::loadOasis( element, context ); - QDomElement objectElement = KoDom::namedItemNS( element, KoXmlNS::draw, "object" ); - QString str_range = objectElement.attributeNS( KoXmlNS::draw, "notify-on-update-of-ranges", QString::null); + TQDomElement objectElement = KoDom::namedItemNS( element, KoXmlNS::draw, "object" ); + TQString str_range = objectElement.attributeNS( KoXmlNS::draw, "notify-on-update-of-ranges", TQString()); if ( !str_range.isNull() ) { @@ -626,9 +626,9 @@ bool EmbeddedChart::saveOasisObjectAttributes( KSpreadOasisSaveContext &sc ) con EmbeddedKOfficeObject::saveOasisObjectAttributes( sc ); if(m_pBinding) { // see http://bugs.kde.org/show_bug.cgi?id=120395 - QRect dataArea = m_pBinding->dataArea(); - QString rangeName = util_rangeName( dataArea); - rangeName.insert( rangeName.find(':') +1, sheet()->sheetName() + "." ); + TQRect dataArea = m_pBinding->dataArea(); + TQString rangeName = util_rangeName( dataArea); + rangeName.insert( rangeName.tqfind(':') +1, sheet()->sheetName() + "." ); rangeName.prepend( sheet()->sheetName() + "." ); sc.xmlWriter.addAttribute( "draw:notify-on-update-of-ranges", rangeName ); } @@ -640,10 +640,10 @@ bool EmbeddedChart::saveOasisObjectAttributes( KSpreadOasisSaveContext &sc ) con return true; } -QDomElement EmbeddedChart::save( QDomDocument& doc ) +TQDomElement EmbeddedChart::save( TQDomDocument& doc ) { kdDebug() << "Saving EmbeddedChart" << endl; - QDomElement element = EmbeddedKOfficeObject::save( doc ); + TQDomElement element = EmbeddedKOfficeObject::save( doc ); element.setTagName( "chart" ); element.setAttribute( "left-cell", m_pBinding->dataArea().left() ); @@ -653,7 +653,7 @@ QDomElement EmbeddedChart::save( QDomDocument& doc ) return element; } -void EmbeddedChart::draw( QPainter *_painter ) +void EmbeddedChart::draw( TQPainter *_painter ) { EmbeddedKOfficeObject::draw( _painter ); } @@ -679,7 +679,7 @@ bool EmbeddedChart::loadDocument( KoStore* _store ) KoChart::Part* EmbeddedChart::chart() { // Returns 0 when the chart couldn't be loaded and we get KoUnavailPart instead. - return qt_cast<KoChart::Part *>( m_embeddedObject->document() ); + return ::tqqt_cast<KoChart::Part *>( m_embeddedObject->document() ); } /********************************************************** @@ -687,43 +687,43 @@ KoChart::Part* EmbeddedChart::chart() * EmbeddedPictureObject * **********************************************************/ -EmbeddedPictureObject::EmbeddedPictureObject( Sheet *_sheet, const KoRect& _geometry, KoPictureCollection *_imageCollection ) - : EmbeddedObject( _sheet, _geometry ) +EmbeddedPictureObject::EmbeddedPictureObject( Sheet *_sheet, const KoRect& _tqgeometry, KoPictureCollection *_imageCollection ) + : EmbeddedObject( _sheet, _tqgeometry ) { imageCollection = _imageCollection; - pen = KoPen( Qt::black, 1.0, Qt::NoPen ); + pen = KoPen( TQt::black, 1.0, Qt::NoPen ); mirrorType = PM_NORMAL; depth = 0; swapRGB = false; grayscal = false; bright = 0; m_effect = IE_NONE; - m_ie_par1 = QVariant(); - m_ie_par2 = QVariant(); - m_ie_par3 = QVariant(); - // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!) - m_cachedPixmap.setOptimization(QPixmap::MemoryOptim); + m_ie_par1 = TQVariant(); + m_ie_par2 = TQVariant(); + m_ie_par3 = TQVariant(); + // Forbid TQPixmap to cache the X-Window resources (Yes, it is slower!) + m_cachedPixmap.setOptimization(TQPixmap::MemoryOptim); } -EmbeddedPictureObject::EmbeddedPictureObject( Sheet *_sheet, const KoRect& _geometry, KoPictureCollection *_imageCollection, const KoPictureKey & key ) - : EmbeddedObject( _sheet, _geometry ) +EmbeddedPictureObject::EmbeddedPictureObject( Sheet *_sheet, const KoRect& _tqgeometry, KoPictureCollection *_imageCollection, const KoPictureKey & key ) + : EmbeddedObject( _sheet, _tqgeometry ) { imageCollection = _imageCollection; //ext = KoSize(); // invalid size means unset - pen = KoPen( Qt::black, 1.0, Qt::NoPen ); + pen = KoPen( TQt::black, 1.0, Qt::NoPen ); mirrorType = PM_NORMAL; depth = 0; swapRGB = false; grayscal = false; bright = 0; m_effect = IE_NONE; - m_ie_par1 = QVariant(); - m_ie_par2 = QVariant(); - m_ie_par3 = QVariant(); - // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!) - m_cachedPixmap.setOptimization(QPixmap::MemoryOptim); + m_ie_par1 = TQVariant(); + m_ie_par2 = TQVariant(); + m_ie_par3 = TQVariant(); + // Forbid TQPixmap to cache the X-Window resources (Yes, it is slower!) + m_cachedPixmap.setOptimization(TQPixmap::MemoryOptim); setPicture( key ); } @@ -734,38 +734,38 @@ EmbeddedPictureObject::EmbeddedPictureObject( Sheet *_sheet, KoPictureCollection imageCollection = _imageCollection; //ext = KoSize(); // invalid size means unset - pen = KoPen( Qt::black, 1.0, Qt::NoPen ); + pen = KoPen( TQt::black, 1.0, Qt::NoPen ); mirrorType = PM_NORMAL; depth = 0; swapRGB = false; grayscal = false; bright = 0; m_effect = IE_NONE; - m_ie_par1 = QVariant(); - m_ie_par2 = QVariant(); - m_ie_par3 = QVariant(); - // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!) - m_cachedPixmap.setOptimization(QPixmap::MemoryOptim); + m_ie_par1 = TQVariant(); + m_ie_par2 = TQVariant(); + m_ie_par3 = TQVariant(); + // Forbid TQPixmap to cache the X-Window resources (Yes, it is slower!) + m_cachedPixmap.setOptimization(TQPixmap::MemoryOptim); } EmbeddedPictureObject::~EmbeddedPictureObject() { } -bool EmbeddedPictureObject::load( const QDomElement& /*element*/ ) +bool EmbeddedPictureObject::load( const TQDomElement& /*element*/ ) { return false; } -QDomElement EmbeddedPictureObject::save( QDomDocument& /*doc*/ ) +TQDomElement EmbeddedPictureObject::save( TQDomDocument& /*doc*/ ) { kdDebug() << "Saving EmbeddedPictureObject" << endl; - return QDomElement(); + return TQDomElement(); } -QString EmbeddedPictureObject::convertValueToPercent( int val ) const +TQString EmbeddedPictureObject::convertValueToPercent( int val ) const { - return QString::number( val )+"%"; + return TQString::number( val )+"%"; } void EmbeddedPictureObject::saveOasisPictureElement( KoGenStyle &styleobjectauto ) const @@ -788,7 +788,7 @@ void EmbeddedPictureObject::saveOasisPictureElement( KoGenStyle &styleobjectauto case IE_CHANNEL_INTENSITY: { //for the moment kpresenter support just one channel - QString percent = convertValueToPercent( m_ie_par1.toInt() ); + TQString percent = convertValueToPercent( m_ie_par1.toInt() ); KImageEffect::RGBComponent channel = static_cast<KImageEffect::RGBComponent>( m_ie_par2.toInt() ); switch( channel ) { @@ -886,7 +886,7 @@ const char * EmbeddedPictureObject::getOasisElementName() const } -void EmbeddedPictureObject::loadPicture( const QString & fileName ) +void EmbeddedPictureObject::loadPicture( const TQString & fileName ) { image = imageCollection->loadPicture( fileName ); } @@ -908,14 +908,14 @@ void EmbeddedPictureObject::reload( void ) } // KSpread doesn't support pictures in it's old XML file format. -// QDomDocumentFragment EmbeddedPictureObject::save( QDomDocument& doc, double offset ) +// TQDomDocumentFragment EmbeddedPictureObject::save( TQDomDocument& doc, double offset ) // { -// QDomDocumentFragment fragment=KP2DObject::save(doc, offset); -// QDomElement elem=doc.createElement("KEY"); +// TQDomDocumentFragment fragment=KP2DObject::save(doc, offset); +// TQDomElement elem=doc.createElement("KEY"); // image.getKey().saveAttributes(elem); // fragment.appendChild(elem); // -// QDomElement elemSettings = doc.createElement( "PICTURESETTINGS" ); +// TQDomElement elemSettings = doc.createElement( "PICTURESETTINGS" ); // // elemSettings.setAttribute( "mirrorType", static_cast<int>( mirrorType ) ); // elemSettings.setAttribute( "depth", depth ); @@ -925,7 +925,7 @@ void EmbeddedPictureObject::reload( void ) // fragment.appendChild( elemSettings ); // // if (m_effect!=IE_NONE) { -// QDomElement imageEffects = doc.createElement("EFFECTS"); +// TQDomElement imageEffects = doc.createElement("EFFECTS"); // imageEffects.setAttribute("type", static_cast<int>(m_effect)); // if (m_ie_par1.isValid()) // imageEffects.setAttribute("param1", m_ie_par1.toString()); @@ -950,43 +950,43 @@ void EmbeddedPictureObject::loadOasisPictureEffect(KoOasisLoadingContext & conte if ( styleStack.hasAttributeNS( KoXmlNS::draw, "contrast" ) ) { - QString str( styleStack.attributeNS( KoXmlNS::draw, "contrast" ) ); + TQString str( styleStack.attributeNS( KoXmlNS::draw, "contrast" ) ); str = str.remove( '%' ); int val = str.toInt(); m_effect = IE_CONTRAST; val = ( int )( 255.0 *val/100.0 ); - m_ie_par1 = QVariant(val); + m_ie_par1 = TQVariant(val); } if ( styleStack.hasAttributeNS( KoXmlNS::draw, "red" ) && styleStack.attributeNS( KoXmlNS::draw, "red" ) != "0%" ) { - QString str( styleStack.attributeNS( KoXmlNS::draw, "red" ) ); + TQString str( styleStack.attributeNS( KoXmlNS::draw, "red" ) ); str = str.remove( '%' ); int val = str.toInt(); m_effect = IE_CHANNEL_INTENSITY; - m_ie_par1 = QVariant(val); - m_ie_par2 = QVariant( ( int )KImageEffect::Red ); + m_ie_par1 = TQVariant(val); + m_ie_par2 = TQVariant( ( int )KImageEffect::Red ); } if ( styleStack.hasAttributeNS( KoXmlNS::draw, "green" ) && styleStack.attributeNS( KoXmlNS::draw, "green" ) != "0%" ) { - QString str( styleStack.attributeNS( KoXmlNS::draw, "green" ) ); + TQString str( styleStack.attributeNS( KoXmlNS::draw, "green" ) ); str = str.remove( '%' ); int val = str.toInt(); m_effect = IE_CHANNEL_INTENSITY; - m_ie_par1 = QVariant(val); - m_ie_par2 = QVariant( ( int )KImageEffect::Green ); + m_ie_par1 = TQVariant(val); + m_ie_par2 = TQVariant( ( int )KImageEffect::Green ); } if ( styleStack.hasAttributeNS( KoXmlNS::draw, "blue" ) && styleStack.attributeNS( KoXmlNS::draw, "blue" ) != "0%" ) { - QString str( styleStack.attributeNS( KoXmlNS::draw, "blue" ) ); + TQString str( styleStack.attributeNS( KoXmlNS::draw, "blue" ) ); str = str.remove( '%' ); int val = str.toInt(); m_effect = IE_CHANNEL_INTENSITY; - m_ie_par1 = QVariant(val); - m_ie_par2 = QVariant( ( int )KImageEffect::Blue ); + m_ie_par1 = TQVariant(val); + m_ie_par2 = TQVariant( ( int )KImageEffect::Blue ); } if ( styleStack.hasAttributeNS( KoXmlNS::draw, "luminance" ) ) { - QString str( styleStack.attributeNS( KoXmlNS::draw, "luminance" ) ); + TQString str( styleStack.attributeNS( KoXmlNS::draw, "luminance" ) ); str = str.remove( '%' ); bright = str.toInt(); } @@ -998,24 +998,24 @@ void EmbeddedPictureObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& saveOasisPictureElement( styleObjectAuto ); } -void EmbeddedPictureObject::loadOasis(const QDomElement &element, KoOasisLoadingContext & context/*, KPRLoadingInfo *info*/) +void EmbeddedPictureObject::loadOasis(const TQDomElement &element, KoOasisLoadingContext & context/*, KPRLoadingInfo *info*/) { //load it into kpresenter_doc EmbeddedObject::loadOasis( element, context ); loadOasisPictureEffect( context ); - QDomNode imageBox = KoDom::namedItemNS( element, KoXmlNS::draw, "image" ); - const QString href( imageBox.toElement().attributeNS( KoXmlNS::xlink, "href", QString::null) ); + TQDomNode imageBox = KoDom::namedItemNS( element, KoXmlNS::draw, "image" ); + const TQString href( imageBox.toElement().attributeNS( KoXmlNS::xlink, "href", TQString()) ); kdDebug()<<" href: "<<href<<endl; 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)*/); - const KoPictureKey key(filename, QDateTime::currentDateTime(Qt::UTC)); + TQString filename(href/*.mid(1)*/); + const KoPictureKey key(filename, TQDateTime::tqcurrentDateTime(Qt::UTC)); image.setKey(key); KoStore* store = context.store(); @@ -1032,10 +1032,10 @@ void EmbeddedPictureObject::loadOasis(const QDomElement &element, KoOasisLoading } -// double EmbeddedPictureObject::load(const QDomElement &element) +// double EmbeddedPictureObject::load(const TQDomElement &element) // { // double offset=KP2DObject::load(element); -// QDomElement e=element.namedItem("KEY").toElement(); +// TQDomElement e=element.namedItem("KEY").toElement(); // if(!e.isNull()) { // KoPictureKey key; // key.loadAttributes( e ); @@ -1054,8 +1054,8 @@ void EmbeddedPictureObject::loadOasis(const QDomElement &element, KoOasisLoading // } // } else { // bool openPic = true; -// QString _data; -// QString _fileName; +// TQString _data; +// TQString _fileName; // if(e.hasAttribute("data")) // _data=e.attribute("data"); // if ( _data.isEmpty() ) @@ -1066,12 +1066,12 @@ void EmbeddedPictureObject::loadOasis(const QDomElement &element, KoOasisLoading // _fileName=e.attribute("filename"); // if ( !_fileName.isEmpty() ) // { -// if ( int _envVarB = _fileName.find( '$' ) >= 0 ) +// if ( int _envVarB = _fileName.tqfind( '$' ) >= 0 ) // { -// int _envVarE = _fileName.find( '/', _envVarB ); -// // ### FIXME: it should be QString::local8Bit instead of QFile::encodeName, shouldn't it? -// QString path = getenv( QFile::encodeName(_fileName.mid( _envVarB, _envVarE-_envVarB )) ); -// _fileName.replace( _envVarB-1, _envVarE-_envVarB+1, path ); +// int _envVarE = _fileName.tqfind( '/', _envVarB ); +// // ### FIXME: it should be TQString::local8Bit instead of TQFile::encodeName, shouldn't it? +// TQString path = getenv( TQFile::encodeName(_fileName.mid( _envVarB, _envVarE-_envVarB )) ); +// _fileName.tqreplace( _envVarB-1, _envVarE-_envVarB+1, path ); // } // } // @@ -1083,9 +1083,9 @@ void EmbeddedPictureObject::loadOasis(const QDomElement &element, KoOasisLoading // KoPictureKey key( _fileName ); // image.clear(); // image.setKey(key); -// QByteArray rawData=_data.utf8(); // XPM is normally ASCII, therefore UTF-8 +// TQByteArray rawData=_data.utf8(); // XPM is normally ASCII, therefore UTF-8 // rawData[rawData.size()-1]=char(10); // Replace the NULL character by a LINE FEED -// QBuffer buffer(rawData); // ### TODO: open? +// TQBuffer buffer(rawData); // ### TODO: open? // image.loadXpm(&buffer); // } // } @@ -1129,17 +1129,17 @@ void EmbeddedPictureObject::loadOasis(const QDomElement &element, KoOasisLoading // if (e.hasAttribute("type")) // m_effect = static_cast<ImageEffect>(e.attribute("type").toInt()); // if (e.hasAttribute("param1")) -// m_ie_par1 = QVariant(e.attribute("param1")); +// m_ie_par1 = TQVariant(e.attribute("param1")); // else -// m_ie_par1 = QVariant(); +// m_ie_par1 = TQVariant(); // if (e.hasAttribute("param2")) -// m_ie_par2 = QVariant(e.attribute("param2")); +// m_ie_par2 = TQVariant(e.attribute("param2")); // else -// m_ie_par2 = QVariant(); +// m_ie_par2 = TQVariant(); // if (e.hasAttribute("param3")) -// m_ie_par3 = QVariant(e.attribute("param3")); +// m_ie_par3 = TQVariant(e.attribute("param3")); // else -// m_ie_par3 = QVariant(); +// m_ie_par3 = TQVariant(); // } // else // m_effect = IE_NONE; @@ -1147,16 +1147,16 @@ void EmbeddedPictureObject::loadOasis(const QDomElement &element, KoOasisLoading // return offset; // } -void EmbeddedPictureObject::drawShadow( QPainter* /*_painter*/, KoZoomHandler* /*_zoomHandler*/) +void EmbeddedPictureObject::drawShadow( TQPainter* /*_painter*/, KoZoomHandler* /*_zoomHandler*/) { -// const double ox = /*orig*/m_geometry.x(); -// const double oy = /*orig*/m_geometry.y(); -// const double ow = /*ext*/m_geometry.width(); -// const double oh = /*ext*/m_geometry.height(); +// const double ox = /*orig*/m_tqgeometry.x(); +// const double oy = /*orig*/m_tqgeometry.y(); +// const double ow = /*ext*/m_tqgeometry.width(); +// const double oh = /*ext*/m_tqgeometry.height(); // // _painter->save(); // -// QPen pen2 = pen.zoomedPen( _zoomHandler ); +// TQPen pen2 = pen.zoomedPen( _zoomHandler ); // _painter->setPen( pen2 ); // _painter->setBrush( getBrush() ); // @@ -1166,24 +1166,24 @@ void EmbeddedPictureObject::drawShadow( QPainter* /*_painter*/, KoZoomHandler* // getShadowCoords( sx, sy ); // // _painter->translate( _zoomHandler->zoomItX( ox ), _zoomHandler->zoomItY( oy ) ); -// _painter->setPen( QPen( shadowColor ) ); +// _painter->setPen( TQPen( shadowColor ) ); // _painter->setBrush( shadowColor ); // if ( kAbs(angle) <= DBL_EPSILON ) // _painter->drawRect( _zoomHandler->zoomItX( sx ), _zoomHandler->zoomItY( sy ), // _zoomHandler->zoomItX( ext.width() ), _zoomHandler->zoomItY( ext.height() ) ); // else // { -// QSize bs = QSize( _zoomHandler->zoomItX( ow ), _zoomHandler->zoomItY( oh ) ); -// QRect br = QRect( 0, 0, bs.width(), bs.height() ); +// TQSize bs = TQSize( _zoomHandler->zoomItX( ow ), _zoomHandler->zoomItY( oh ) ); +// TQRect br = TQRect( 0, 0, bs.width(), bs.height() ); // int pw = br.width(); // int ph = br.height(); -// QRect rr = br; +// TQRect rr = br; // int pixYPos = -rr.y(); // int pixXPos = -rr.x(); -// br.moveTopLeft( QPoint( -br.width() / 2, -br.height() / 2 ) ); -// rr.moveTopLeft( QPoint( -rr.width() / 2, -rr.height() / 2 ) ); +// br.moveTopLeft( TQPoint( -br.width() / 2, -br.height() / 2 ) ); +// rr.moveTopLeft( TQPoint( -rr.width() / 2, -rr.height() / 2 ) ); // -// QWMatrix m; +// TQWMatrix m; // m.translate( pw / 2, ph / 2 ); // m.rotate( angle ); // m.translate( rr.left() + pixXPos + _zoomHandler->zoomItX( sx ), @@ -1197,32 +1197,32 @@ void EmbeddedPictureObject::drawShadow( QPainter* /*_painter*/, KoZoomHandler* // _painter->restore(); } -QPixmap EmbeddedPictureObject::toPixmap( double xZoom , double yZoom ) +TQPixmap EmbeddedPictureObject::toPixmap( double xZoom , double yZoom ) { KoZoomHandler zoomHandler; zoomHandler.setZoomedResolution( xZoom /* *zoomHandler.resolutionX()*/ , yZoom /* *zoomHandler.resolutionY()*/ ); return generatePixmap( &zoomHandler ); } -QPixmap EmbeddedPictureObject::generatePixmap(KoZoomHandler*_zoomHandler) +TQPixmap EmbeddedPictureObject::generatePixmap(KoZoomHandler*_zoomHandler) { const double penw = _zoomHandler->zoomItX( ( ( pen.style() == Qt::NoPen ) ? 1 : pen.width() ) / 2.0 ); - QSize size( _zoomHandler->zoomSize( m_geometry.size() /*ext*/ ) ); + TQSize size( _zoomHandler->zoomSize( m_tqgeometry.size() /*ext*/ ) ); //kdDebug(33001) << "EmbeddedPictureObject::generatePixmap size= " << size << endl; - QPixmap pixmap(size); - QPainter paint; + TQPixmap pixmap(size); + TQPainter paint; paint.begin( &pixmap ); - pixmap.fill( Qt::white ); + pixmap.fill( TQt::white ); // Draw background paint.setPen( Qt::NoPen ); paint.setBrush( getBrush() ); - QRect rect( (int)( penw ), (int)( penw ), - (int)( _zoomHandler->zoomItX( /*ext*/m_geometry.width() ) - 2.0 * penw ), - (int)( _zoomHandler->zoomItY( /*ext*/m_geometry.height() ) - 2.0 * penw ) ); + TQRect rect( (int)( penw ), (int)( penw ), + (int)( _zoomHandler->zoomItX( /*ext*/m_tqgeometry.width() ) - 2.0 * penw ), + (int)( _zoomHandler->zoomItY( /*ext*/m_tqgeometry.height() ) - 2.0 * penw ) ); // if ( getFillType() == FT_BRUSH || !gradient ) paint.drawRect( rect ); @@ -1231,8 +1231,8 @@ QPixmap EmbeddedPictureObject::generatePixmap(KoZoomHandler*_zoomHandler) // gradient->setSize( size ); // paint.drawPixmap( (int)( penw ), (int)( penw ), // gradient->pixmap(), 0, 0, -// (int)( _zoomHandler->zoomItX( m_geometry/*ext*/.width() ) - 2 * penw ), -// (int)( _zoomHandler->zoomItY( m_geometry/*ext*/.height() ) - 2 * penw ) ); +// (int)( _zoomHandler->zoomItX( m_tqgeometry/*ext*/.width() ) - 2 * penw ), +// (int)( _zoomHandler->zoomItY( m_tqgeometry/*ext*/.height() ) - 2 * penw ) ); // } @@ -1240,7 +1240,7 @@ QPixmap EmbeddedPictureObject::generatePixmap(KoZoomHandler*_zoomHandler) image.clearCache(); // Release the memoy of the picture cache // image.setAlphaBuffer(true); -// QBitmap tmpMask; +// TQBitmap tmpMask; // tmpMask = image.createAlphaMask().scale(size); // pixmap.setMask(tmpMask); @@ -1248,7 +1248,7 @@ QPixmap EmbeddedPictureObject::generatePixmap(KoZoomHandler*_zoomHandler) return pixmap; } -void EmbeddedPictureObject::draw( QPainter *_painter/*, KoZoomHandler*_zoomHandler, +void EmbeddedPictureObject::draw( TQPainter *_painter/*, KoZoomHandler*_zoomHandler, int pageNum, SelectionMode selectionMode, bool drawContour*/ ) { bool drawContour = false; @@ -1260,10 +1260,10 @@ void EmbeddedPictureObject::draw( QPainter *_painter/*, KoZoomHandler*_zoomHandl // if ( shadowDistance > 0 && !drawContour ) // drawShadow(_painter, _zoomHandler); - const double ox = /*orig*/m_geometry.x(); - const double oy = /*orig*/m_geometry.y(); - const double ow = /*ext*/m_geometry.width(); - const double oh = /*ext*/m_geometry.height(); + const double ox = /*orig*/m_tqgeometry.x(); + const double oy = /*orig*/m_tqgeometry.y(); + const double ow = /*ext*/m_tqgeometry.width(); + const double oh = /*ext*/m_tqgeometry.height(); //const double penw = _zoomHandler->zoomItX( ( ( pen.style() == Qt::NoPen ) ? 1.0 : pen.width() ) / 2.0 ); _painter->save(); @@ -1271,17 +1271,17 @@ void EmbeddedPictureObject::draw( QPainter *_painter/*, KoZoomHandler*_zoomHandl _painter->translate( _zoomHandler->zoomItX( ox ), _zoomHandler->zoomItY( oy ) ); if ( kAbs(angle)> DBL_EPSILON ) { - QSize bs = QSize( _zoomHandler->zoomItX( ow ), _zoomHandler->zoomItY( oh ) ); - QRect br = QRect( 0, 0, bs.width(), bs.height() ); + TQSize bs = TQSize( _zoomHandler->zoomItX( ow ), _zoomHandler->zoomItY( oh ) ); + TQRect br = TQRect( 0, 0, bs.width(), bs.height() ); int pw = br.width(); int ph = br.height(); - QRect rr = br; + TQRect rr = br; int pixYPos = -rr.y(); int pixXPos = -rr.x(); - br.moveTopLeft( QPoint( -br.width() / 2, -br.height() / 2 ) ); - rr.moveTopLeft( QPoint( -rr.width() / 2, -rr.height() / 2 ) ); + br.moveTopLeft( TQPoint( -br.width() / 2, -br.height() / 2 ) ); + rr.moveTopLeft( TQPoint( -rr.width() / 2, -rr.height() / 2 ) ); - QWMatrix m; + TQWMatrix m; m.translate( pw / 2, ph / 2 ); m.rotate( angle ); m.translate( rr.left() + pixXPos, rr.top() + pixYPos ); @@ -1290,9 +1290,9 @@ void EmbeddedPictureObject::draw( QPainter *_painter/*, KoZoomHandler*_zoomHandl if ( !drawContour ) { - QRect rect( 0, 0, (int)( _zoomHandler->zoomItX( ow ) ), + TQRect rect( 0, 0, (int)( _zoomHandler->zoomItX( ow ) ), (int)( _zoomHandler->zoomItY( oh ) ) ); - // ### HACK QT seems not to be able to correctly compare QVariant + // ### HACK QT seems not to be able to correctly compare TQVariant bool variants1; if (m_ie_par1.isNull()) variants1=m_cachedPar1.isNull(); @@ -1348,17 +1348,17 @@ void EmbeddedPictureObject::draw( QPainter *_painter/*, KoZoomHandler*_zoomHandl // Draw border // ### TODO port to KoBorder::drawBorders() (after writing a simplified version of it, that takes the same border on each size) -// QPen pen2; +// TQPen pen2; // if ( drawContour ) { -// pen2 = QPen( Qt::black, 1, Qt::DotLine ); -// _painter->setRasterOp( Qt::NotXorROP ); +// pen2 = TQPen( TQt::black, 1, TQt::DotLine ); +// _painter->setRasterOp( TQt::NotXorROP ); // } // else { // pen2 = pen; // pen2.setWidth( _zoomHandler->zoomItX( ( pen.style() == Qt::NoPen ) ? 1.0 : (double)pen.width() ) ); // } // _painter->setPen( pen2 ); -// _painter->setBrush( Qt::NoBrush ); +// _painter->setBrush( TQt::NoBrush ); // _painter->drawRect( (int)( penw ), (int)( penw ), // (int)( _zoomHandler->zoomItX( ow ) - 2.0 * penw ), // (int)( _zoomHandler->zoomItY( oh ) - 2.0 * penw ) ); @@ -1370,19 +1370,19 @@ void EmbeddedPictureObject::draw( QPainter *_painter/*, KoZoomHandler*_zoomHandl EmbeddedObject::draw( _painter ); } -QPixmap EmbeddedPictureObject::getOriginalPixmap() +TQPixmap EmbeddedPictureObject::getOriginalPixmap() { - QSize _pixSize = image.getOriginalSize(); + TQSize _pixSize = image.getOriginalSize(); kdDebug(33001) << "EmbeddedPictureObject::getOriginalPixmap size= " << _pixSize << endl; - QPixmap _pixmap = image.generatePixmap( _pixSize, true ); + TQPixmap _pixmap = image.generatePixmap( _pixSize, true ); image.clearCache(); // Release the memoy of the picture cache return _pixmap; } -QPixmap EmbeddedPictureObject::changePictureSettings( QPixmap _tmpPixmap ) +TQPixmap EmbeddedPictureObject::changePictureSettings( TQPixmap _tmpPixmap ) { - QImage _tmpImage = _tmpPixmap.convertToImage(); + TQImage _tmpImage = _tmpPixmap.convertToImage(); if (_tmpImage.isNull()) return _tmpPixmap; @@ -1401,7 +1401,7 @@ QPixmap EmbeddedPictureObject::changePictureSettings( QPixmap _tmpPixmap ) _tmpImage = _tmpImage.mirror( _horizontal, _vertical ); if ( depth != 0 ) { - QImage tmpImg = _tmpImage.convertDepth( depth ); + TQImage tmpImg = _tmpImage.convertDepth( depth ); if ( !tmpImg.isNull() ) _tmpImage = tmpImg; } @@ -1412,9 +1412,9 @@ QPixmap EmbeddedPictureObject::changePictureSettings( QPixmap _tmpPixmap ) if ( grayscal ) { if ( depth == 1 || depth == 8 ) { for ( int i = 0; i < _tmpImage.numColors(); ++i ) { - QRgb rgb = _tmpImage.color( i ); - int gray = qGray( rgb ); - rgb = qRgb( gray, gray, gray ); + TQRgb rgb = _tmpImage.color( i ); + int gray = tqGray( rgb ); + rgb = tqRgb( gray, gray, gray ); _tmpImage.setColor( i, rgb ); } } @@ -1427,9 +1427,9 @@ QPixmap EmbeddedPictureObject::changePictureSettings( QPixmap _tmpPixmap ) for ( _x = 0; _x < _width; ++_x ) { for ( _y = 0; _y < _height; ++_y ) { if ( _tmpImage.valid( _x, _y ) ) { - QRgb rgb = _tmpImage.pixel( _x, _y ); - int gray = qGray( rgb ); - rgb = qRgb( gray, gray, gray ); + TQRgb rgb = _tmpImage.pixel( _x, _y ); + int gray = tqGray( rgb ); + rgb = tqRgb( gray, gray, gray ); _tmpImage.setPixel( _x, _y, rgb ); } } @@ -1440,8 +1440,8 @@ QPixmap EmbeddedPictureObject::changePictureSettings( QPixmap _tmpPixmap ) if ( bright != 0 ) { if ( depth == 1 || depth == 8 ) { for ( int i = 0; i < _tmpImage.numColors(); ++i ) { - QRgb rgb = _tmpImage.color( i ); - QColor c( rgb ); + TQRgb rgb = _tmpImage.color( i ); + TQColor c( rgb ); if ( bright > 0 ) rgb = c.light( 100 + bright ).rgb(); @@ -1460,8 +1460,8 @@ QPixmap EmbeddedPictureObject::changePictureSettings( QPixmap _tmpPixmap ) for ( _x = 0; _x < _width; ++_x ) { for ( _y = 0; _y < _height; ++_y ) { if ( _tmpImage.valid( _x, _y ) ) { - QRgb rgb = _tmpImage.pixel( _x, _y ); - QColor c( rgb ); + TQRgb rgb = _tmpImage.pixel( _x, _y ); + TQColor c( rgb ); if ( bright > 0 ) rgb = c.light( 100 + bright ).rgb(); |