summaryrefslogtreecommitdiffstats
path: root/kword/KWViewMode.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kword/KWViewMode.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-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 'kword/KWViewMode.cpp')
-rw-r--r--kword/KWViewMode.cpp226
1 files changed, 113 insertions, 113 deletions
diff --git a/kword/KWViewMode.cpp b/kword/KWViewMode.cpp
index df6c8ed1..6967e968 100644
--- a/kword/KWViewMode.cpp
+++ b/kword/KWViewMode.cpp
@@ -29,25 +29,25 @@
#include "KWPage.h"
#include "KWFrameViewManager.h"
#include "KWFrameView.h"
-#include <qapplication.h>
+#include <tqapplication.h>
#include <kdebug.h>
const unsigned short KWViewMode::s_shadowOffset = 3;
-QSize KWViewMode::availableSizeForText( KWTextFrameSet* textfs )
+TQSize KWViewMode::availableSizeForText( KWTextFrameSet* textfs )
{
KWFrame* frame = textfs->frameIterator().getLast();
return m_doc->zoomSize( KoSize( frame->innerWidth(), frame->internalY() + frame->innerHeight() ) );
}
-void KWViewMode::drawOnePageBorder( QPainter * painter, const QRect & crect, const QRect & _pageRect,
- const QRegion & emptySpaceRegion )
+void KWViewMode::drawOnePageBorder( TQPainter * painter, const TQRect & crect, const TQRect & _pageRect,
+ const TQRegion & emptySpaceRegion )
{
if ( !crect.intersects( _pageRect ) )
return;
- QRect pageRect( _pageRect );
+ TQRect pageRect( _pageRect );
//kdDebug() << "KWViewMode::drawOnePageBorder drawing page rect " << pageRect << endl;
painter->drawRect( pageRect );
// Exclude page border line, to get the page contents rect (avoids flicker)
@@ -56,40 +56,40 @@ void KWViewMode::drawOnePageBorder( QPainter * painter, const QRect & crect, con
pageRect.rRight() -= 1;
pageRect.rBottom() -= 1;
// The empty space to clear up inside this page
- QRect pagecrect = pageRect.intersect( crect );
+ TQRect pagecrect = pageRect.intersect( crect );
if ( !pagecrect.isEmpty() )
{
//kdDebug() << "KWViewMode::drawOnePageBorder : pagecrect=" << pagecrect << " emptySpaceRegion: " << emptySpaceRegion << endl;
- QRegion pageEmptyRegion = emptySpaceRegion.intersect( pagecrect );
+ TQRegion pageEmptyRegion = emptySpaceRegion.intersect( pagecrect );
//kdDebug() << "RESULT: pageEmptyRegion: " << pageEmptyRegion << endl;
if ( !pageEmptyRegion.isEmpty() )
- m_doc->eraseEmptySpace( painter, pageEmptyRegion, QApplication::palette().active().brush( QColorGroup::Base ) );
+ m_doc->eraseEmptySpace( painter, pageEmptyRegion, TQApplication::tqpalette().active().brush( TQColorGroup::Base ) );
}
}
-QRect KWViewMode::drawRightShadow( QPainter * painter, const QRect & crect, const QRect & pageRect, int topOffset )
+TQRect KWViewMode::drawRightShadow( TQPainter * painter, const TQRect & crect, const TQRect & pageRect, int topOffset )
{
- QRect shadowRect( pageRect.right() + 1, pageRect.top() + topOffset, s_shadowOffset, pageRect.height() - topOffset );
+ TQRect shadowRect( pageRect.right() + 1, pageRect.top() + topOffset, s_shadowOffset, pageRect.height() - topOffset );
shadowRect &= crect; // intersect
if ( !shadowRect.isEmpty() )
{
painter->fillRect( shadowRect,
- QApplication::palette().active().brush( QColorGroup::Shadow ) );
+ TQApplication::tqpalette().active().brush( TQColorGroup::Shadow ) );
}
return shadowRect;
}
-QRect KWViewMode::drawBottomShadow( QPainter * painter, const QRect & crect, const QRect & pageRect, int leftOffset )
+TQRect KWViewMode::drawBottomShadow( TQPainter * painter, const TQRect & crect, const TQRect & pageRect, int leftOffset )
{
- QRect shadowRect( pageRect.left() + leftOffset, pageRect.bottom() + 1, pageRect.width(), s_shadowOffset );
+ TQRect shadowRect( pageRect.left() + leftOffset, pageRect.bottom() + 1, pageRect.width(), s_shadowOffset );
shadowRect &= crect; // intersect
if ( !shadowRect.isEmpty() )
painter->fillRect( shadowRect,
- QApplication::palette().active().brush( QColorGroup::Shadow ) );
+ TQApplication::tqpalette().active().brush( TQColorGroup::Shadow ) );
return shadowRect;
}
-QPoint KWViewMode::pageCorner()
+TQPoint KWViewMode::pageCorner()
{
// Same code as KWView::slotUpdateRuler
KWFrame * frame = 0L;
@@ -104,15 +104,15 @@ QPoint KWViewMode::pageCorner()
int pageNum = 0;
if ( frame )
pageNum = frame->pageNumber();
- QPoint nPoint( 0, m_doc->pageTop(pageNum) + 1 );
- QPoint cPoint( normalToView( nPoint ) );
+ TQPoint nPoint( 0, m_doc->pageTop(pageNum) + 1 );
+ TQPoint cPoint( normalToView( nPoint ) );
/*kdDebug() << "KWViewMode::pageCorner frame=" << frame << " pagenum=" << pageNum
<< " nPoint=" << nPoint.x() << "," << nPoint.y()
<< " cPoint=" << cPoint.x() << "," << cPoint.y() << endl;*/
return cPoint;
}
-QRect KWViewMode::rulerFrameRect()
+TQRect KWViewMode::rulerFrameRect()
{
// Set the "frame start" in the ruler (tabs are relative to that position)
KWFrameSetEdit * edit = m_canvas->currentFrameSetEdit();
@@ -130,28 +130,28 @@ QRect KWViewMode::rulerFrameRect()
}
if ( frame )
{
- QRect r = normalToView( m_doc->zoomRect( frame->innerRect() ) );
+ TQRect r = normalToView( m_doc->zoomRect( frame->innerRect() ) );
// Calculate page corner (see pageCorner above)
int pageNum = frame->pageNumber();
- QPoint nPoint( 0, m_doc->pageTop(pageNum) + 1 );
- QPoint cPoint( normalToView( nPoint ) );
+ TQPoint nPoint( 0, m_doc->pageTop(pageNum) + 1 );
+ TQPoint cPoint( normalToView( nPoint ) );
// Frame start/end is relative to page corner.
r.moveBy( -cPoint.x(), -cPoint.y() );
return r;
}
- return QRect();
+ return TQRect();
}
-void KWViewMode::setPageLayout( KoRuler* hRuler, KoRuler* vRuler, const KoPageLayout& layout )
+void KWViewMode::setPageLayout( KoRuler* hRuler, KoRuler* vRuler, const KoPageLayout& tqlayout )
{
- hRuler->setPageLayout( layout );
- vRuler->setPageLayout( layout );
+ hRuler->setPageLayout( tqlayout );
+ vRuler->setPageLayout( tqlayout );
}
// static
-KWViewMode * KWViewMode::create( const QString & viewModeType, KWDocument *doc, KWCanvas* canvas )
+KWViewMode * KWViewMode::create( const TQString & viewModeType, KWDocument *doc, KWCanvas* canvas )
{
Q_ASSERT(doc);
if(viewModeType=="ModeNormal")
@@ -180,33 +180,33 @@ KWViewMode * KWViewMode::create( const QString & viewModeType, KWDocument *doc,
////
-QSize KWViewModeNormal::contentsSize()
+TQSize KWViewModeNormal::contentsSize()
{
- return QSize( m_doc->paperWidth(m_doc->startPage()),
+ return TQSize( m_doc->paperWidth(m_doc->startPage()),
m_doc->zoomItY( m_doc->pageManager()->bottomOfPage(m_doc->lastPage()) ) );
}
-QRect KWViewModeNormal::viewPageRect( int pgNum )
+TQRect KWViewModeNormal::viewPageRect( int pgNum )
{
KWPage* page = m_doc->pageManager()->page( pgNum );
- QRect r = page->zoomedRect( m_doc );
+ TQRect r = page->zoomedRect( m_doc );
r.moveBy( xOffset( page ), 0 );
return r;
}
-QPoint KWViewModeNormal::normalToView( const QPoint & nPoint )
+TQPoint KWViewModeNormal::normalToView( const TQPoint & nPoint )
{
double unzoomedY = m_doc->unzoomItY( nPoint.y() );
KWPage *page = m_doc->pageManager()->page(unzoomedY); // quotient
if( !page) {
kdWarning(31001) << "KWViewModeNormal::normalToView request for conversion out of the document! Check your input data.. ("<< nPoint << ")" << endl;
- return QPoint(0,0);
+ return TQPoint(0,0);
}
Q_ASSERT(canvas());
- return QPoint( xOffset(page) + nPoint.x(), nPoint.y() );
+ return TQPoint( xOffset(page) + nPoint.x(), nPoint.y() );
}
-QPoint KWViewModeNormal::viewToNormal( const QPoint & vPoint )
+TQPoint KWViewModeNormal::viewToNormal( const TQPoint & vPoint )
{
// Opposite of the above
// The Y is unchanged by the centering so we can use it to get the page.
@@ -214,10 +214,10 @@ QPoint KWViewModeNormal::viewToNormal( const QPoint & vPoint )
KWPage *page = m_doc->pageManager()->page(unzoomedY); // quotient
if( !page) {
kdWarning(31001) << "KWViewModeNormal::normalToView request for conversion out of the document! Check your input data.. ("<< vPoint << ")" << endl;
- return QPoint(-1,-1); // yes this is an ugly way to mark this as an excetional state...
+ return TQPoint(-1,-1); // yes this is an ugly way to mark this as an excetional state...
}
Q_ASSERT(canvas());
- return QPoint( vPoint.x() - xOffset(page), vPoint.y() );
+ return TQPoint( vPoint.x() - xOffset(page), vPoint.y() );
}
int KWViewModeNormal::xOffset(KWPage *page, int canvasWidth /* = -1 */) {
@@ -227,12 +227,12 @@ int KWViewModeNormal::xOffset(KWPage *page, int canvasWidth /* = -1 */) {
return kMax( 0, ( canvasWidth - m_doc->zoomItX( page->width() ) ) / 2 );
}
-void KWViewModeNormal::drawPageBorders( QPainter * painter, const QRect & crect, const QRegion & emptySpaceRegion )
+void KWViewModeNormal::drawPageBorders( TQPainter * painter, const TQRect & crect, const TQRegion & emptySpaceRegion )
{
painter->save();
- painter->setPen( QApplication::palette().active().color( QColorGroup::Dark ) );
- painter->setBrush( Qt::NoBrush );
- QRect pageRect;
+ painter->setPen( TQApplication::tqpalette().active().color( TQColorGroup::Dark ) );
+ painter->setBrush( TQt::NoBrush );
+ TQRect pageRect;
int lastPage = m_doc->lastPage();
Q_ASSERT(canvas());
@@ -250,24 +250,24 @@ void KWViewModeNormal::drawPageBorders( QPainter * painter, const QRect & crect,
// Center horizontally
int x = xOffset(page, canvasWidth);
// Draw page border (and erase empty area inside page)
- pageRect = QRect( x, topOfPage, pageWidth, pageHeight );
+ pageRect = TQRect( x, topOfPage, pageWidth, pageHeight );
drawOnePageBorder( painter, crect, pageRect, emptySpaceRegion );
// The area on the left of the page
- QRect leftArea( 0, topOfPage, x, pageHeight );
+ TQRect leftArea( 0, topOfPage, x, pageHeight );
leftArea &= crect;
if ( !leftArea.isEmpty() ) {
painter->fillRect( leftArea,
- QApplication::palette().active().brush( QColorGroup::Mid ) );
+ TQApplication::tqpalette().active().brush( TQColorGroup::Mid ) );
}
// The area on the right of the page
- QRect rightArea( x + pageWidth, topOfPage, crect.right() - pageWidth + 1, pageHeight );
+ TQRect rightArea( x + pageWidth, topOfPage, crect.right() - pageWidth + 1, pageHeight );
rightArea &= crect;
if ( !rightArea.isEmpty() )
{
painter->fillRect( rightArea,
- QApplication::palette().active().brush( QColorGroup::Mid ) );
+ TQApplication::tqpalette().active().brush( TQColorGroup::Mid ) );
// Draw a shadow
int topOffset = ( page==0 ) ? s_shadowOffset : 0; // leave a few pixels on top, only for first page
@@ -279,12 +279,12 @@ void KWViewModeNormal::drawPageBorders( QPainter * painter, const QRect & crect,
// Take care of the area at the bottom of the last page
if ( crect.bottom() > topOfPage )
{
- QRect bottomArea( 0, topOfPage, crect.right() + 1, crect.bottom() - topOfPage + 1 );
- QRect repaintRect = bottomArea.intersect( crect );
- if ( !repaintRect.isEmpty() )
+ TQRect bottomArea( 0, topOfPage, crect.right() + 1, crect.bottom() - topOfPage + 1 );
+ TQRect tqrepaintRect = bottomArea.intersect( crect );
+ if ( !tqrepaintRect.isEmpty() )
{
- painter->fillRect( repaintRect,
- QApplication::palette().active().brush( QColorGroup::Mid ) );
+ painter->fillRect( tqrepaintRect,
+ TQApplication::tqpalette().active().brush( TQColorGroup::Mid ) );
// Draw a shadow
drawBottomShadow( painter, crect, pageRect, s_shadowOffset );
}
@@ -294,7 +294,7 @@ void KWViewModeNormal::drawPageBorders( QPainter * painter, const QRect & crect,
////
-QRect KWViewModeEmbedded::viewPageRect( int pgNum )
+TQRect KWViewModeEmbedded::viewPageRect( int pgNum )
{
// Only one page makes sense in embedded mode though
return m_doc->pageManager()->page( pgNum )->zoomedRect( m_doc );
@@ -342,23 +342,23 @@ int KWViewModePreview::numRows() const
return ( m_doc->pageCount() ) / m_pagesPerRow + 1;
}
-QSize KWViewModePreview::contentsSize()
+TQSize KWViewModePreview::contentsSize()
{
int pages = m_doc->pageCount();
int rows = (pages-1) / m_pagesPerRow + 1;
int hPages = rows > 1 ? m_pagesPerRow : pages;
- return QSize( m_spacing + hPages * ( m_doc->paperWidth(m_doc->startPage()) + m_spacing ),
+ return TQSize( m_spacing + hPages * ( m_doc->paperWidth(m_doc->startPage()) + m_spacing ),
m_spacing + rows * ( m_doc->paperHeight(m_doc->startPage()) + m_spacing ) /* bottom of last row */ );
}
-QPoint KWViewModePreview::normalToView( const QPoint & nPoint )
+TQPoint KWViewModePreview::normalToView( const TQPoint & nPoint )
{
// Can't use nPoint.y() / m_doc->paperHeight() since this would be a rounding problem
double unzoomedY = m_doc->unzoomItY( nPoint.y() );
KWPage *page = m_doc->pageManager()->page(unzoomedY); // quotient
if( !page) {
kdWarning(31001) << "KWViewModePreview::normalToView request for conversion out of the document! Check your input data.. ("<< nPoint << ")" << endl;
- return QPoint(0,0);
+ return TQPoint(0,0);
}
double yInPagePt = unzoomedY - page->offsetInDocument();// and rest
@@ -368,48 +368,48 @@ QPoint KWViewModePreview::normalToView( const QPoint & nPoint )
<< " unzoomedY=" << unzoomedY
<< " page=" << page->pageNumber() << " row=" << row << " col=" << col
<< " yInPagePt=" << yInPagePt << endl;*/
- return QPoint( leftSpacing() + col * ( m_doc->paperWidth(page->pageNumber()) +
+ return TQPoint( leftSpacing() + col * ( m_doc->paperWidth(page->pageNumber()) +
m_spacing ) + nPoint.x(),
topSpacing() + row * ( m_doc->paperHeight(page->pageNumber()) +
m_spacing ) + m_doc->zoomItY( yInPagePt ) );
}
-QRect KWViewModePreview::viewPageRect( int pgNum )
+TQRect KWViewModePreview::viewPageRect( int pgNum )
{
int row = (pgNum - m_doc->startPage()) / m_pagesPerRow;
int col = (pgNum - m_doc->startPage()) % m_pagesPerRow;
const int paperWidth = m_doc->paperWidth( pgNum );
const int paperHeight = m_doc->paperHeight( pgNum );
- return QRect( leftSpacing() + col * ( paperWidth + m_spacing ),
+ return TQRect( leftSpacing() + col * ( paperWidth + m_spacing ),
topSpacing() + row * ( paperHeight + m_spacing ),
paperWidth,
paperHeight );
}
-QPoint KWViewModePreview::viewToNormal( const QPoint & vPoint )
+TQPoint KWViewModePreview::viewToNormal( const TQPoint & vPoint )
{
// Well, just the opposite of the above.... hmm.... headache....
int paperWidth = m_doc->paperWidth(m_doc->startPage());
int paperHeight = m_doc->paperHeight(m_doc->startPage());
- QPoint p( vPoint.x() - leftSpacing(), vPoint.y() - topSpacing() );
+ TQPoint p( vPoint.x() - leftSpacing(), vPoint.y() - topSpacing() );
int col = static_cast<int>( p.x() / ( paperWidth + m_spacing ) );
int xInPage = p.x() - col * ( paperWidth + m_spacing );
int row = static_cast<int>( p.y() / ( paperHeight + m_spacing ) );
int yInPage = p.y() - row * ( paperHeight + m_spacing );
int page = row * m_pagesPerRow + col + m_doc->startPage();
if ( page > m_doc->lastPage() ) // [this happens when moving frames around and going out of the pages]
- return QPoint( paperWidth, m_doc->pageTop( m_doc->lastPage() ) );
+ return TQPoint( paperWidth, m_doc->pageTop( m_doc->lastPage() ) );
else // normal case
- return QPoint( xInPage, yInPage + m_doc->pageTop( page ) );
+ return TQPoint( xInPage, yInPage + m_doc->pageTop( page ) );
}
-void KWViewModePreview::drawPageBorders( QPainter * painter, const QRect & crect, const QRegion & emptySpaceRegion )
+void KWViewModePreview::drawPageBorders( TQPainter * painter, const TQRect & crect, const TQRegion & emptySpaceRegion )
{
painter->save();
- painter->setPen( QApplication::palette().active().color( QColorGroup::Dark ) );
- painter->setBrush( Qt::NoBrush );
+ painter->setPen( TQApplication::tqpalette().active().color( TQColorGroup::Dark ) );
+ painter->setBrush( TQt::NoBrush );
//kdDebug() << "KWViewModePreview::drawPageBorders crect=" << DEBUGRECT( crect ) << endl;
- QRegion grayRegion( crect );
+ TQRegion grayRegion( crect );
int pageCount = m_doc->pageCount();
for ( int counter = 0; counter < pageCount; counter++ )
{
@@ -418,7 +418,7 @@ void KWViewModePreview::drawPageBorders( QPainter * painter, const QRect & crect
int page = m_doc->startPage() + counter;
int paperWidth = m_doc->paperWidth(page);
int paperHeight = m_doc->paperHeight(page);
- QRect pageRect( leftSpacing() + col * ( paperWidth + m_spacing ),
+ TQRect pageRect( leftSpacing() + col * ( paperWidth + m_spacing ),
topSpacing() + row * ( paperHeight + m_spacing ),
paperWidth, paperHeight );
drawOnePageBorder( painter, crect, pageRect, emptySpaceRegion );
@@ -426,10 +426,10 @@ void KWViewModePreview::drawPageBorders( QPainter * painter, const QRect & crect
break;
if ( pageRect.intersects( crect ) )
grayRegion -= pageRect;
- QRect rightShadow = drawRightShadow( painter, crect, pageRect, s_shadowOffset );
+ TQRect rightShadow = drawRightShadow( painter, crect, pageRect, s_shadowOffset );
if ( !rightShadow.isEmpty() )
grayRegion -= rightShadow;
- QRect bottomShadow = drawBottomShadow( painter, crect, pageRect, s_shadowOffset );
+ TQRect bottomShadow = drawBottomShadow( painter, crect, pageRect, s_shadowOffset );
if ( !bottomShadow.isEmpty() )
grayRegion -= bottomShadow;
@@ -439,7 +439,7 @@ void KWViewModePreview::drawPageBorders( QPainter * painter, const QRect & crect
if ( !grayRegion.isEmpty() )
{
//kdDebug() << "KWViewModePreview::drawPageBorders grayRegion's bounding Rect = " << DEBUGRECT( grayRegion.boundingRect() ) << endl;
- m_doc->eraseEmptySpace( painter, grayRegion, QApplication::palette().active().brush( QColorGroup::Mid ) );
+ m_doc->eraseEmptySpace( painter, grayRegion, TQApplication::tqpalette().active().brush( TQColorGroup::Mid ) );
}
painter->restore();
}
@@ -485,38 +485,38 @@ KWTextFrameSet * KWViewModeText::determineTextFrameSet( KWDocument* doc ) // sta
return fs;
}
-QPoint KWViewModeText::normalToView( const QPoint & nPoint )
+TQPoint KWViewModeText::normalToView( const TQPoint & nPoint )
{
- QPoint r (nPoint);
+ TQPoint r (nPoint);
r.setX(r.x() + OFFSET);
return r;
}
-QPoint KWViewModeText::viewToNormal( const QPoint & vPoint )
+TQPoint KWViewModeText::viewToNormal( const TQPoint & vPoint )
{
- QPoint r (vPoint);
+ TQPoint r (vPoint);
r.setX(r.x() - OFFSET);
return r;
}
-QSize KWViewModeText::contentsSize()
+TQSize KWViewModeText::contentsSize()
{
if (!textFrameSet())
- return QSize();
+ return TQSize();
// The actual contents only depend on the amount of text.
// The width is the one from the text, so that the placement of tabs makes a bit of sense, etc.
// The minimum height is the one of a normal page though.
- int width = m_doc->layoutUnitToPixelX( m_textFrameSet->textDocument()->width() );
+ int width = m_doc->tqlayoutUnitToPixelX( m_textFrameSet->textDocument()->width() );
- int height = QMAX((int)m_doc->paperHeight(m_doc->startPage()),
- m_doc->layoutUnitToPixelY( m_textFrameSet->textDocument()->height() ) );
+ int height = TQMAX((int)m_doc->paperHeight(m_doc->startPage()),
+ m_doc->tqlayoutUnitToPixelY( m_textFrameSet->textDocument()->height() ) );
//kdDebug() << "KWViewModeText::contentsSize " << width << "x" << height << endl;
- return QSize( width, height );
+ return TQSize( width, height );
}
-QSize KWViewModeText::availableSizeForText( KWTextFrameSet* /*textfs*/ )
+TQSize KWViewModeText::availableSizeForText( KWTextFrameSet* /*textfs*/ )
{
return contentsSize();
}
@@ -526,26 +526,26 @@ bool KWViewModeText::isFrameSetVisible( const KWFrameSet *fs )
if(fs==NULL) return false; // assertion
if(fs==textFrameSet()) return true;
- const KWFrameSet* parentFrameset = fs->groupmanager() ? fs->groupmanager() : fs;
- while ( parentFrameset->isFloating() ) {
- parentFrameset = parentFrameset->anchorFrameset();
- if ( parentFrameset == m_textFrameSet )
+ const KWFrameSet* tqparentFrameset = fs->groupmanager() ? fs->groupmanager() : fs;
+ while ( tqparentFrameset->isFloating() ) {
+ tqparentFrameset = tqparentFrameset->anchorFrameset();
+ if ( tqparentFrameset == m_textFrameSet )
return true;
}
return false;
}
-void KWViewModeText::drawPageBorders( QPainter * painter, const QRect & crect,
- const QRegion & /*emptySpaceRegion*/ )
+void KWViewModeText::drawPageBorders( TQPainter * painter, const TQRect & crect,
+ const TQRegion & /*emptySpaceRegion*/ )
{
painter->save();
- QRegion grayRegion( crect );
+ TQRegion grayRegion( crect );
//kdDebug() << "KWViewModeText::drawPageBorders crect=" << grayRegion << endl;
- painter->setPen( QApplication::palette().active().color( QColorGroup::Dark ) );
- QSize cSize = contentsSize();
+ painter->setPen( TQApplication::tqpalette().active().color( TQColorGroup::Dark ) );
+ TQSize cSize = contentsSize();
// Draw a line on the right -- ## or a shadow?
- // +1 to be out of the contents, and +1 for QRect
- QRect frameRect( OFFSET, 0, cSize.width() + 2, cSize.height() );
+ // +1 to be out of the contents, and +1 for TQRect
+ TQRect frameRect( OFFSET, 0, cSize.width() + 2, cSize.height() );
//kdDebug() << "KWViewModeText::drawPageBorders right line: " << frameRect.topRight() << " " << frameRect.bottomRight()<< endl;
painter->drawLine( frameRect.topRight(), frameRect.bottomRight() );
if ( frameRect.intersects( crect ) )
@@ -557,38 +557,38 @@ void KWViewModeText::drawPageBorders( QPainter * painter, const QRect & crect,
// And draw a line at the bottom -- ## or a shadow?
painter->drawLine( 0, cSize.height(),
cSize.width(), cSize.height() );
- grayRegion -= QRect( 0, cSize.height(),
+ grayRegion -= TQRect( 0, cSize.height(),
cSize.width(), cSize.height() );
}
//kdDebug() << "KWViewModeText::drawPageBorders erasing grayRegion " << grayRegion << endl;
if ( !grayRegion.isEmpty() )
- m_doc->eraseEmptySpace( painter, grayRegion, QApplication::palette().active().brush( QColorGroup::Mid ) );
+ m_doc->eraseEmptySpace( painter, grayRegion, TQApplication::tqpalette().active().brush( TQColorGroup::Mid ) );
painter->restore();
}
-QRect KWViewModeText::rulerFrameRect()
+TQRect KWViewModeText::rulerFrameRect()
{
- return QRect( QPoint(OFFSET, 0), contentsSize() );
+ return TQRect( TQPoint(OFFSET, 0), contentsSize() );
}
-void KWViewModeText::setPageLayout( KoRuler* hRuler, KoRuler* vRuler, const KoPageLayout& /*layout*/ )
+void KWViewModeText::setPageLayout( KoRuler* hRuler, KoRuler* vRuler, const KoPageLayout& /*tqlayout*/ )
{
- // Create a dummy page-layout, as if we had a single page englobing the whole text.
- KoPageLayout layout;
- layout.format = PG_CUSTOM;
- layout.orientation = PG_PORTRAIT;
- QSize cSize = contentsSize();
- layout.ptWidth = m_doc->unzoomItX( cSize.width() );
- layout.ptHeight = m_doc->unzoomItY( cSize.height() );
- //kdDebug() << "KWViewModeText::setPageLayout layout size " << layout.ptWidth << "x" << layout.ptHeight << endl;
- layout.ptLeft = OFFSET;
- layout.ptRight = 0;
- layout.ptTop = 0;
- layout.ptBottom = 0;
- layout.ptBindingSide = 0;
- layout.ptPageEdge = 0;
- hRuler->setPageLayout( layout );
- vRuler->setPageLayout( layout );
+ // Create a dummy page-tqlayout, as if we had a single page englobing the whole text.
+ KoPageLayout tqlayout;
+ tqlayout.format = PG_CUSTOM;
+ tqlayout.orientation = PG_PORTRAIT;
+ TQSize cSize = contentsSize();
+ tqlayout.ptWidth = m_doc->unzoomItX( cSize.width() );
+ tqlayout.ptHeight = m_doc->unzoomItY( cSize.height() );
+ //kdDebug() << "KWViewModeText::setPageLayout tqlayout size " << tqlayout.ptWidth << "x" << tqlayout.ptHeight << endl;
+ tqlayout.ptLeft = OFFSET;
+ tqlayout.ptRight = 0;
+ tqlayout.ptTop = 0;
+ tqlayout.ptBottom = 0;
+ tqlayout.ptBindingSide = 0;
+ tqlayout.ptPageEdge = 0;
+ hRuler->setPageLayout( tqlayout );
+ vRuler->setPageLayout( tqlayout );
}
bool KWViewModeText::isTextModeFrameset(KWFrameSet *fs) const {