From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: 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 --- filters/karbon/kontour/kontourimport.cpp | 52 ++++++++++++++++---------------- filters/karbon/kontour/kontourimport.h | 15 ++++----- 2 files changed, 34 insertions(+), 33 deletions(-) (limited to 'filters/karbon/kontour') diff --git a/filters/karbon/kontour/kontourimport.cpp b/filters/karbon/kontour/kontourimport.cpp index 88d2fc4b..a260fd50 100644 --- a/filters/karbon/kontour/kontourimport.cpp +++ b/filters/karbon/kontour/kontourimport.cpp @@ -1,5 +1,5 @@ /* This file is part of the KDE project - Copyright (C) 2002, Sven L�ppken <sven@kde.org> + Copyright (C) 2002, Sven L�ppken <sven@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -30,15 +30,15 @@ #include <core/vpath.h> #include <core/vfill.h> #include <core/vstroke.h> -#include <qcolor.h> -#include <qfile.h> +#include <tqcolor.h> +#include <tqfile.h> #define DPI 90 typedef KGenericFactory<KontourImport, KoFilter> KontourImportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonkontourimport, KontourImportFactory( "kofficefilters" ) ) -KontourImport::KontourImport(KoFilter *, const char *, const QStringList&) : +KontourImport::KontourImport(KoFilter *, const char *, const TQStringList&) : KoFilter(), outdoc( "DOC" ) { @@ -49,7 +49,7 @@ KontourImport::~KontourImport() } -KoFilter::ConversionStatus KontourImport::convert(const QCString& from, const QCString& to) +KoFilter::ConversiontqStatus KontourImport::convert(const TQCString& from, const TQCString& to) { // check for proper conversion if ( to != "application/x-karbon" || ( from != "application/x-kontour" && from != "application/x-killustrator") ) @@ -74,14 +74,14 @@ KoFilter::ConversionStatus KontourImport::convert(const QCString& from, const QC kdError(30502) << "Unable to open output file!" << endl; return KoFilter::StorageCreationError; } - QCString cstring = outdoc.toCString(); // utf-8 already + TQCString cstring = outdoc.toCString(); // utf-8 already out->writeBlock( cstring.data(), cstring.length() ); return KoFilter::OK; // was successful } void -KontourImport::parseGObject( VObject *object, const QDomElement &e ) +KontourImport::parseGObject( VObject *object, const TQDomElement &e ) { if( !e.attribute( "fillstyle" ).isEmpty() ) { @@ -92,7 +92,7 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) case 1: { fill.setType( VFill::solid ); - QColor c; + TQColor c; c.setNamedColor( e.attribute( "fillcolor" ) ); VColor color( c ); fill.setColor( color ); @@ -103,7 +103,7 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) VGradient grad; // set color stops grad.clearStops(); - QColor c; + TQColor c; c.setNamedColor( e.attribute( "gradcolor1" ) ); VColor color( c ); grad.addStop( color, 0.0, 0.5 ); @@ -132,7 +132,7 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) break; case 1: { - QColor c; + TQColor c; c.setNamedColor( e.attribute( "strokecolor" ) ); VColor color( c ); stroke.setColor( color ); @@ -140,12 +140,12 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) break; case 2: case 3: case 4: case 5: { - QColor c; + TQColor c; c.setNamedColor( e.attribute( "strokecolor" ) ); VColor color( c ); stroke.setColor( color ); VDashPattern dash; - QValueList<float> list; + TQValueList<float> list; switch ( strokestyle ) { case 2: // dashed line @@ -172,8 +172,8 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) object->setStroke( stroke ); } // handle matrix - QDomElement matrix = e.namedItem( "matrix" ).toElement(); - QWMatrix mat( matrix.attribute( "m11" ).toDouble(), + TQDomElement matrix = e.namedItem( "matrix" ).toElement(); + TQWMatrix mat( matrix.attribute( "m11" ).toDouble(), matrix.attribute( "m12" ).toDouble(), matrix.attribute( "m21" ).toDouble(), matrix.attribute( "m22" ).toDouble(), @@ -191,15 +191,15 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) void KontourImport::convert() { - QDomElement docElem = inpdoc.documentElement(); - QDomElement lay; + TQDomElement docElem = inpdoc.documentElement(); + TQDomElement lay; double height; double width; if( docElem.attribute( "version" ).toInt() == 2 ) { lay = docElem; - height = lay.firstChild().namedItem( "layout" ).toElement().attribute( "height" ).toDouble(); - width = lay.firstChild().namedItem( "layout" ).toElement().attribute( "width" ).toDouble(); + height = lay.firstChild().namedItem( "tqlayout" ).toElement().attribute( "height" ).toDouble(); + width = lay.firstChild().namedItem( "tqlayout" ).toElement().attribute( "width" ).toDouble(); } else { @@ -217,9 +217,9 @@ KontourImport::convert() } void -KontourImport::parseGroup( const QDomElement &e ) +KontourImport::parseGroup( const TQDomElement &e ) { - QDomElement b = e; + TQDomElement b = e; for( ; !b.isNull(); b = b.nextSibling().toElement() ) { if ( b.tagName() == "rectangle" ) @@ -229,15 +229,15 @@ KontourImport::parseGroup( const QDomElement &e ) int width = b.attribute( "width" ).toInt(); int height = b.attribute( "height" ).toInt(); VObject *rect = new VRectangle( 0L, KoPoint( x, height + y ) , width, height ); - QDomElement object = b.namedItem( "polyline" ).namedItem( "gobject" ).toElement(); + TQDomElement object = b.namedItem( "polyline" ).namedItem( "gobject" ).toElement(); parseGObject( rect, object ); m_document.append( rect ); } else if ( b.tagName() == "ellipse" ) { - QDomElement object = b.namedItem( "gobject" ).toElement(); - QDomElement matrix = object.namedItem( "matrix" ).toElement(); + TQDomElement object = b.namedItem( "gobject" ).toElement(); + TQDomElement matrix = object.namedItem( "matrix" ).toElement(); /** * Kontour uses a quite different way to display ellipses, so we * need to calculate the values for the Karbon ellipse here @@ -259,7 +259,7 @@ KontourImport::parseGroup( const QDomElement &e ) * Kontour is much simpler because it doesn't support curves, so * we're done with connecting points with lines. */ - QDomElement point = b.firstChild().toElement(); + TQDomElement point = b.firstChild().toElement(); VPath *path = new VPath( &m_document ); double x, y; x = point.attribute( "x" ).toDouble(); @@ -277,7 +277,7 @@ KontourImport::parseGroup( const QDomElement &e ) } else if( b.tagName() == "polygon" ) { - QDomElement point = b.namedItem( "polyline" ).firstChild().toElement(); + TQDomElement point = b.namedItem( "polyline" ).firstChild().toElement(); VPath *path = new VPath( &m_document ); double x, y; x = point.attribute( "x" ).toDouble(); @@ -297,7 +297,7 @@ KontourImport::parseGroup( const QDomElement &e ) } else if( b.tagName() == "bezier" ) { - QDomElement point = b.namedItem( "polyline" ).firstChild().toElement(); + TQDomElement point = b.namedItem( "polyline" ).firstChild().toElement(); VPath *path = new VPath( &m_document ); double x, y; x = point.attribute( "x" ).toDouble(); diff --git a/filters/karbon/kontour/kontourimport.h b/filters/karbon/kontour/kontourimport.h index f227f908..9e9bc85a 100644 --- a/filters/karbon/kontour/kontourimport.h +++ b/filters/karbon/kontour/kontourimport.h @@ -21,27 +21,28 @@ #define __KONTOURIMPORT_H__ #include <KoFilter.h> -#include <qdom.h> +#include <tqdom.h> #include <core/vdocument.h> class KontourImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - KontourImport(KoFilter *parent, const char *name, const QStringList&); + KontourImport(KoFilter *tqparent, const char *name, const TQStringList&); virtual ~KontourImport(); - virtual KoFilter::ConversionStatus convert(const QCString& from, const QCString& to); + virtual KoFilter::ConversiontqStatus convert(const TQCString& from, const TQCString& to); protected: - QDomDocument inpdoc; - QDomDocument outdoc; + TQDomDocument inpdoc; + TQDomDocument outdoc; void convert(); private: - void parseGObject( VObject *, const QDomElement & ); - void parseGroup( const QDomElement & ); + void parseGObject( VObject *, const TQDomElement & ); + void parseGroup( const TQDomElement & ); VDocument m_document; }; -- cgit v1.2.1