summaryrefslogtreecommitdiffstats
path: root/lib/kofficeui/KoGuides.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kofficeui/KoGuides.cpp')
-rw-r--r--lib/kofficeui/KoGuides.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/kofficeui/KoGuides.cpp b/lib/kofficeui/KoGuides.cpp
index 01f6e745..c11e6745 100644
--- a/lib/kofficeui/KoGuides.cpp
+++ b/lib/kofficeui/KoGuides.cpp
@@ -69,10 +69,10 @@ private:
int m_pos;
};
-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;
+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;
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, SnaptqStatus &snaptqStatus, KoPoint &diff )
+void KoGuides::snapToGuideLines( KoRect &rect, int snap, SnapStatus &snapStatus, KoPoint &diff )
{
- if( !(snaptqStatus & SNAP_VERT))
+ if( !(snapStatus & SNAP_VERT))
diff.setX(10000);
- if( !(snaptqStatus & SNAP_HORIZ))
+ if( !(snapStatus & SNAP_HORIZ))
diff.setY(10000);
for ( int i = 0; i < GL_END; ++i )
@@ -380,60 +380,60 @@ void KoGuides::snapToGuideLines( KoRect &rect, int snap, SnaptqStatus &snaptqSta
if ( ( *it )->orientation == Qt::Horizontal )
{
double tmp = (*it)->position - rect.top();
- if ( snaptqStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) )
+ if ( snapStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) )
{
if(TQABS( tmp ) < TQABS(diff.y()))
{
diff.setY( tmp );
- snaptqStatus |= SNAP_HORIZ;
+ snapStatus |= SNAP_HORIZ;
}
}
tmp = (*it)->position - rect.bottom();
- if ( snaptqStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) )
+ if ( snapStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) )
{
if(TQABS( tmp ) < TQABS(diff.y()))
{
diff.setY( tmp );
- snaptqStatus |= SNAP_HORIZ;
+ snapStatus |= SNAP_HORIZ;
}
}
}
else
{
double tmp = (*it)->position - rect.left();
- if ( snaptqStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) )
+ if ( snapStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) )
{
if(TQABS( tmp ) < TQABS(diff.x()))
{
diff.setX( tmp );
- snaptqStatus |= SNAP_VERT;
+ snapStatus |= SNAP_VERT;
}
}
tmp = (*it)->position - rect.right();
- if ( snaptqStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) )
+ if ( snapStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) )
{
if(TQABS( tmp ) < TQABS(diff.x()))
{
diff.setX( tmp );
- snaptqStatus |= SNAP_VERT;
+ snapStatus |= SNAP_VERT;
}
}
}
}
}
- if(!(snaptqStatus & SNAP_VERT))
+ if(!(snapStatus & SNAP_VERT))
diff.setX( 0 );
- if(!(snaptqStatus & SNAP_HORIZ))
+ if(!(snapStatus & SNAP_HORIZ))
diff.setY( 0 );
}
-void KoGuides::snapToGuideLines( KoPoint &pos, int snap, SnaptqStatus &snaptqStatus, KoPoint &diff )
+void KoGuides::snapToGuideLines( KoPoint &pos, int snap, SnapStatus &snapStatus, KoPoint &diff )
{
- if( !(snaptqStatus & SNAP_VERT))
+ if( !(snapStatus & SNAP_VERT))
diff.setX(10000);
- if( !(snaptqStatus & SNAP_HORIZ))
+ if( !(snapStatus & SNAP_HORIZ))
diff.setY(10000);
for ( int i = 0; i < GL_END; ++i )
@@ -444,34 +444,34 @@ void KoGuides::snapToGuideLines( KoPoint &pos, int snap, SnaptqStatus &snaptqSta
if ( ( *it )->orientation == Qt::Horizontal )
{
double tmp = (*it)->position - pos.y();
- if ( snaptqStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) )
+ if ( snapStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) )
{
if(TQABS( tmp ) < TQABS(diff.y()))
{
diff.setY( tmp );
- snaptqStatus |= SNAP_HORIZ;
+ snapStatus |= SNAP_HORIZ;
}
}
}
else
{
double tmp = (*it)->position - pos.x();
- if ( snaptqStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) )
+ if ( snapStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) )
{
if(TQABS( tmp ) < TQABS(diff.x()))
{
diff.setX( tmp );
- snaptqStatus |= SNAP_VERT;
+ snapStatus |= SNAP_VERT;
}
}
}
}
}
- if(!(snaptqStatus & SNAP_VERT))
+ if(!(snapStatus & SNAP_VERT))
diff.setX( 0 );
- if(!(snaptqStatus & SNAP_HORIZ))
+ if(!(snapStatus & SNAP_HORIZ))
diff.setY( 0 );
}
@@ -530,7 +530,7 @@ void KoGuides::repaintSnapping( const KoRect &snappedRect )
}
-void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnaptqStatus snaptqStatus )
+void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnapStatus snapStatus )
{
bool needRepaint = false;
for ( int i = 0; i < GL_END; ++i )
@@ -538,7 +538,7 @@ void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnaptqStatus snaptq
TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
- if ( ( *it )->orientation == Qt::Horizontal && ( snaptqStatus & SNAP_HORIZ ) )
+ if ( ( *it )->orientation == Qt::Horizontal && ( snapStatus & SNAP_HORIZ ) )
{
if( virtuallyEqual( snappedPoint.y(), (*it)->position ) )
{
@@ -556,7 +556,7 @@ void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnaptqStatus snaptq
}
else
{
- if ( snaptqStatus & SNAP_VERT )
+ if ( snapStatus & SNAP_VERT )
{
if( virtuallyEqual( snappedPoint.x(), (*it)->position ) )
{