diff options
Diffstat (limited to 'lib/kofficecore/KoPageLayout.cpp')
-rw-r--r-- | lib/kofficecore/KoPageLayout.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/lib/kofficecore/KoPageLayout.cpp b/lib/kofficecore/KoPageLayout.cpp index 36e447e9..05eff10b 100644 --- a/lib/kofficecore/KoPageLayout.cpp +++ b/lib/kofficecore/KoPageLayout.cpp @@ -26,7 +26,7 @@ #include <kglobal.h> #include <KoDom.h> #include <KoXmlNS.h> -#include <qdom.h> +#include <tqdom.h> // paper formats ( mm ) #define PG_A3_WIDTH 297.0 @@ -57,21 +57,21 @@ KoGenStyle KoPageLayout::saveOasis() const return style; } -void KoPageLayout::loadOasis(const QDomElement &style) +void KoPageLayout::loadOasis(const TQDomElement &style) { - QDomElement properties( KoDom::namedItemNS( style, KoXmlNS::style, "page-layout-properties" ) ); + TQDomElement properties( KoDom::namedItemNS( style, KoXmlNS::style, "page-tqlayout-properties" ) ); if ( !properties.isNull() ) { - ptWidth = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-width", QString::null ) ); - ptHeight = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-height", QString::null ) ); - if (properties.attributeNS( KoXmlNS::style, "print-orientation", QString::null)=="portrait") + ptWidth = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-width", TQString() ) ); + ptHeight = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-height", TQString() ) ); + if (properties.attributeNS( KoXmlNS::style, "print-orientation", TQString())=="portrait") orientation=PG_PORTRAIT; else orientation=PG_LANDSCAPE; - ptRight = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-right", QString::null ) ); - ptBottom = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-bottom", QString::null ) ); - ptLeft = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-left", QString::null ) ); - ptTop = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-top", QString::null ) ); + ptRight = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-right", TQString() ) ); + ptBottom = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-bottom", TQString() ) ); + ptLeft = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-left", TQString() ) ); + ptTop = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-top", TQString() ) ); // guessFormat takes millimeters if ( orientation == PG_LANDSCAPE ) format = KoPageFormat::guessFormat( POINT_TO_MM(ptHeight), POINT_TO_MM(ptWidth) ); @@ -82,18 +82,18 @@ void KoPageLayout::loadOasis(const QDomElement &style) KoPageLayout KoPageLayout::standardLayout() { - KoPageLayout layout; - layout.format = KoPageFormat::defaultFormat(); - layout.orientation = PG_PORTRAIT; - layout.ptWidth = MM_TO_POINT( KoPageFormat::width( layout.format, layout.orientation ) ); - layout.ptHeight = MM_TO_POINT( KoPageFormat::height( layout.format, layout.orientation ) ); - layout.ptLeft = MM_TO_POINT( 20.0 ); - layout.ptRight = MM_TO_POINT( 20.0 ); - layout.ptTop = MM_TO_POINT( 20.0 ); - layout.ptBottom = MM_TO_POINT( 20.0 ); - layout.ptPageEdge = -1; - layout.ptBindingSide = -1; - return layout; + KoPageLayout tqlayout; + tqlayout.format = KoPageFormat::defaultFormat(); + tqlayout.orientation = PG_PORTRAIT; + tqlayout.ptWidth = MM_TO_POINT( KoPageFormat::width( tqlayout.format, tqlayout.orientation ) ); + tqlayout.ptHeight = MM_TO_POINT( KoPageFormat::height( tqlayout.format, tqlayout.orientation ) ); + tqlayout.ptLeft = MM_TO_POINT( 20.0 ); + tqlayout.ptRight = MM_TO_POINT( 20.0 ); + tqlayout.ptTop = MM_TO_POINT( 20.0 ); + tqlayout.ptBottom = MM_TO_POINT( 20.0 ); + tqlayout.ptPageEdge = -1; + tqlayout.ptBindingSide = -1; + return tqlayout; } struct PageFormatInfo @@ -149,12 +149,12 @@ int KoPageFormat::printerPageSize( KoFormat format ) { if ( format == PG_SCREEN ) { - kdWarning() << "You use the page layout SCREEN. Printing in DIN A4 LANDSCAPE." << endl; + kdWarning() << "You use the page tqlayout SCREEN. Printing in DIN A4 LANDSCAPE." << endl; return KPrinter::A4; } else if ( format == PG_CUSTOM ) { - kdWarning() << "The used page layout (CUSTOM) is not supported by KPrinter. Printing in A4." << endl; + kdWarning() << "The used page tqlayout (CUSTOM) is not supported by KPrinter. Printing in A4." << endl; return KPrinter::A4; } else if ( format <= PG_LAST_FORMAT ) @@ -195,18 +195,18 @@ KoFormat KoPageFormat::guessFormat( double width, double height ) return PG_CUSTOM; } -QString KoPageFormat::formatString( KoFormat format ) +TQString KoPageFormat::formatString( KoFormat format ) { if ( format <= PG_LAST_FORMAT ) - return QString::fromLatin1( pageFormatInfo[ format ].shortName ); - return QString::fromLatin1( "A4" ); + return TQString::tqfromLatin1( pageFormatInfo[ format ].shortName ); + return TQString::tqfromLatin1( "A4" ); } -KoFormat KoPageFormat::formatFromString( const QString & string ) +KoFormat KoPageFormat::formatFromString( const TQString & string ) { for ( int i = 0 ; i <= PG_LAST_FORMAT ; ++i ) { - if (string == QString::fromLatin1( pageFormatInfo[ i ].shortName )) + if (string == TQString::tqfromLatin1( pageFormatInfo[ i ].shortName )) return pageFormatInfo[ i ].format; } // We do not know the format name, so we have a custom format @@ -224,16 +224,16 @@ KoFormat KoPageFormat::defaultFormat() return PG_DIN_A4; } -QString KoPageFormat::name( KoFormat format ) +TQString KoPageFormat::name( KoFormat format ) { if ( format <= PG_LAST_FORMAT ) return i18n( pageFormatInfo[ format ].descriptiveName ); return i18n( pageFormatInfo[ PG_DIN_A4 ].descriptiveName ); } -QStringList KoPageFormat::allFormats() +TQStringList KoPageFormat::allFormats() { - QStringList lst; + TQStringList lst; for ( int i = 0 ; i <= PG_LAST_FORMAT ; ++i ) { lst << i18n( pageFormatInfo[ i ].descriptiveName ); |