r21298 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Sat May 7 22:15:33 UTC 2016


Author: jghali
Date: Sat May  7 22:15:33 2016
New Revision: 21298

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21298
Log:
#14002: Shortcut CTRL-D delete two characters instead of one in Story Editor

Modified:
    trunk/Scribus/scribus/ui/storyeditor.cpp

Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21298&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp	(original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp	Sat May  7 22:15:33 2016
@@ -332,23 +332,15 @@
 void SEditor::keyPressEvent(QKeyEvent *k)
 {
 	emit SideBarUp(false);
-// 	int pos = textCursor().position();
-	int keyMod=0;
-	if (k->modifiers() & Qt::ShiftModifier)
-		keyMod |= Qt::SHIFT;
-	if (k->modifiers() & Qt::ControlModifier)
-		keyMod |= Qt::CTRL;
-	if (k->modifiers() & Qt::AltModifier)
-		keyMod |= Qt::ALT;
-
-	if(ScCore->primaryMainWindow()->actionManager->compareKeySeqToShortcut(k->key(), k->modifiers(), "specialUnicodeSequenceBegin"))
+
+	if (ScCore->primaryMainWindow()->actionManager->compareKeySeqToShortcut(k->key(), k->modifiers(), "specialUnicodeSequenceBegin"))
 	{
 		unicodeTextEditMode = true;
 		unicodeInputCount = 0;
 		unicodeInputString = "";
 		return;
 	}
-
+	
 	QString uc = k->text();
 	if ((k->modifiers() == Qt::ControlModifier) ||
 		(k->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) ||
@@ -356,33 +348,34 @@
 		(k->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier | Qt::KeypadModifier))
 	   )
 	{
+		bool processed = false;
 		switch (k->key())
 		{
 			case Qt::Key_K:
 				moveCursor(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
 				textCursor().removeSelectedText();
+				processed = true;
 				break;
 			case Qt::Key_D:
 				moveCursor(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
 				textCursor().removeSelectedText();
+				processed = true;
 				break;
 			case Qt::Key_H:
 				moveCursor(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor);
 				textCursor().removeSelectedText();
+				processed = true;
 				break;
-			/*case Qt::Key_X:
-				cut();
-				return;
-				break;
-			case Qt::Key_V:
-				paste();
-				return;
-				break;*/
 			case Qt::Key_Y:
 			case Qt::Key_Z:
 				emit SideBarUp(true);
 				return;
-				break;
+		}
+		if (processed)
+		{
+			emit SideBarUp(true);
+			emit SideBarUpdate();
+			return;
 		}
 	}
 	if ((k->modifiers() == Qt::NoModifier) ||




More information about the scribus-commit mailing list