r23048 by jghali - Refactor PageItem_TextFrame::setShadow()

scribus-commit scribus-commit at lists.scribus.net
Sat Jun 22 12:34:22 UTC 2019


Author: jghali
Date: Sat Jun 22 12:34:21 2019
New Revision: 23048

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23048
Log:
Refactor PageItem_TextFrame::setShadow()

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23048&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Sat Jun 22 12:34:21 2019
@@ -211,31 +211,36 @@
 		return;
 
 	QString newShadow = m_Doc->masterPageMode() ? OnMasterPage : QString::number(OwnPage);
-	if (newShadow != m_currentShadow) {
-		if (m_currentShadow == OnMasterPage) {
-			// masterpage was edited, clear all shadows
-			m_shadows.clear();
-		}
-		if (!m_shadows.contains(newShadow)) {
-			if (!m_shadows.contains(OnMasterPage)) {
-				m_shadows[OnMasterPage] = itemText;
-//				const ParagraphStyle& pstyle(shadows[OnMasterPage].paragraphStyle(0));
-//				qDebug() << QString("Pageitem_Textframe: style of master: %1 align=%2").arg(pstyle.parent()).arg(pstyle.alignment());
-//				qDebug() << QString("Pageitem_Textframe: shadow itemText->%1").arg(OnMasterPage);
-			}
-			if (newShadow != OnMasterPage) {
-				m_shadows[newShadow] = m_shadows[OnMasterPage].copy();
-//				const ParagraphStyle& pstyle(shadows[newShadow].paragraphStyle(0));
-//				qDebug() << QString("Pageitem_Textframe: style of shadow copy: %1 align=%2").arg(pstyle.parent()).arg(pstyle.alignment());
-			}
-//			qDebug() << QString("Pageitem_Textframe: shadow %1<-%2").arg(newShadow).arg(OnMasterPage);
-		}
-		itemText = m_shadows[newShadow];
-//		const ParagraphStyle& pstyle(itemText.paragraphStyle(0));
-//		qDebug() << QString("Pageitem_Textframe: style of shadow: %1 align=%2").arg(pstyle.parent()).arg(pstyle.alignment());
-		invalid = true;
-		m_currentShadow = newShadow;
-	}
+	if (newShadow == m_currentShadow)
+		return;
+
+	if (m_currentShadow == OnMasterPage)
+	{
+		// masterpage was edited, clear all shadows
+		m_shadows.clear();
+	}
+	if (!m_shadows.contains(newShadow))
+	{
+		if (!m_shadows.contains(OnMasterPage))
+		{
+			m_shadows[OnMasterPage] = itemText;
+//			const ParagraphStyle& pstyle(shadows[OnMasterPage].paragraphStyle(0));
+//			qDebug() << QString("Pageitem_Textframe: style of master: %1 align=%2").arg(pstyle.parent()).arg(pstyle.alignment());
+//			qDebug() << QString("Pageitem_Textframe: shadow itemText->%1").arg(OnMasterPage);
+		}
+		if (newShadow != OnMasterPage)
+		{
+			m_shadows[newShadow] = m_shadows[OnMasterPage].copy();
+//			const ParagraphStyle& pstyle(shadows[newShadow].paragraphStyle(0));
+//			qDebug() << QString("Pageitem_Textframe: style of shadow copy: %1 align=%2").arg(pstyle.parent()).arg(pstyle.alignment());
+		}
+//		qDebug() << QString("Pageitem_Textframe: shadow %1<-%2").arg(newShadow).arg(OnMasterPage);
+	}
+	itemText = m_shadows[newShadow];
+//	const ParagraphStyle& pstyle(itemText.paragraphStyle(0));
+//	qDebug() << QString("Pageitem_Textframe: style of shadow: %1 align=%2").arg(pstyle.parent()).arg(pstyle.alignment());
+	invalid = true;
+	m_currentShadow = newShadow;
 }
 /*
 static void debugLineLayout(const StoryText& itemText, const LineSpec& line)




More information about the scribus-commit mailing list