r23891 by jghali - Code cleanup

scribus-commit scribus-commit at lists.scribus.net
Mon Jun 15 22:23:07 UTC 2020


Author: jghali
Date: Mon Jun 15 22:23:07 2020
New Revision: 23891

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23891
Log:
Code cleanup

Modified:
    trunk/Scribus/scribus/ui/propertiespalette_text.cpp
    trunk/Scribus/scribus/ui/propertywidget_distance.cpp

Modified: trunk/Scribus/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23891&path=/trunk/Scribus/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_text.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_text.cpp	Mon Jun 15 22:23:07 2020
@@ -388,14 +388,13 @@
 
 void PropertiesPalette_Text::handleLineSpacingMode(int id)
 {
-	if ((m_haveDoc) && (m_haveItem))
-	{
-		Selection tempSelection(this, false);
-		tempSelection.addItem(m_item, true);
-		m_doc->itemSelection_SetLineSpacingMode(id, &tempSelection);
-	//	updateStyle(((m_doc->appMode == modeEdit) || (m_doc->appMode == modeEditTable)) ? m_item->currentStyle() : m_item->itemText.defaultStyle());
-		m_doc->regionsChanged()->update(QRect());
-	}
+	if (!m_haveDoc || !m_haveItem)
+		return;
+	Selection tempSelection(this, false);
+	tempSelection.addItem(m_item, true);
+	m_doc->itemSelection_SetLineSpacingMode(id, &tempSelection);
+//	updateStyle(((m_doc->appMode == modeEdit) || (m_doc->appMode == modeEditTable)) ? m_item->currentStyle() : m_item->itemText.defaultStyle());
+	m_doc->regionsChanged()->update(QRect());
 }
 
 void PropertiesPalette_Text::changeLang(int id)

Modified: trunk/Scribus/scribus/ui/propertywidget_distance.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23891&path=/trunk/Scribus/scribus/ui/propertywidget_distance.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_distance.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_distance.cpp	Mon Jun 15 22:23:07 2020
@@ -368,33 +368,33 @@
 
 void PropertyWidget_Distance::handleTabs()
 {
-	if (m_doc && m_item)
-	{
-		PageItem_TextFrame *tItem = m_item->asTextFrame();
-		if (tItem == nullptr)
-			return;
-		const ParagraphStyle& style(m_doc->appMode == modeEdit ? tItem->currentStyle() : tItem->itemText.defaultStyle());
-		TabManager *dia = new TabManager(this, m_doc->unitIndex(), style.tabValues(), tItem->columnWidth());
-		if (dia->exec())
-		{
-			if (m_doc->appMode != modeEdit)
-			{
-				ParagraphStyle newStyle(m_item->itemText.defaultStyle());
-				newStyle.setTabValues(dia->tabList());
-				Selection tempSelection(this, false);
-				tempSelection.addItem(m_item, true);
-				m_doc->itemSelection_ApplyParagraphStyle(newStyle, &tempSelection);
-			}
-			else
-			{
-				ParagraphStyle newStyle;
-				newStyle.setTabValues(dia->tabList());
-				m_doc->itemSelection_ApplyParagraphStyle(newStyle);
-			}
-			m_item->update();
+	if (!m_doc || !m_item)
+		return;
+
+	PageItem_TextFrame *tItem = m_item->asTextFrame();
+	if (tItem == nullptr)
+		return;
+	const ParagraphStyle& style(m_doc->appMode == modeEdit ? tItem->currentStyle() : tItem->itemText.defaultStyle());
+	TabManager *dia = new TabManager(this, m_doc->unitIndex(), style.tabValues(), tItem->columnWidth());
+	if (dia->exec())
+	{
+		if (m_doc->appMode != modeEdit)
+		{
+			ParagraphStyle newStyle(m_item->itemText.defaultStyle());
+			newStyle.setTabValues(dia->tabList());
+			Selection tempSelection(this, false);
+			tempSelection.addItem(m_item, true);
+			m_doc->itemSelection_ApplyParagraphStyle(newStyle, &tempSelection);
 		}
-		delete dia;
-	}
+		else
+		{
+			ParagraphStyle newStyle;
+			newStyle.setTabValues(dia->tabList());
+			m_doc->itemSelection_ApplyParagraphStyle(newStyle);
+		}
+		m_item->update();
+	}
+	delete dia;
 }
 
 void PropertyWidget_Distance::handleTextDistances()




More information about the scribus-commit mailing list