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 /lib/kformula/styleelement.cc | |
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 'lib/kformula/styleelement.cc')
-rw-r--r-- | lib/kformula/styleelement.cc | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/kformula/styleelement.cc b/lib/kformula/styleelement.cc index 8475a1da..1a8f20ae 100644 --- a/lib/kformula/styleelement.cc +++ b/lib/kformula/styleelement.cc @@ -22,7 +22,7 @@ KFORMULA_NAMESPACE_BEGIN -StyleElement::StyleElement( BasicElement* parent ) : TokenStyleElement( parent ), +StyleElement::StyleElement( BasicElement* tqparent ) : TokenStyleElement( tqparent ), m_scriptMinSizeType( NoSize ), m_veryVeryThinMathSpaceType( NoSize ), m_veryThinMathSpaceType( NoSize ), @@ -39,13 +39,13 @@ StyleElement::StyleElement( BasicElement* parent ) : TokenStyleElement( parent ) { } -bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element ) +bool StyleElement::readAttributesFromMathMLDom( const TQDomElement& element ) { if ( !BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString scriptlevelStr = element.attribute( "scriptlevel" ); + TQString scriptlevelStr = element.attribute( "scriptlevel" ); if ( ! scriptlevelStr.isNull() ) { if ( scriptlevelStr[0] == '+' || scriptlevelStr[0] == '-' ) { m_relativeScriptLevel = true; @@ -60,7 +60,7 @@ bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element ) m_customScriptLevel = true; } } - QString displaystyleStr = element.attribute( "displaystyle" ); + TQString displaystyleStr = element.attribute( "displaystyle" ); if ( ! displaystyleStr.isNull() ) { if ( displaystyleStr.lower() == "true" ) { m_displayStyle = true; @@ -70,7 +70,7 @@ bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element ) } m_customDisplayStyle = true; } - QString scriptsizemultiplierStr = element.attribute( "scriptsizemultiplier" ); + TQString scriptsizemultiplierStr = element.attribute( "scriptsizemultiplier" ); if ( ! scriptsizemultiplierStr.isNull() ) { bool ok; m_scriptSizeMultiplier = scriptsizemultiplierStr.toDouble( &ok ); @@ -82,66 +82,66 @@ bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element ) m_customScriptSizeMultiplier = true; } } - QString scriptminsizeStr = element.attribute( "scriptminsize" ); + TQString scriptminsizeStr = element.attribute( "scriptminsize" ); if ( ! scriptminsizeStr.isNull() ) { readSizeAttribute( scriptminsizeStr, &m_scriptMinSizeType, &m_scriptMinSize ); } - QString backgroundStr = element.attribute( "background" ); + TQString backgroundStr = element.attribute( "background" ); if ( ! backgroundStr.isNull() ) { - // TODO: tranparent background + // TODO: trantqparent background m_customBackground = true; if ( backgroundStr[0] != '#' ) { - m_background = QColor( getHtmlColor( backgroundStr ) ); + m_background = TQColor( getHtmlColor( backgroundStr ) ); } else { - m_background = QColor( backgroundStr ); + m_background = TQColor( backgroundStr ); } } - QString veryverythinmathspaceStr = element.attribute( "veryverythinmathspace" ); + TQString veryverythinmathspaceStr = element.attribute( "veryverythinmathspace" ); if ( ! veryverythinmathspaceStr.isNull() ) { readSizeAttribute( veryverythinmathspaceStr, &m_veryVeryThinMathSpaceType, &m_veryVeryThinMathSpace ); } - QString verythinmathspaceStr = element.attribute( "verythinmathspace" ); + TQString verythinmathspaceStr = element.attribute( "verythinmathspace" ); if ( ! verythinmathspaceStr.isNull() ) { readSizeAttribute( verythinmathspaceStr, &m_veryThinMathSpaceType, &m_veryThinMathSpace ); } - QString thinmathspaceStr = element.attribute( "thinmathspace" ); + TQString thinmathspaceStr = element.attribute( "thinmathspace" ); if ( ! thinmathspaceStr.isNull() ) { readSizeAttribute( thinmathspaceStr, &m_thinMathSpaceType, &m_thinMathSpace ); } - QString mediummathspaceStr = element.attribute( "mediummathspace" ); + TQString mediummathspaceStr = element.attribute( "mediummathspace" ); if ( ! mediummathspaceStr.isNull() ) { readSizeAttribute( mediummathspaceStr, &m_mediumMathSpaceType, &m_mediumMathSpace ); } - QString thickmathspaceStr = element.attribute( "thickmathspace" ); + TQString thickmathspaceStr = element.attribute( "thickmathspace" ); if ( ! thickmathspaceStr.isNull() ) { readSizeAttribute( thickmathspaceStr, &m_thickMathSpaceType, &m_thickMathSpace ); } - QString verythickmathspaceStr = element.attribute( "verythickmathspace" ); + TQString verythickmathspaceStr = element.attribute( "verythickmathspace" ); if ( ! verythickmathspaceStr.isNull() ) { readSizeAttribute( verythickmathspaceStr, &m_veryThickMathSpaceType, &m_veryThickMathSpace ); } - QString veryverythickmathspaceStr = element.attribute( "veryverythickmathspace" ); + TQString veryverythickmathspaceStr = element.attribute( "veryverythickmathspace" ); if ( ! veryverythickmathspaceStr.isNull() ) { readSizeAttribute( veryverythickmathspaceStr, &m_veryVeryThickMathSpaceType, &m_veryVeryThickMathSpace ); } return inherited::readAttributesFromMathMLDom( element ); } -void StyleElement::writeMathMLAttributes( QDomElement& element ) const +void StyleElement::writeMathMLAttributes( TQDomElement& element ) const { if ( m_customScriptLevel ) { - QString prefix; + TQString prefix; if ( m_relativeScriptLevel && m_scriptLevel >= 0 ) { prefix = "+"; } - element.setAttribute( "scriptlevel", prefix + QString( "%1" ).arg( m_scriptLevel ) ); + element.setAttribute( "scriptlevel", prefix + TQString( "%1" ).tqarg( m_scriptLevel ) ); } if ( m_customDisplayStyle ) { element.setAttribute( "displaystyle", m_displayStyle ? "true" : "false" ); } if ( m_customScriptSizeMultiplier ) { - element.setAttribute( "scriptsizemultiplier", QString( "%1" ).arg( m_scriptSizeMultiplier ) ); + element.setAttribute( "scriptsizemultiplier", TQString( "%1" ).tqarg( m_scriptSizeMultiplier ) ); } writeSizeAttribute( element, "scriptminsize", m_scriptMinSizeType, m_scriptMinSize ); if ( m_customBackground ) { @@ -193,7 +193,7 @@ void StyleElement::setStyleSize( const ContextStyle& context, StyleAttributes& s // Get scriptminsize attribute in absolute units, so we don't depend on // context to get the default value - double basesize = context.layoutUnitPtToPt( context.getBaseSize() ); + double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() ); double size = style.scriptMinSize(); switch ( m_scriptMinSizeType ) { case AbsoluteSize: @@ -236,7 +236,7 @@ void StyleElement::setStyleSize( const ContextStyle& context, StyleAttributes& s double StyleElement::sizeFactor( const ContextStyle& context, SizeType st, double length, double defvalue ) { - double basesize = context.layoutUnitPtToPt( context.getBaseSize() ); + double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() ); switch ( st ) { case AbsoluteSize: return length / basesize; @@ -270,7 +270,7 @@ void StyleElement::setStyleVariant( StyleAttributes& style ) style.setCustomMathVariant( false ); if ( customFontFamily() ) { style.setCustomFont( true ); - style.setFont( QFont(fontFamily()) ); + style.setFont( TQFont(fontFamily()) ); } bool fontweight = false; @@ -347,7 +347,7 @@ void StyleElement::resetStyle( StyleAttributes& style ) style.resetDisplayStyle(); } -void StyleElement::readSizeAttribute( const QString& str, SizeType* st, double* s ) +void StyleElement::readSizeAttribute( const TQString& str, SizeType* st, double* s ) { if ( st == 0 || s == 0 ){ return; @@ -369,17 +369,17 @@ void StyleElement::readSizeAttribute( const QString& str, SizeType* st, double* } } -void StyleElement::writeSizeAttribute( QDomElement element, const QString& str, SizeType st, double s ) const +void StyleElement::writeSizeAttribute( TQDomElement element, const TQString& str, SizeType st, double s ) const { switch ( st ) { case AbsoluteSize: - element.setAttribute( str, QString( "%1pt" ).arg( s ) ); + element.setAttribute( str, TQString( "%1pt" ).tqarg( s ) ); break; case RelativeSize: - element.setAttribute( str, QString( "%1%" ).arg( s * 100.0 ) ); + element.setAttribute( str, TQString( "%1%" ).tqarg( s * 100.0 ) ); break; case PixelSize: - element.setAttribute( str, QString( "%1px" ).arg( s ) ); + element.setAttribute( str, TQString( "%1px" ).tqarg( s ) ); break; default: break; |