r15009 by jghali - #9037: rename smart hyphens to soft hyphens (also in code)

scribus-commit scribus-commit at lists.scribus.net
Sat Apr 24 00:41:05 CEST 2010


Revision: 15009
Author: jghali
Date: 2010-04-23T22:37:21.214267Z
Commit message: #9037: rename smart hyphens to soft hyphens (also in code)

Changeset: 
M  /trunk/Scribus/scribus/actionmanager.cpp
M  /trunk/Scribus/scribus/pslib.cpp
M  /trunk/Scribus/scribus/text/storytext.cpp
M  /trunk/Scribus/scribus/pageitem_textframe.cpp
M  /trunk/Scribus/scribus/scribus.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
M  /trunk/Scribus/scribus/text/storytext.h
M  /trunk/Scribus/scribus/scribusdoc.cpp
M  /trunk/Scribus/scribus/styles/charstyle.cpp
M  /trunk/Scribus/scribus/ui/storyeditor.cpp
M  /trunk/Scribus/scribus/styles/charstyle.h
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp

Diffs:
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 15008)
+++ scribus/scribusdoc.cpp	(revision 15009)
@@ -3177,7 +3177,7 @@
 				}
 				continue;
 			}
-			if (it->itemText.charStyle(e).effects() & ScStyle_SmartHyphenVisible)
+			if (it->itemText.charStyle(e).effects() & ScStyle_SoftHyphenVisible)
 			{
 				uint gl = it->itemText.charStyle(e).font().char2CMap(QChar('-'));
 				FPointArray gly(it->itemText.charStyle(e).font().glyphOutline(gl));
Index: scribus/actionmanager.cpp
===================================================================
--- scribus/actionmanager.cpp	(revision 15008)
+++ scribus/actionmanager.cpp	(revision 15009)
@@ -873,7 +873,7 @@
 {
 	QString name;
 	//typography
-	name="unicodeSmartHyphen";
+	name="unicodeSoftHyphen";
 	actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::SHYPHEN.unicode(), name));
 	name="unicodeNonBreakingHyphen";
 	actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::NBHYPHEN.unicode(), name));
@@ -984,7 +984,7 @@
 
 	//Spaces and special characters
 
-	*actionNamesList << "unicodeSmartHyphen" << "unicodeNonBreakingHyphen" << "unicodeNonBreakingSpace" << "unicodePageNumber" << "unicodePageCount";
+	*actionNamesList << "unicodeSoftHyphen" << "unicodeNonBreakingHyphen" << "unicodeNonBreakingSpace" << "unicodePageNumber" << "unicodePageCount";
 	*actionNamesList << "unicodeSpaceEN" << "unicodeSpaceEM" << "unicodeSpaceThin" << "unicodeSpaceThick" << "unicodeSpaceMid" << "unicodeSpaceHair";
 	//Breaks
 	*actionNamesList << "unicodeNewLine" << "unicodeFrameBreak" << "unicodeColumnBreak" << "unicodeZerowidthSpace";
@@ -1522,7 +1522,7 @@
 void ActionManager::languageChangeUnicodeActions(QMap<QString, QPointer<ScrAction> > *actionMap)
 {
 	//typography
-	(*actionMap)["unicodeSmartHyphen"]->setText( tr("Smart &Hyphen"));
+	(*actionMap)["unicodeSoftHyphen"]->setText( tr("Soft &Hyphen"));
 	(*actionMap)["unicodeNonBreakingHyphen"]->setText( tr("Non Breaking Dash"));
 	(*actionMap)["unicodeNonBreakingSpace"]->setText( tr("Non Breaking &Space"));
 	(*actionMap)["unicodePageNumber"]->setText( tr("Page &Number"));
@@ -1669,7 +1669,7 @@
 	defKeys.insert("unicodeFrameBreak", Qt::CTRL+Qt::Key_Return);
 	defKeys.insert("unicodeColumnBreak", Qt::CTRL+Qt::SHIFT+Qt::Key_Return);
 
-	defKeys.insert("unicodeSmartHyphen", Qt::CTRL+Qt::SHIFT+Qt::Key_Minus);
+	defKeys.insert("unicodeSoftHyphen", Qt::CTRL+Qt::SHIFT+Qt::Key_Minus);
 	defKeys.insert("unicodeNonBreakingHyphen", Qt::CTRL+Qt::ALT+Qt::Key_Minus);
 	defKeys.insert("unicodeNonBreakingSpace", Qt::CTRL+Qt::Key_Space);
 	defKeys.insert("unicodePageNumber", Qt::CTRL+Qt::SHIFT+Qt::ALT+Qt::Key_P);
@@ -1786,7 +1786,7 @@
 		<< "insertSampleText";
 
 	itmenu->second
-		<< "unicodeSmartHyphen"
+		<< "unicodeSoftHyphen"
 		<< "unicodeNonBreakingHyphen"
 		<< "unicodeNonBreakingSpace"
 		<< "unicodePageNumber"
@@ -1835,7 +1835,7 @@
 		 << "unicodeSpaceHair";
 
 	 itmenu->second
-		 << "unicodeSmartHyphen"
+		 << "unicodeSoftHyphen"
 		 << "unicodeNonBreakingHyphen"
 		 << "unicodeNonBreakingSpace"
 		 << "unicodePageNumber"
@@ -1943,7 +1943,7 @@
 
 	//Unicode
 	++itnmenua;
-	itnmenua->second << "unicodeSmartHyphen";
+	itnmenua->second << "unicodeSoftHyphen";
 	itnmenua->second << "unicodeNonBreakingHyphen";
 	itnmenua->second << "unicodeNonBreakingSpace";
 	itnmenua->second << "unicodePageNumber";
@@ -1989,7 +1989,7 @@
 	itnmenua->second << "unicodeSpaceMid";
 	itnmenua->second << "unicodeSpaceHair";
 
-	itnmenua->second << "unicodeSmartHyphen";
+	itnmenua->second << "unicodeSoftHyphen";
 	itnmenua->second << "unicodeNonBreakingHyphen";
 	itnmenua->second << "unicodeNonBreakingSpace";
 	itnmenua->second << "unicodePageNumber";
Index: scribus/pageitem_textframe.cpp
===================================================================
--- scribus/pageitem_textframe.cpp	(revision 15008)
+++ scribus/pageitem_textframe.cpp	(revision 15009)
@@ -834,7 +834,7 @@
 	if (b >= line.firstItem) 
 	{
 		double chs = itemText.charStyle(b).fontSize() * (itemText.charStyle(b).scaleH() / 1000.0);
-		QChar chr = (itemText.item(b)->effects() & ScStyle_SmartHyphenVisible) ? 
+		QChar chr = (itemText.item(b)->effects() & ScStyle_SoftHyphenVisible) ? 
 			QChar('-') : itemText.text(b);
 		double rightCorr = itemText.charStyle(b).font().realCharWidth(chr, chs / 10.0);
 		if (QString("-,.`´'~").indexOf(chr) >= 0
@@ -1071,7 +1071,7 @@
 			{  // local block for 'fl'
 				StyleFlag fl = hl->effects();
 				fl &= ~ScStyle_DropCap;
-				fl &= ~ScStyle_SmartHyphenVisible;
+				fl &= ~ScStyle_SoftHyphenVisible;
 				hl->setEffects(fl);
 			}
 
@@ -1803,7 +1803,7 @@
 						{
 							// insert hyphen
 							current.hyphenCount++;
-							hl->setEffects(hl->effects() | ScStyle_SmartHyphenVisible);
+							hl->setEffects(hl->effects() | ScStyle_SoftHyphenVisible);
 							hl->glyph.grow();
 							hl->glyph.more->glyph = charStyle.font().char2CMap(QChar('-'));
 							hl->glyph.more->xadvance = charStyle.font().charWidth('-', itemText.charStyle(a).fontSize() / 10.0) * (itemText.charStyle(a).scaleH() / 1000.0);
@@ -1812,7 +1812,7 @@
 						{
 							if (hl->ch != '-')
 								current.hyphenCount = 0;
-							hl->setEffects(hl->effects() & ~ScStyle_SmartHyphenVisible);
+							hl->setEffects(hl->effects() & ~ScStyle_SoftHyphenVisible);
 							hl->glyph.shrink();
 						}
 						
Index: scribus/ui/storyeditor.cpp
===================================================================
--- scribus/ui/storyeditor.cpp	(revision 15008)
+++ scribus/ui/storyeditor.cpp	(revision 15009)
@@ -1704,7 +1704,7 @@
 	seMenuMgr->createMenu("InsertChar", tr("Character"), "Insert");
 	seMenuMgr->addMenuItem(seActions["unicodePageNumber"], "InsertChar", true);
 	seMenuMgr->addMenuItem(seActions["unicodePageCount"], "InsertChar", true);
-	//seMenuMgr->addMenuItem(seActions["unicodeSmartHyphen"], "InsertChar", true);
+	//seMenuMgr->addMenuItem(seActions["unicodeSoftHyphen"], "InsertChar", true);
 	seMenuMgr->addMenuItem(seActions["unicodeNonBreakingHyphen"], "InsertChar", true);
 	seMenuMgr->addMenuSeparator("InsertChar");
 	seMenuMgr->addMenuItem(seActions["unicodeCopyRight"], "InsertChar", true);
@@ -1781,7 +1781,7 @@
 	smartSelection=prefsManager->appPrefs.storyEditorPrefs.smartTextSelection;
 	initActions();
 	ActionManager::initUnicodeActions(&seActions, this, &unicodeCharActionNames);
-	seActions["unicodeSmartHyphen"]->setEnabled(false);//CB TODO doesnt work in SE yet.
+	seActions["unicodeSoftHyphen"]->setEnabled(false);//CB TODO doesnt work in SE yet.
 	buildMenus();
 
 	setWindowIcon(loadIcon("AppIcon.png"));
Index: scribus/styles/charstyle.cpp
===================================================================
--- scribus/styles/charstyle.cpp	(revision 15008)
+++ scribus/styles/charstyle.cpp	(revision 15009)
@@ -233,7 +233,7 @@
 const QString CharStyle::SHADOWED = "shadowed";
 const QString CharStyle::ALLCAPS = "allcaps";
 const QString CharStyle::SMALLCAPS = "smallcaps";
-// This is for loading legacy docs only. Scribus 1.3.4 should write smart hyphens in another way 
+// This is for loading legacy docs only. Scribus 1.3.4 should write soft hyphens in another way 
 static const QString SHYPHEN = "shyphen";
 
 
Index: scribus/styles/charstyle.h
===================================================================
--- scribus/styles/charstyle.h	(revision 15008)
+++ scribus/styles/charstyle.h	(revision 15009)
@@ -30,13 +30,13 @@
     ScStyle_Strikethrough = 16,
     ScStyle_AllCaps       = 32,
     ScStyle_SmallCaps     = 64,
-    ScStyle_HyphenationPossible=128, //Hyphenation possible here (Smart Hyphen)
+    ScStyle_HyphenationPossible=128, //Hyphenation possible here (Soft Hyphen)
     ScStyle_Shadowed      = 256,
     ScStyle_UnderlineWords= 512,
     ScStyle_Reserved01    = 1024, //free, not used in the moment
     ScStyle_DropCap       = 2048,
     ScStyle_SuppressSpace = 4096,//internal use in PageItem (Suppresses spaces when in Block alignment)
-    ScStyle_SmartHyphenVisible=8192, //Smart Hyphen visible at line end
+    ScStyle_SoftHyphenVisible=8192, //Soft Hyphen visible at line end
     ScStyle_StartOfLine   = 16384,
 	ScStyle_UserStyles    = 1919, // == 1024 + 512 + 256 + 64 + 32 + 16 + 8 + 4 + 2 + 1
 	ScStyle_None          = 65535
Index: scribus/text/storytext.cpp
===================================================================
--- scribus/text/storytext.cpp	(revision 15008)
+++ scribus/text/storytext.cpp	(revision 15009)
@@ -202,7 +202,7 @@
 			continue;
 		int len = i - cstyleStart;
 		if (len > 0) {
-			insertCharsWithSmartHyphens(pos, other.textWithSmartHyphens(cstyleStart, len));
+			insertCharsWithSoftHyphens(pos, other.textWithSoftHyphens(cstyleStart, len));
 			applyCharStyle(pos, len, otherDefault.charStyle());
 			applyCharStyle(pos, len, cstyle);
 			pos += len;
@@ -228,7 +228,7 @@
 	}
 	int len = otherEnd - cstyleStart;
 	if (len > 0) {
-		insertCharsWithSmartHyphens(pos, other.textWithSmartHyphens(cstyleStart, len));
+		insertCharsWithSoftHyphens(pos, other.textWithSoftHyphens(cstyleStart, len));
 		applyCharStyle(pos, len, otherDefault.charStyle());
 		applyCharStyle(pos, len, cstyle);
 		pos += len;
@@ -350,7 +350,7 @@
 	invalidate(pos, pos + txt.length());
 }
 
-void StoryText::insertCharsWithSmartHyphens(int pos, QString txt, bool applyNeighbourStyle)
+void StoryText::insertCharsWithSoftHyphens(int pos, QString txt, bool applyNeighbourStyle)
 {
 	if (pos < 0)
 		pos += length()+1;
@@ -494,7 +494,7 @@
 	return result;
 }
 
-QString StoryText::textWithSmartHyphens(int pos, uint len) const
+QString StoryText::textWithSoftHyphens(int pos, uint len) const
 {
 	QString result("");
 	int lastPos = pos;
@@ -1451,7 +1451,7 @@
 			// something new, write pending chars
 			if  (i - lastPos > 0)
 			{
-				handler.chars(textWithSmartHyphens(lastPos, i-lastPos));
+				handler.chars(textWithSoftHyphens(lastPos, i-lastPos));
 			}
 			lastPos = i;
 		}
@@ -1516,7 +1516,7 @@
 	}
 	
 	if  (length() - lastPos > 0)
-		handler.chars(textWithSmartHyphens(lastPos, length()-lastPos));
+		handler.chars(textWithSoftHyphens(lastPos, length()-lastPos));
 	handler.end("span");
 	handler.end("p");
 	
Index: scribus/text/storytext.h
===================================================================
--- scribus/text/storytext.h	(revision 15008)
+++ scribus/text/storytext.h	(revision 15009)
@@ -268,8 +268,8 @@
 	qreal m_magicX;
 	int m_lastMagicPos;
 
-	QString textWithSmartHyphens (int pos, uint len) const;
-	void    insertCharsWithSmartHyphens(int pos, QString txt, bool applyNeighbourStyle = false);
+	QString textWithSoftHyphens (int pos, uint len) const;
+	void    insertCharsWithSoftHyphens(int pos, QString txt, bool applyNeighbourStyle = false);
 	
  	/// mark these runs as invalid, ie. need itemize and shaping
  	void invalidate(int firstRun, int lastRun);
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 15008)
+++ scribus/scribus.cpp	(revision 15009)
@@ -836,7 +836,7 @@
 	scrMenuMgr->createMenu("InsertChar", tr("&Character"), "Insert");
 	scrMenuMgr->addMenuItem(scrActions["unicodePageNumber"], "InsertChar", false);
 	scrMenuMgr->addMenuItem(scrActions["unicodePageCount"], "InsertChar", false);
-	scrMenuMgr->addMenuItem(scrActions["unicodeSmartHyphen"], "InsertChar", false);
+	scrMenuMgr->addMenuItem(scrActions["unicodeSoftHyphen"], "InsertChar", false);
 	scrMenuMgr->addMenuItem(scrActions["unicodeNonBreakingHyphen"], "InsertChar", false);
 	scrMenuMgr->addMenuSeparator("InsertChar");
 	scrMenuMgr->addMenuItem(scrActions["unicodeCopyRight"], "InsertChar", false);
@@ -1150,9 +1150,9 @@
 //						currItem->Tinput = true;
 						currItem->update();
 					}
-					else if (actionName=="unicodeSmartHyphen") //ignore the char as we use an attribute if the text item, for now.
+					else if (actionName=="unicodeSoftHyphen") //ignore the char as we use an attribute if the text item, for now.
 					{
-						// this code is currently dead since unicodeSmartHyphen
+						// this code is currently dead since unicodeSoftHyphen
 						// doesnt have unicodevalue == -1 any more
 						if (currItem->CPos-1>0)
 						{
Index: scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(revision 15008)
+++ scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(revision 15009)
@@ -964,7 +964,7 @@
 
 
 namespace { // anon
-	QString textWithSmartHyphens(StoryText& itemText, int from, int to)
+	QString textWithSoftHyphens(StoryText& itemText, int from, int to)
 	{
 		QString result("");
 		int lastPos = from;
@@ -1021,7 +1021,7 @@
 					putCStylePT(docu, lastStyle);
 				else*/
 					putCStyle(docu, lastStyle);
-				docu.writeAttribute("CH", textWithSmartHyphens(item->itemText, lastPos, k));
+				docu.writeAttribute("CH", textWithSoftHyphens(item->itemText, lastPos, k));
 			}
 			lastStyle = style1;
 			lastPos = k;
@@ -1096,7 +1096,7 @@
 			putCStylePT(docu, lastStyle);
 		else*/
 			putCStyle(docu, lastStyle);
-		docu.writeAttribute("CH", textWithSmartHyphens(item->itemText, lastPos, item->itemText.length()));
+		docu.writeAttribute("CH", textWithSoftHyphens(item->itemText, lastPos, item->itemText.length()));
 	}
 	// paragraphstyle for trailing chars
 	if (item->itemText.length() == 0 || item->itemText.text(item->itemText.length()-1) != SpecialChars::PARSEP)
Index: scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp	(revision 15008)
+++ scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp	(revision 15009)
@@ -940,7 +940,7 @@
 
 
 namespace { // anon
-	QString textWithSmartHyphens(StoryText& itemText, int from, int to)
+	QString textWithSoftHyphens(StoryText& itemText, int from, int to)
 	{
 		QString result("");
 		int lastPos = from;
@@ -997,7 +997,7 @@
 					putCStylePT(docu, lastStyle);
 				else*/
 				putCStyle(docu, lastStyle);
-				docu.writeAttribute("CH", textWithSmartHyphens(item->itemText, lastPos, k));
+				docu.writeAttribute("CH", textWithSoftHyphens(item->itemText, lastPos, k));
 			}
 			lastStyle = style1;
 			lastPos = k;
@@ -1072,7 +1072,7 @@
 			putCStylePT(docu, lastStyle);
 		else*/
 		putCStyle(docu, lastStyle);
-		docu.writeAttribute("CH", textWithSmartHyphens(item->itemText, lastPos, item->itemText.length()));
+		docu.writeAttribute("CH", textWithSoftHyphens(item->itemText, lastPos, item->itemText.length()));
 	}
 	// paragraphstyle for trailing chars
 	if (item->itemText.length() == 0 || item->itemText.text(item->itemText.length()-1) != SpecialChars::PARSEP)
Index: scribus/pslib.cpp
===================================================================
--- scribus/pslib.cpp	(revision 15008)
+++ scribus/pslib.cpp	(revision 15009)
@@ -4480,7 +4480,7 @@
 		// don't let hl2's destructor delete these!
 		hl2.glyph.more = 0;
 	}
-/*	if (cstyle.effects() & ScStyle_SmartHyphenVisible)
+/*	if (cstyle.effects() & ScStyle_SoftHyphenVisible)
 	{
 		int chs = cstyle.fontSize();
 //		double wide = cstyle.font().charWidth(chstr, chs) * (cstyle.scaleH() / 1000.0);




More information about the scribus-commit mailing list