r21922 by jghali - #14745: First letter keeps color from style when black is applied to text

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 16 22:44:13 UTC 2017


Author: jghali
Date: Sun Apr 16 22:44:13 2017
New Revision: 21922

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21922
Log:
#14745: First letter keeps color from style when black is applied to text

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21922&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Sun Apr 16 22:44:13 2017
@@ -1564,6 +1564,7 @@
 			//set style for paragraph effects
 			if (itemText.isBlockStart(a))
 			{
+				// FIXME: we should avoid calling setCharStyle() in layout()
 				if (style.hasDropCap() || style.hasBullet() || style.hasNum())
 				{
 					const QString& curParent(style.hasParent() ? style.parent() : style.name());
@@ -1576,13 +1577,16 @@
 					itemText.setCharStyle(a, 1 , charStyle);
 				}
 				else if (!style.peCharStyleName().isEmpty())
-				//par effect is cleared but is set dcCharStyleName = clear drop cap char style
-				{
-					const QString& curParent(style.hasParent() ? style.parent() : style.name());
-					if (m_Doc->charStyles().contains(style.peCharStyleName()))
-						charStyle.eraseCharStyle(m_Doc->charStyle(style.peCharStyleName()));
-					charStyle.setParent(m_Doc->paragraphStyle(curParent).charStyle().name());
-					itemText.setCharStyle(a, 1,charStyle);
+				{
+					//par effect is cleared but is set dcCharStyleName = clear drop cap char style
+					if (charStyle.parent() == style.peCharStyleName())
+					{
+						const QString& curParent(style.hasParent() ? style.parent() : style.name());
+						if (m_Doc->charStyles().contains(style.peCharStyleName()))
+							charStyle.eraseCharStyle(m_Doc->charStyle(style.peCharStyleName()));
+						charStyle.setParent(m_Doc->paragraphStyle(curParent).charStyle().name());
+						itemText.setCharStyle(a, 1,charStyle);
+					}
 				}
 			}
 




More information about the scribus-commit mailing list