diff options
Diffstat (limited to 'lib/kofficeui/KoGuides.cpp')
-rw-r--r-- | lib/kofficeui/KoGuides.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/lib/kofficeui/KoGuides.cpp b/lib/kofficeui/KoGuides.cpp index 870fddc6..01f6e745 100644 --- a/lib/kofficeui/KoGuides.cpp +++ b/lib/kofficeui/KoGuides.cpp @@ -69,10 +69,10 @@ private: int m_pos; }; -const KoGuides::SnapStatus KoGuides::SNAP_NONE = 0; -const KoGuides::SnapStatus KoGuides::SNAP_HORIZ = 1; -const KoGuides::SnapStatus KoGuides::SNAP_VERT = 2; -const KoGuides::SnapStatus KoGuides::SNAP_BOTH = 3; +const KoGuides::SnaptqStatus KoGuides::SNAP_NONE = 0; +const KoGuides::SnaptqStatus KoGuides::SNAP_HORIZ = 1; +const KoGuides::SnaptqStatus KoGuides::SNAP_VERT = 2; +const KoGuides::SnaptqStatus KoGuides::SNAP_BOTH = 3; KoGuides::KoGuides( KoView *view, KoZoomHandler *zoomHandler ) : m_view( view ) @@ -365,11 +365,11 @@ void KoGuides::getGuideLines( TQValueList<double> &horizontalPos, TQValueList<do } -void KoGuides::snapToGuideLines( KoRect &rect, int snap, SnapStatus &snapStatus, KoPoint &diff ) +void KoGuides::snapToGuideLines( KoRect &rect, int snap, SnaptqStatus &snaptqStatus, KoPoint &diff ) { - if( !(snapStatus & SNAP_VERT)) + if( !(snaptqStatus & SNAP_VERT)) diff.setX(10000); - if( !(snapStatus & SNAP_HORIZ)) + if( !(snaptqStatus & SNAP_HORIZ)) diff.setY(10000); for ( int i = 0; i < GL_END; ++i ) @@ -380,60 +380,60 @@ void KoGuides::snapToGuideLines( KoRect &rect, int snap, SnapStatus &snapStatus, if ( ( *it )->orientation == Qt::Horizontal ) { double tmp = (*it)->position - rect.top(); - if ( snapStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) + if ( snaptqStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) { if(TQABS( tmp ) < TQABS(diff.y())) { diff.setY( tmp ); - snapStatus |= SNAP_HORIZ; + snaptqStatus |= SNAP_HORIZ; } } tmp = (*it)->position - rect.bottom(); - if ( snapStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) + if ( snaptqStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) { if(TQABS( tmp ) < TQABS(diff.y())) { diff.setY( tmp ); - snapStatus |= SNAP_HORIZ; + snaptqStatus |= SNAP_HORIZ; } } } else { double tmp = (*it)->position - rect.left(); - if ( snapStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) + if ( snaptqStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) { if(TQABS( tmp ) < TQABS(diff.x())) { diff.setX( tmp ); - snapStatus |= SNAP_VERT; + snaptqStatus |= SNAP_VERT; } } tmp = (*it)->position - rect.right(); - if ( snapStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) + if ( snaptqStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) { if(TQABS( tmp ) < TQABS(diff.x())) { diff.setX( tmp ); - snapStatus |= SNAP_VERT; + snaptqStatus |= SNAP_VERT; } } } } } - if(!(snapStatus & SNAP_VERT)) + if(!(snaptqStatus & SNAP_VERT)) diff.setX( 0 ); - if(!(snapStatus & SNAP_HORIZ)) + if(!(snaptqStatus & SNAP_HORIZ)) diff.setY( 0 ); } -void KoGuides::snapToGuideLines( KoPoint &pos, int snap, SnapStatus &snapStatus, KoPoint &diff ) +void KoGuides::snapToGuideLines( KoPoint &pos, int snap, SnaptqStatus &snaptqStatus, KoPoint &diff ) { - if( !(snapStatus & SNAP_VERT)) + if( !(snaptqStatus & SNAP_VERT)) diff.setX(10000); - if( !(snapStatus & SNAP_HORIZ)) + if( !(snaptqStatus & SNAP_HORIZ)) diff.setY(10000); for ( int i = 0; i < GL_END; ++i ) @@ -444,34 +444,34 @@ void KoGuides::snapToGuideLines( KoPoint &pos, int snap, SnapStatus &snapStatus, if ( ( *it )->orientation == Qt::Horizontal ) { double tmp = (*it)->position - pos.y(); - if ( snapStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) + if ( snaptqStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) { if(TQABS( tmp ) < TQABS(diff.y())) { diff.setY( tmp ); - snapStatus |= SNAP_HORIZ; + snaptqStatus |= SNAP_HORIZ; } } } else { double tmp = (*it)->position - pos.x(); - if ( snapStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) + if ( snaptqStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) { if(TQABS( tmp ) < TQABS(diff.x())) { diff.setX( tmp ); - snapStatus |= SNAP_VERT; + snaptqStatus |= SNAP_VERT; } } } } } - if(!(snapStatus & SNAP_VERT)) + if(!(snaptqStatus & SNAP_VERT)) diff.setX( 0 ); - if(!(snapStatus & SNAP_HORIZ)) + if(!(snaptqStatus & SNAP_HORIZ)) diff.setY( 0 ); } @@ -530,7 +530,7 @@ void KoGuides::repaintSnapping( const KoRect &snappedRect ) } -void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnapStatus snapStatus ) +void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnaptqStatus snaptqStatus ) { bool needRepaint = false; for ( int i = 0; i < GL_END; ++i ) @@ -538,7 +538,7 @@ void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnapStatus snapStat TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); for ( ; it != m_guideLines[i].end(); ++it ) { - if ( ( *it )->orientation == Qt::Horizontal && ( snapStatus & SNAP_HORIZ ) ) + if ( ( *it )->orientation == Qt::Horizontal && ( snaptqStatus & SNAP_HORIZ ) ) { if( virtuallyEqual( snappedPoint.y(), (*it)->position ) ) { @@ -556,7 +556,7 @@ void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnapStatus snapStat } else { - if ( snapStatus & SNAP_VERT ) + if ( snaptqStatus & SNAP_VERT ) { if( virtuallyEqual( snappedPoint.x(), (*it)->position ) ) { @@ -754,7 +754,7 @@ void KoGuides::slotRemove() void KoGuides::paint() { - m_view->canvas()->repaint( false ); + m_view->canvas()->tqrepaint( false ); } |