r15521 by jghali - #6891 : dehyphenating single word resets all hyphenations in linked text frames if word was selected by double click

scribus-commit scribus-commit at lists.scribus.net
Sun Oct 10 21:41:40 CEST 2010


Author: jghali
Date: Sun Oct 10 19:41:40 2010
New Revision: 15521

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15521
Log:
#6891 : dehyphenating single word resets all hyphenations in linked text frames if word was selected by double click

Modified:
    branches/Version135/Scribus/scribus/canvasmode_edit.cpp
    branches/Version135/Scribus/scribus/hyphenator.cpp

Modified: branches/Version135/Scribus/scribus/canvasmode_edit.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15521&path=/branches/Version135/Scribus/scribus/canvasmode_edit.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_edit.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_edit.cpp Sun Oct 10 19:41:40 2010
@@ -384,7 +384,8 @@
 		else
 		{	//Double click in a frame to select a word
 			oldCp = currItem->CPos;
-			currItem->CPos = currItem->itemText.selectWord(currItem->CPos);
+			currItem->CPos   = currItem->itemText.selectWord(currItem->CPos);
+			currItem->HasSel = (currItem->itemText.lengthOfSelection() > 0);
 		}
 	}
 	else

Modified: branches/Version135/Scribus/scribus/hyphenator.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15521&path=/branches/Version135/Scribus/scribus/hyphenator.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/hyphenator.cpp (original)
+++ branches/Version135/Scribus/scribus/hyphenator.cpp Sun Oct 10 19:41:40 2010
@@ -193,7 +193,7 @@
 	QByteArray te;
 
 	int startC = 0;
-	if (it->HasSel)
+	if (it->itemText.lengthOfSelection() > 0)
 	{
 		startC = it->itemText.startOfSelection();
 		text = it->itemText.text(startC, it->itemText.lengthOfSelection());
@@ -401,7 +401,7 @@
 	if (!(it->asTextFrame()) || (it ->itemText.length() == 0))
 		return;
 
-	if (it->HasSel)
+	if (it->itemText.lengthOfSelection() > 0) 
 	{
 //		int start = it->itemText.startOfSelection();
 		it->itemText.hyphenateWord(it->itemText.startOfSelection(), it->itemText.lengthOfSelection(), NULL);




More information about the scribus-commit mailing list