diff options
Diffstat (limited to 'kword/KWFrame.cpp')
-rw-r--r-- | kword/KWFrame.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/kword/KWFrame.cpp b/kword/KWFrame.cpp index cc31aa97..a559b892 100644 --- a/kword/KWFrame.cpp +++ b/kword/KWFrame.cpp @@ -44,7 +44,7 @@ /* Class: ZOrderedFrameList */ /******************************************************************/ -int ZOrderedFrameList::compareItems(QPtrCollection::Item a, QPtrCollection::Item b) +int ZOrderedFrameList::compareItems(TQPtrCollection::Item a, TQPtrCollection::Item b) { int za = ((KWFrame *)a)->zOrder(); int zb = ((KWFrame *)b)->zOrder(); @@ -89,11 +89,11 @@ KWFrame::KWFrame(KWFrameSet *fs, double left, double top, double width, double h m_minFrameHeight( 0.01 ), // not 0, since AutoExtendFrame means min-height in odt m_internalY( 0 ), m_zOrder( 0 ), - m_backgroundColor( (fs && (fs->type() == FT_PICTURE || fs->type() == FT_PART)) ? QBrush( QColor(), Qt::NoBrush) : QBrush( QColor() ) ), // valid brush with invalid color ( default ) - m_borderLeft( QColor(), KoBorder::SOLID, 0 ), - m_borderRight( QColor(), KoBorder::SOLID, 0 ), - m_borderTop( QColor(), KoBorder::SOLID, 0 ), - m_borderBottom( QColor(), KoBorder::SOLID, 0 ), + m_backgroundColor( (fs && (fs->type() == FT_PICTURE || fs->type() == FT_PART)) ? TQBrush( TQColor(), TQt::NoBrush) : TQBrush( TQColor() ) ), // valid brush with invalid color ( default ) + m_borderLeft( TQColor(), KoBorder::SOLID, 0 ), + m_borderRight( TQColor(), KoBorder::SOLID, 0 ), + m_borderTop( TQColor(), KoBorder::SOLID, 0 ), + m_borderBottom( TQColor(), KoBorder::SOLID, 0 ), m_frameSet( fs ) { //kdDebug(32001) << "KWFrame::KWFrame " << this << " left=" << left << " top=" << top << endl; @@ -107,7 +107,7 @@ KWFrame::~KWFrame() m_frameStack = 0; } -void KWFrame::setBackgroundColor( const QBrush &color ) +void KWFrame::setBackgroundColor( const TQBrush &color ) { m_backgroundColor = color; } @@ -166,7 +166,7 @@ void KWFrame::copySettings(KWFrame *frm) void KWFrame::frameBordersChanged() { if (frameSet()->isFloating()) - frameSet()->anchorFrameset()->invalidate(); + frameSet()->anchorFrameset()->tqinvalidate(); } @@ -182,10 +182,10 @@ void KWFrame::updateRulerHandles(){ #endif } -QRect KWFrame::outerRect( KWViewMode* viewMode ) const +TQRect KWFrame::outerRect( KWViewMode* viewMode ) const { KWDocument *doc = m_frameSet->kWordDocument(); - QRect outerRect( doc->zoomRect( *this ) ); + TQRect outerRect( doc->zoomRect( *this ) ); if ( viewMode && !m_frameSet->groupmanager() ) { int minBorder = viewMode->drawFrameBorders() ? 1 : 0; KWFrame* settingsFrame = m_frameSet->settingsFrame( this ); @@ -219,16 +219,16 @@ KoRect KWFrame::runAroundRect() const return raRect; } -void KWFrame::save( QDomElement &frameElem ) +void KWFrame::save( TQDomElement &frameElem ) { // setAttribute( double ) uses a default precision of 6, and this seems // to be 6 digits, even like '123.123' ! - frameElem.setAttribute( "left", QString::number( left(), 'g', DBL_DIG ) ); - frameElem.setAttribute( "top", QString::number( top(), 'g', DBL_DIG ) ); - frameElem.setAttribute( "right", QString::number( right(), 'g', DBL_DIG ) ); - frameElem.setAttribute( "bottom", QString::number( bottom(), 'g', DBL_DIG ) ); + frameElem.setAttribute( "left", TQString::number( left(), 'g', DBL_DIG ) ); + frameElem.setAttribute( "top", TQString::number( top(), 'g', DBL_DIG ) ); + frameElem.setAttribute( "right", TQString::number( right(), 'g', DBL_DIG ) ); + frameElem.setAttribute( "bottom", TQString::number( bottom(), 'g', DBL_DIG ) ); if ( minimumFrameHeight() > 0 ) - frameElem.setAttribute( "min-height", QString::number( minimumFrameHeight(), 'g', DBL_DIG ) ); + frameElem.setAttribute( "min-height", TQString::number( minimumFrameHeight(), 'g', DBL_DIG ) ); if ( !m_frameSet->isHeaderOrFooter() && !m_frameSet->isMainFrameset() ) { @@ -251,7 +251,7 @@ void KWFrame::save( QDomElement &frameElem ) frameElem.setAttribute( "runaroundTop", m_runAroundTop ); frameElem.setAttribute( "runaroundBottom", m_runAroundBottom ); // The old file format had only one value, keep compat - double runAroundGap = QMAX( QMAX( m_runAroundLeft, m_runAroundRight ), QMAX( m_runAroundTop, m_runAroundBottom ) ); + double runAroundGap = TQMAX( TQMAX( m_runAroundLeft, m_runAroundRight ), TQMAX( m_runAroundTop, m_runAroundBottom ) ); frameElem.setAttribute( "runaroundGap", runAroundGap ); } } @@ -337,11 +337,11 @@ void KWFrame::save( QDomElement &frameElem ) frameElem.setAttribute( "z-index", zOrder() ); } -void KWFrame::load( QDomElement &frameElem, KWFrameSet* frameSet, int syntaxVersion ) +void KWFrame::load( TQDomElement &frameElem, KWFrameSet* frameSet, int syntaxVersion ) { m_minFrameHeight = KWDocument::getAttribute( frameElem, "min-height", 0.0 ); m_runAround = static_cast<RunAround>( KWDocument::getAttribute( frameElem, "runaround", RA_NO ) ); - QString str = frameElem.attribute( "runaroundSide" ); + TQString str = frameElem.attribute( "runaroundSide" ); if ( str == "left" ) m_runAroundSide = RA_LEFT; else if ( str == "right" ) @@ -396,7 +396,7 @@ void KWFrame::load( QDomElement &frameElem, KWFrameSet* frameSet, int syntaxVers r.setStyle(static_cast<KoBorder::BorderStyle>( KWDocument::getAttribute( frameElem, "rStyle", KoBorder::SOLID ) )); t.setStyle(static_cast<KoBorder::BorderStyle>( KWDocument::getAttribute( frameElem, "tStyle", KoBorder::SOLID ) )); b.setStyle( static_cast<KoBorder::BorderStyle>( KWDocument::getAttribute( frameElem, "bStyle", KoBorder::SOLID ) )); - QColor c; + TQColor c; if ( frameElem.hasAttribute("bkRed") ) c.setRgb( KWDocument::getAttribute( frameElem, "bkRed", 0 ), @@ -418,11 +418,11 @@ void KWFrame::load( QDomElement &frameElem, KWFrameSet* frameSet, int syntaxVers m_borderRight = r; m_borderTop = t; m_borderBottom = b; - m_backgroundColor = QBrush( c ); + m_backgroundColor = TQBrush( c ); if( frameElem.hasAttribute("bkStyle")) - m_backgroundColor.setStyle (static_cast<Qt::BrushStyle>(KWDocument::getAttribute( frameElem, "bkStyle", Qt::SolidPattern ))); + m_backgroundColor.setStyle (static_cast<Qt::BrushStyle>(KWDocument::getAttribute( frameElem, "bkStyle", TQt::SolidPattern ))); m_paddingLeft = frameElem.attribute( "bleftpt" ).toDouble(); m_paddingRight = frameElem.attribute( "brightpt" ).toDouble(); @@ -444,17 +444,17 @@ void KWFrame::loadBorderProperties( KoStyleStack& styleStack ) // background color if ( styleStack.hasAttributeNS( KoXmlNS::fo, "background-color" ) ) { - QString color = styleStack.attributeNS( KoXmlNS::fo, "background-color" ); + TQString color = styleStack.attributeNS( KoXmlNS::fo, "background-color" ); if ( color == "transparent" ) - m_backgroundColor = QBrush( QColor(), Qt::NoBrush ); + m_backgroundColor = TQBrush( TQColor(), TQt::NoBrush ); else { - m_backgroundColor = QBrush( QColor( color ) /*, brush style is a dead feature, ignored */ ); + m_backgroundColor = TQBrush( TQColor( color ) /*, brush style is a dead feature, ignored */ ); } } // OOo compatibility: it uses background-transparency=100% instead of background-color="transparent" if ( styleStack.hasAttributeNS( KoXmlNS::fo, "background-transparency" ) ) { - QString transp = styleStack.attributeNS( KoXmlNS::fo, "background-transparency" ); + TQString transp = styleStack.attributeNS( KoXmlNS::fo, "background-transparency" ); if ( transp == "100%" ) m_backgroundColor.setStyle( Qt::NoBrush ); } @@ -481,12 +481,12 @@ void KWFrame::loadCommonOasisProperties( KoOasisContext& context, KWFrameSet* fr // loadBorderProperties loads fo:background-color for compatibility (and for table cells), // but the correct way for text boxes is draw:fill-color if ( styleStack.hasAttributeNS( KoXmlNS::draw, "fill-color" ) ) { - QString color = styleStack.attributeNS( KoXmlNS::draw, "fill-color" ); + TQString color = styleStack.attributeNS( KoXmlNS::draw, "fill-color" ); if ( color == "transparent" ) - m_backgroundColor = QBrush( QColor(), Qt::NoBrush ); + m_backgroundColor = TQBrush( TQColor(), TQt::NoBrush ); else { - m_backgroundColor = QBrush( QColor( color ) /*, brush style is a dead feature, ignored */ ); + m_backgroundColor = TQBrush( TQColor( color ) /*, brush style is a dead feature, ignored */ ); } } @@ -505,7 +505,7 @@ void KWFrame::loadCommonOasisProperties( KoOasisContext& context, KWFrameSet* fr // This attribute isn't part of the OASIS spec. Doesn't matter since it doesn't affect rendering // of existing documents, only editing (and only KWord has this kind of option until now). - const QCString frameBehaviorOnNewPage = styleStack.attributeNS( KoXmlNS::koffice, "frame-behavior-on-new-page" ).latin1(); + const TQCString frameBehaviorOnNewPage = styleStack.attributeNS( KoXmlNS::koffice, "frame-behavior-on-new-page" ).latin1(); if ( frameBehaviorOnNewPage == "followup" ) m_newFrameBehavior = Reconnect; else if ( frameBehaviorOnNewPage == "copy" ) @@ -523,7 +523,7 @@ void KWFrame::loadCommonOasisProperties( KoOasisContext& context, KWFrameSet* fr KWFrame::RunAround runAround = KWFrame::RA_BOUNDINGRECT; KWFrame::RunAroundSide runAroundSide = KWFrame::RA_BIGGEST; - const QCString oowrap = styleStack.attributeNS( KoXmlNS::style, "wrap" ).latin1(); + const TQCString oowrap = styleStack.attributeNS( KoXmlNS::style, "wrap" ).latin1(); if ( oowrap == "none" ) // 'no wrap' means 'avoid horizontal space' runAround = KWFrame::RA_SKIP; else if ( oowrap == "left" ) @@ -541,7 +541,7 @@ void KWFrame::loadCommonOasisProperties( KoOasisContext& context, KWFrameSet* fr setRunAroundSide( runAroundSide ); } -void KWFrame::startOasisFrame( KoXmlWriter &writer, KoGenStyles& mainStyles, const QString& name, const QString& lastFrameName ) const +void KWFrame::startOasisFrame( KoXmlWriter &writer, KoGenStyles& mainStyles, const TQString& name, const TQString& lastFrameName ) const { writer.startElement( "draw:frame" ); writer.addAttribute( "draw:name", name ); @@ -569,7 +569,7 @@ void KWFrame::saveBorderProperties( KoGenStyle& frameStyle ) const { // Background: color and transparency // OOo seems to use style:background-transparency="100%", but the schema allows background-color=transparent - if ( m_backgroundColor.style() == Qt::NoBrush ) + if ( m_backgroundColor.style() == TQt::NoBrush ) frameStyle.addProperty( "fo:background-color", "transparent" ); else if ( m_backgroundColor.color().isValid() ) frameStyle.addProperty( "fo:background-color", m_backgroundColor.color().name() ); @@ -641,10 +641,10 @@ void KWFrame::saveMarginProperties( KoGenStyle& frameStyle ) const #endif } -QString KWFrame::saveOasisFrameStyle( KoGenStyles& mainStyles ) const +TQString KWFrame::saveOasisFrameStyle( KoGenStyles& mainStyles ) const { KoGenStyle frameStyle( KWDocument::STYLE_FRAME_AUTO, "graphic" ); - QString protect; + TQString protect; if ( frameSet()->protectContent() ) protect = "content"; if ( frameSet()->isProtectSize() ) // ## should be moved for frame @@ -666,7 +666,7 @@ QString KWFrame::saveOasisFrameStyle( KoGenStyles& mainStyles ) const // Background (KWFrame::saveBorderProperties saves as fo:background-color, but OOo-2.0.x uses draw:fill-color) // So now we use draw:fill-color too, the text background color is in fact a paragraph feature. - if ( m_backgroundColor.style() == Qt::NoBrush ) + if ( m_backgroundColor.style() == TQt::NoBrush ) frameStyle.addProperty( "draw:fill-color", "transparent" ); else if ( m_backgroundColor.color().isValid() ) frameStyle.addProperty( "draw:fill-color", m_backgroundColor.color().name() ); @@ -715,7 +715,7 @@ QString KWFrame::saveOasisFrameStyle( KoGenStyles& mainStyles ) const return mainStyles.lookup( frameStyle, "fr" ); } -bool KWFrame::frameAtPos( const QPoint& point, bool borderOfFrameOnly) const { +bool KWFrame::frameAtPos( const TQPoint& point, bool borderOfFrameOnly) const { // Forwarded to KWFrameSet to make it virtual return frameSet()->isFrameAtPos( this, point, borderOfFrameOnly ); } |