r23546 by jghali - Code style fixes

scribus-commit scribus-commit at lists.scribus.net
Mon Mar 30 22:48:42 UTC 2020


Author: jghali
Date: Mon Mar 30 22:48:42 2020
New Revision: 23546

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

Modified:
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23546&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp	Mon Mar 30 22:48:42 2020
@@ -2943,29 +2943,29 @@
 
 	// check the font file cache
 	id = new SplashOutFontFileID(gfxFont->getID());
-	if ((fontFile = m_fontEngine->getFontFile(id))) {
+	if ((fontFile = m_fontEngine->getFontFile(id)))
 		delete id;
-
-	}
 	else
 	{
 		if (!(fontLoc = gfxFont->locateFont(xref, nullptr)))
 		{
 			error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'",
-			gfxFont->getName() ? gfxFont->getName()->getCString()
-			: "(unnamed)");
+			gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
 			goto err2;
 		}
 
 		// embedded font
-		if (fontLoc->locType == gfxFontLocEmbedded) {
+		if (fontLoc->locType == gfxFontLocEmbedded)
+		{
 			// if there is an embedded font, read it to memory
 			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
 			if (! tmpBuf)
 				goto err2;
 
 			// external font
-		} else { // gfxFontLocExternal
+		}
+		else
+		{ // gfxFontLocExternal
 			fileName = fontLoc->path;
 			fontType = fontLoc->fontType;
 		}
@@ -2982,11 +2982,10 @@
 			if (!(fontFile = m_fontEngine->loadType1Font(
 				id,
 				fontsrc,
-				(const char **)((Gfx8BitFont *)gfxFont)->getEncoding())))
+				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
 			{
 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-				gfxFont->getName() ? gfxFont->getName()->getCString()
-				: "(unnamed)");
+				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
 				goto err2;
 			}
 			break;
@@ -2994,11 +2993,10 @@
 			if (!(fontFile = m_fontEngine->loadType1CFont(
 							id,
 							fontsrc,
-							(const char **)((Gfx8BitFont *)gfxFont)->getEncoding())))
+							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
 			{
 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-				gfxFont->getName() ? gfxFont->getName()->getCString()
-				: "(unnamed)");
+				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
 				goto err2;
 			}
 			break;
@@ -3006,11 +3004,10 @@
 			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
 							id,
 							fontsrc,
-							(const char **)((Gfx8BitFont *)gfxFont)->getEncoding())))
+							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
 			{
 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-				gfxFont->getName() ? gfxFont->getName()->getCString()
-				: "(unnamed)");
+				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
 				goto err2;
 			}
 			break;
@@ -3020,11 +3017,14 @@
 				ff = FoFiTrueType::load(fileName->getCString());
 			else
 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
-			if (ff) {
+			if (ff)
+			{
 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
 				n = 256;
 				delete ff;
-			} else {
+			}
+			else
+			{
 				codeToGID = nullptr;
 				n = 0;
 			}
@@ -3034,8 +3034,7 @@
 							codeToGID, n)))
 			{
 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-				gfxFont->getName() ? gfxFont->getName()->getCString()
-				: "(unnamed)");
+				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
 				goto err2;
 			}
 			break;
@@ -3046,17 +3045,19 @@
 							fontsrc)))
 			{
 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-				gfxFont->getName() ? gfxFont->getName()->getCString()
-				: "(unnamed)");
+				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
 				goto err2;
 			}
 			break;
 		case fontCIDType0COT:
-			if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
-				n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
-				codeToGID = (int *)gmallocn(n, sizeof(*codeToGID));
-				memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(), n * sizeof(*codeToGID));
-			} else {
+			if (((GfxCIDFont *) gfxFont)->getCIDToGID())
+			{
+				n = ((GfxCIDFont *) gfxFont)->getCIDToGIDLen();
+				codeToGID = (int *) gmallocn(n, sizeof(*codeToGID));
+				memcpy(codeToGID, ((GfxCIDFont *) gfxFont)->getCIDToGID(), n * sizeof(*codeToGID));
+			}
+			else
+			{
 				codeToGID = nullptr;
 				n = 0;
 			}
@@ -3066,8 +3067,7 @@
 							codeToGID, n)))
 			{
 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-				gfxFont->getName() ? gfxFont->getName()->getCString()
-				: "(unnamed)");
+				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
 				goto err2;
 			}
 			break;
@@ -3075,13 +3075,17 @@
 		case fontCIDType2OT:
 			codeToGID = nullptr;
 			n = 0;
-			if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
-				n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
-				if (n) {
+			if (((GfxCIDFont *) gfxFont)->getCIDToGID())
+			{
+				n = ((GfxCIDFont *) gfxFont)->getCIDToGIDLen();
+				if (n)
+				{
 					codeToGID = (int *)gmallocn(n, sizeof(*codeToGID));
 					memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(), n * sizeof(*codeToGID));
 				}
-			} else {
+			}
+			else
+			{
 				if (fileName)
 					ff = FoFiTrueType::load(fileName->getCString());
 				else
@@ -3097,8 +3101,7 @@
 							codeToGID, n, faceIndex)))
 			{
 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-				gfxFont->getName() ? gfxFont->getName()->getCString()
-				: "(unnamed)");
+				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
 				goto err2;
 			}
 			break;




More information about the scribus-commit mailing list