r23666 by jghali - Refactor ScColorSpaceData::convert()

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 26 21:46:44 UTC 2020


Author: jghali
Date: Sun Apr 26 21:46:44 2020
New Revision: 23666

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23666
Log:
Refactor ScColorSpaceData::convert()

Modified:
    trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp

Modified: trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23666&path=/trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp	Sun Apr 26 21:46:44 2020
@@ -66,18 +66,16 @@
 		transform = *lastTrans;
 	if (!transform)
 		transform = createTransform(data, renderIntent, transformFlags);
+	if (!transform)
+		return false;
 
-	bool success = false;
-	if (transform)
+	bool success = transform.apply(dataIn, dataOut, numElems);
+	if (success)
 	{
-		success = transform.apply(dataIn, dataOut, numElems);
-		if (success)
-		{
-			if (!this->hasAlphaChannel() && data.hasAlphaChannel())
-				data.flattenAlpha(dataOut, numElems);
-			if (lastTrans && (transform != *lastTrans))
-				*lastTrans = transform;
-		}
+		if (!this->hasAlphaChannel() && data.hasAlphaChannel())
+			data.flattenAlpha(dataOut, numElems);
+		if (lastTrans && (transform != *lastTrans))
+			*lastTrans = transform;
 	}
 	return success;
 }




More information about the scribus-commit mailing list