diff options
Diffstat (limited to 'lib/kformula/paddedelement.cc')
-rw-r--r-- | lib/kformula/paddedelement.cc | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/lib/kformula/paddedelement.cc b/lib/kformula/paddedelement.cc index f48d4503..f79e6789 100644 --- a/lib/kformula/paddedelement.cc +++ b/lib/kformula/paddedelement.cc @@ -22,7 +22,7 @@ KFORMULA_NAMESPACE_BEGIN -PaddedElement::PaddedElement( BasicElement* parent ) : SequenceElement( parent ), +PaddedElement::PaddedElement( BasicElement* tqparent ) : SequenceElement( tqparent ), m_widthType( NoSize ), m_lspaceType( NoSize ), m_heightType( NoSize ), @@ -36,7 +36,7 @@ PaddedElement::PaddedElement( BasicElement* parent ) : SequenceElement( parent ) /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void PaddedElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -60,13 +60,13 @@ void PaddedElement::calcSizes( const ContextStyle& context, width += it->getWidth() + spaceBefore; luPixel baseline = it->getBaseline(); if ( baseline > -1 ) { - height = QMAX( height, baseline ); - depth = QMAX( depth, it->getHeight() - baseline ); + height = TQMAX( height, baseline ); + depth = TQMAX( depth, it->getHeight() - baseline ); } else { luPixel bl = it->getHeight()/2 + context.axisHeight( tstyle, factor ); - height = QMAX( height, bl ); - depth = QMAX( depth, it->getHeight() - bl ); + height = TQMAX( height, bl ); + depth = TQMAX( depth, it->getHeight() - bl ); } } } @@ -110,25 +110,25 @@ void PaddedElement::calcSizes( const ContextStyle& context, } } -bool PaddedElement::readAttributesFromMathMLDom(const QDomElement& element) +bool PaddedElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString widthStr = element.attribute( "width" ).stripWhiteSpace().lower(); + TQString widthStr = element.attribute( "width" ).stripWhiteSpace().lower(); if ( ! widthStr.isNull() ) { m_width = readSizeAttribute( widthStr, &m_widthType, &m_widthRelative ); } - QString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower(); + TQString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower(); if ( ! lspaceStr.isNull() ) { m_lspace = readSizeAttribute( lspaceStr, &m_lspaceType, &m_lspaceRelative ); } - QString heightStr = element.attribute( "height" ).stripWhiteSpace().lower(); + TQString heightStr = element.attribute( "height" ).stripWhiteSpace().lower(); if ( ! heightStr.isNull() ) { m_height = readSizeAttribute( heightStr, &m_heightType, &m_heightRelative ); } - QString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower(); + TQString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower(); if ( ! depthStr.isNull() ) { m_depth = readSizeAttribute( depthStr, &m_depthType, &m_depthRelative ); } @@ -136,7 +136,7 @@ bool PaddedElement::readAttributesFromMathMLDom(const QDomElement& element) return true; } -void PaddedElement::writeMathMLAttributes( QDomElement& element ) const +void PaddedElement::writeMathMLAttributes( TQDomElement& element ) const { writeSizeAttribute( element, "width", m_widthType, m_width, m_widthRelative ); writeSizeAttribute( element, "lspace", m_lspaceType, m_lspace, m_lspaceRelative ); @@ -144,7 +144,7 @@ void PaddedElement::writeMathMLAttributes( QDomElement& element ) const writeSizeAttribute( element, "depth", m_depthType, m_depth, m_depthRelative ); } -double PaddedElement::readSizeAttribute( const QString& str, SizeType* st, bool* relative ) +double PaddedElement::readSizeAttribute( const TQString& str, SizeType* st, bool* relative ) { if ( st == 0 ){ return -1; @@ -152,55 +152,55 @@ double PaddedElement::readSizeAttribute( const QString& str, SizeType* st, bool* if ( str[0] == '+' || str[0] == '-' ) { *relative = true; } - int index = str.find( "width" ); + int index = str.tqfind( "width" ); if ( index != -1 ) { - int index2 = str.find( "%" ); + int index2 = str.tqfind( "%" ); if ( index2 != -1 ) { return str2size( str.left( index2 ).stripWhiteSpace(), st, WidthRelativeSize ) / 100.0; } return str2size( str.left( index ).stripWhiteSpace(), st, WidthRelativeSize ); } - index = str.find( "height" ); + index = str.tqfind( "height" ); if ( index != -1 ) { - int index2 = str.find( "%" ); + int index2 = str.tqfind( "%" ); if ( index2 != -1 ) { return str2size( str.left( index2 ).stripWhiteSpace(), st, HeightRelativeSize ) / 100.0; } return str2size( str.left( index ).stripWhiteSpace(), st, HeightRelativeSize ); } - index = str.find( "%" ); + index = str.tqfind( "%" ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize ) / 100.0; } - index = str.find( "pt", 0, false ); + index = str.tqfind( "pt", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ); } - index = str.find( "mm", 0, false ); + index = str.tqfind( "mm", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0 / 20.54; } - index = str.find( "cm", 0, false ); + index = str.tqfind( "cm", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0 / 2.54; } - index = str.find( "in", 0, false ); + index = str.tqfind( "in", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0; } - index = str.find( "em", 0, false ); + index = str.tqfind( "em", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize ); } - index = str.find( "ex", 0, false ); + index = str.tqfind( "ex", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize ); } - index = str.find( "pc", 0, false ); + index = str.tqfind( "pc", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 12.0; } - index = str.find( "px", 0, false ); + index = str.tqfind( "px", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, PixelSize ); } @@ -208,7 +208,7 @@ double PaddedElement::readSizeAttribute( const QString& str, SizeType* st, bool* return str2size( str, st, AbsoluteSize ); } -double PaddedElement::str2size( const QString& str, SizeType *st, SizeType type ) +double PaddedElement::str2size( const TQString& str, SizeType *st, SizeType type ) { bool ok; double size = str.toDouble( &ok ); @@ -224,27 +224,27 @@ double PaddedElement::str2size( const QString& str, SizeType *st, SizeType type return -1; } -void PaddedElement::writeSizeAttribute( QDomElement element, const QString& str, +void PaddedElement::writeSizeAttribute( TQDomElement element, const TQString& str, SizeType st, bool relative, double s ) const { - QString prefix; + TQString prefix; if ( relative ) { s < 0 ? prefix = "-" : prefix = "+" ; } switch ( st ) { case WidthRelativeSize: - element.setAttribute( str, prefix + QString( "%1 width" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1 width" ).tqarg( s ) ); break; case HeightRelativeSize: - element.setAttribute( str, prefix + QString( "%1 height" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1 height" ).tqarg( s ) ); case AbsoluteSize: - element.setAttribute( str, prefix + QString( "%1pt" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1pt" ).tqarg( s ) ); break; case RelativeSize: - element.setAttribute( str, prefix + QString( "%1%" ).arg( s * 100.0 ) ); + element.setAttribute( str, prefix + TQString( "%1%" ).tqarg( s * 100.0 ) ); break; case PixelSize: - element.setAttribute( str, prefix + QString( "%1px" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1px" ).tqarg( s ) ); break; default: break; |