r19933 by jghali - code style fixes

scribus-commit scribus-commit at lists.scribus.net
Mon Mar 16 23:42:40 UTC 2015


Author: jghali
Date: Mon Mar 16 23:42:40 2015
New Revision: 19933

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19933
Log:
code style fixes

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19933&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Mon Mar 16 23:42:40 2015
@@ -6783,11 +6783,11 @@
 	int pos = is->getInt("POS");
 	if (isUndo)
 	{
-		itemText.eraseStyle(pos,is->getItem().first);
-		itemText.applyStyle(pos,is->getItem().second);
-	}
-	else
-		itemText.applyStyle(pos,is->getItem().first);
+		itemText.eraseStyle(pos, is->getItem().first);
+		itemText.applyStyle(pos, is->getItem().second);
+	}
+	else
+		itemText.applyStyle(pos, is->getItem().first);
 }
 
 void PageItem::restoreCharStyle(SimpleState *ss, bool isUndo)
@@ -6797,11 +6797,11 @@
 	int start = is->getInt("START");
 	if (isUndo)
 	{
-		itemText.eraseCharStyle(start,length,is->getItem().first);
-		itemText.applyCharStyle(start,length,is->getItem().second);
-	}
-	else
-		itemText.applyCharStyle(start,length,is->getItem().first);
+		itemText.eraseCharStyle(start,length, is->getItem().first);
+		itemText.applyCharStyle(start,length, is->getItem().second);
+	}
+	else
+		itemText.applyCharStyle(start,length, is->getItem().first);
 }
 
 void PageItem::restoreSetCharStyle(SimpleState *ss, bool isUndo)
@@ -6810,9 +6810,9 @@
 	int length = is->getInt("LENGTH");
 	int start = is->getInt("START");
 	if (isUndo)
-		itemText.setCharStyle(start,length,is->getItem().second);
-	else
-		itemText.setCharStyle(start,length,is->getItem().first);
+		itemText.setCharStyle(start,length, is->getItem().second);
+	else
+		itemText.setCharStyle(start,length, is->getItem().first);
 }
 
 void PageItem::restoreSetParagraphStyle(SimpleState *ss, bool isUndo)
@@ -6820,9 +6820,9 @@
 	ScItemState<QPair<ParagraphStyle, ParagraphStyle > > *is = dynamic_cast<ScItemState<QPair<ParagraphStyle, ParagraphStyle> >*>(ss);
 	int pos = is->getInt("POS");
 	if (isUndo)
-		itemText.setStyle(pos,is->getItem().second);
-	else
-		itemText.setStyle(pos,is->getItem().first);
+		itemText.setStyle(pos, is->getItem().second);
+	else
+		itemText.setStyle(pos, is->getItem().first);
 }
 
 void PageItem::restoreDeleteFrameText(SimpleState *ss, bool isUndo)
@@ -6832,14 +6832,14 @@
 	int start = is->getInt("START");
 	if (isUndo)
 	{
-		itemText.insertChars(start,text);
+		itemText.insertChars(start, text);
 		itemText.applyCharStyle(start, text.length(), is->getItem());
 		invalid = true;
 		invalidateLayout();
 	}
 	else
 	{
-		itemText.select(start,text.length());
+		itemText.select(start, text.length());
 		asTextFrame()->deleteSelectedTextFromFrame();
 	}
 	update();
@@ -6852,11 +6852,11 @@
 	if (isUndo)
 	{
 		itemText.deselectAll();
-		itemText.select(start,text.length());
+		itemText.select(start, text.length());
 		asTextFrame()->deleteSelectedTextFromFrame();
 	}
 	else
-		itemText.insertChars(start,text);
+		itemText.insertChars(start, text);
 }
 
 void PageItem::restoreCornerRadius(SimpleState *state, bool isUndo)

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19933&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Mon Mar 16 23:42:40 2015
@@ -9468,9 +9468,9 @@
 
 void ScribusDoc::itemSelection_ApplyCharStyle(const CharStyle & newStyle, Selection* customSelection, QString ETEA)
 {
-	Selection* itemSelection = (customSelection!=0) ? customSelection : m_Selection;
-	assert(itemSelection!=0);
-	uint selectedItemCount=itemSelection->count();
+	Selection* itemSelection = (customSelection != 0) ? customSelection : m_Selection;
+	assert(itemSelection != 0);
+	uint selectedItemCount = itemSelection->count();
 	if (selectedItemCount == 0)
 		return;
 	UndoTransaction activeTransaction;
@@ -9510,7 +9510,7 @@
 			CharStyle lastParent = currItem->itemText.charStyle(start);
 			int stop = start+qMax(0,length);
 			int lastPos = start;
-			for (int i=start; i <= stop; ++i)
+			for (int i = start; i <= stop; ++i)
 			{
 				const CharStyle& curParent(currItem->itemText.charStyle(i));
 				if (!curParent.equiv(lastParent) || i==stop)
@@ -9525,7 +9525,7 @@
 							ss = dynamic_cast<SimpleState*>(ts->last());
 						if (ss && ss->get("ETEA") == ETEA)
 						{
-							for (uint i=0;i<ts->sizet();i++){
+							for (uint i=0; i < ts->sizet(); i++) {
 								is = dynamic_cast<ScItemState<QPair<CharStyle,CharStyle> > *>(ts->at(i));
 								is->setItem(qMakePair(newStyle, is->getItem().second));
 							}
@@ -9534,8 +9534,8 @@
 						{
 							is = new ScItemState<QPair <CharStyle,CharStyle> >(Um::ApplyTextStyle);
 							is->set("APPLY_CHARSTYLE", "apply_charstyle");
-							is->set("START",lastPos);
-							is->set("LENGTH",i-lastPos);
+							is->set("START", lastPos);
+							is->set("LENGTH", i - lastPos);
 							is->set("ETEA", ETEA);
 							is->setItem(qMakePair(newStyle, currItem->itemText.charStyle(lastPos)));
 							undoManager->action(currItem, is);
@@ -9562,7 +9562,7 @@
 			CharStyle lastParent = currItem->itemText.charStyle(0);
 			int stop = currItem->itemText.length();
 			int lastPos = 0;
-			for (int i=0; i <= stop; ++i)
+			for (int i = 0; i <= stop; ++i)
 			{
 				const CharStyle& curParent(currItem->itemText.charStyle(i));
 				if (!curParent.equiv(lastParent) || i==stop)
@@ -9571,8 +9571,8 @@
 					{
 						ScItemState<QPair<CharStyle,CharStyle> > *ist = new ScItemState<QPair <CharStyle,CharStyle> >(Um::ApplyTextStyle);
 						ist->set("APPLY_CHARSTYLE", "apply_charstyle");
-						ist->set("START",lastPos);
-						ist->set("LENGTH",i-lastPos);
+						ist->set("START", lastPos);
+						ist->set("LENGTH", i - lastPos);
 						ist->setItem(qMakePair(newStyle, currItem->itemText.charStyle(lastPos)));
 						undoManager->action(currItem, ist);
 					}




More information about the scribus-commit mailing list