r22964 by jghali - Some refactoring for PropertyWidget_TextColor

scribus-commit scribus-commit at lists.scribus.net
Mon Apr 22 13:53:17 UTC 2019


Author: jghali
Date: Mon Apr 22 13:53:17 2019
New Revision: 22964

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22964
Log:
Some refactoring for PropertyWidget_TextColor

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

Modified: trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22964&path=/trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp	Mon Apr 22 13:53:17 2019
@@ -323,54 +323,51 @@
 
 void PropertyWidget_TextColor::handleOutlineWidth()
 {
+	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
 	int x = qRound(textEffects->OutlineVal->LWidth->value() * 10.0);
-	if ((m_doc) && (m_item))
-	{
-		PageItem *i2 = m_item;
-		if (m_doc->appMode == modeEditTable)
-			i2 = m_item->asTable()->activeCell().textFrame();
-		if (i2 != nullptr)
-		{
-			Selection tempSelection(this, false);
-			tempSelection.addItem(i2, true);
-			m_doc->itemSelection_SetOutlineWidth(x, &tempSelection);
-		}
+	PageItem *i2 = m_item;
+	if (m_doc->appMode == modeEditTable)
+		i2 = m_item->asTable()->activeCell().textFrame();
+	if (i2 != nullptr)
+	{
+		Selection tempSelection(this, false);
+		tempSelection.addItem(i2, true);
+		m_doc->itemSelection_SetOutlineWidth(x, &tempSelection);
 	}
 }
 
 void PropertyWidget_TextColor::handleShadowOffs()
 {
-	if ((m_doc) && (m_item))
-	{
-		int x = qRound(textEffects->ShadowVal->Xoffset->value() * 10.0);
-		int y = qRound(textEffects->ShadowVal->Yoffset->value() * 10.0);
-		PageItem *i2 = m_item;
-		if (m_doc->appMode == modeEditTable)
-			i2 = m_item->asTable()->activeCell().textFrame();
-		if (i2 != nullptr)
-		{
-			Selection tempSelection(this, false);
-			tempSelection.addItem(i2, true);
-			m_doc->itemSelection_SetShadowOffsets(x, y, &tempSelection);
-		}
+	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+	int x = qRound(textEffects->ShadowVal->Xoffset->value() * 10.0);
+	int y = qRound(textEffects->ShadowVal->Yoffset->value() * 10.0);
+	PageItem *i2 = m_item;
+	if (m_doc->appMode == modeEditTable)
+		i2 = m_item->asTable()->activeCell().textFrame();
+	if (i2 != nullptr)
+	{
+		Selection tempSelection(this, false);
+		tempSelection.addItem(i2, true);
+		m_doc->itemSelection_SetShadowOffsets(x, y, &tempSelection);
 	}
 }
 
 void PropertyWidget_TextColor::handleStrikeThru()
 {
-	if ((m_doc) && (m_item))
-	{
-		int x = qRound(textEffects->StrikeVal->LPos->value() * 10.0);
-		int y = qRound(textEffects->StrikeVal->LWidth->value() * 10.0);
-		PageItem *i2 = m_item;
-		if (m_doc->appMode == modeEditTable)
-			i2 = m_item->asTable()->activeCell().textFrame();
-		if (i2 != nullptr)
-		{
-			Selection tempSelection(this, false);
-			tempSelection.addItem(i2, true);
-			m_doc->itemSelection_SetStrikethru(x, y, &tempSelection);
-		}
+	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+	int x = qRound(textEffects->StrikeVal->LPos->value() * 10.0);
+	int y = qRound(textEffects->StrikeVal->LWidth->value() * 10.0);
+	PageItem *i2 = m_item;
+	if (m_doc->appMode == modeEditTable)
+		i2 = m_item->asTable()->activeCell().textFrame();
+	if (i2 != nullptr)
+	{
+		Selection tempSelection(this, false);
+		tempSelection.addItem(i2, true);
+		m_doc->itemSelection_SetStrikethru(x, y, &tempSelection);
 	}
 }
 




More information about the scribus-commit mailing list