[fondue-commits] [SCM] Fondue Font Editor branch, master, updated. c190fbb61058a8c2f7e7a2c650bf0528d75324be
Eugeniy Meshcheryakov
eugen at debian.org
Mon Feb 11 10:41:42 UTC 2008
The following commit has been merged in the master branch:
commit c190fbb61058a8c2f7e7a2c650bf0528d75324be
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date: Mon Feb 11 00:06:22 2008 +0100
convert if->switch
diff --git a/gui/glyphcell.cxx b/gui/glyphcell.cxx
index 50fcead..555545f 100644
--- a/gui/glyphcell.cxx
+++ b/gui/glyphcell.cxx
@@ -125,32 +125,43 @@ void GlyphCell::mouseDoubleClickEvent(QMouseEvent *e)
void GlyphCell::keyPressEvent(QKeyEvent *e)
{
- if (e->key() == Qt::Key_Delete && !e->modifiers()) {
- qDebug() << "Delete pressed";
- // let's try to delete some points
- QList<QGraphicsItem *> items = scene()->selectedItems();
- foreach (QGraphicsItem *item, items) {
- if (item->type() == ControlPoint::Type) {
- ControlPoint *cp = dynamic_cast<ControlPoint *>(item);
- Q_ASSERT(cp);
-
- // FIXME points will be automatically renumbered after deletion
- GlyphContour *c = cp->contour();
- c->removePoints(cp->pointNumber(), 1);
+ switch (e->key()) {
+ case Qt::Key_Delete:
+ if (!e->modifiers()) {
+ qDebug() << "Delete pressed";
+ // let's try to delete some points
+ QList<QGraphicsItem *> items = scene()->selectedItems();
+ foreach (QGraphicsItem *item, items) {
+ if (item->type() == ControlPoint::Type) {
+ ControlPoint *cp = dynamic_cast<ControlPoint *>(item);
+ Q_ASSERT(cp);
+
+ // FIXME points will be automatically renumbered after deletion
+ GlyphContour *c = cp->contour();
+ c->removePoints(cp->pointNumber(), 1);
+ }
}
}
- }
- else if (e->key() == Qt::Key_Up && !e->modifiers()) {
- moveSelection(QPointF(0, -1));
- }
- else if (e->key() == Qt::Key_Down && !e->modifiers()) {
- moveSelection(QPointF(0, 1));
- }
- else if (e->key() == Qt::Key_Right && !e->modifiers()) {
- moveSelection(QPointF(1, 0));
- }
- else if (e->key() == Qt::Key_Left && !e->modifiers()) {
- moveSelection(QPointF(-1, 0));
+ break;
+ case Qt::Key_Up:
+ if (!e->modifiers())
+ moveSelection(QPointF(0, -1));
+ break;
+ case Qt::Key_Down:
+ if (!e->modifiers())
+ moveSelection(QPointF(0, 1));
+ break;
+ case Qt::Key_Right:
+ if (!e->modifiers())
+ moveSelection(QPointF(1, 0));
+ break;
+ case Qt::Key_Left:
+ if (!e->modifiers())
+ moveSelection(QPointF(-1, 0));
+ break;
+ default:
+ /* do nothing */
+ break;
}
}
--
Fondue Font Editor
More information about the fondue-commits
mailing list