r14314 by jghali - remove dead code is pslib

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 19 23:15:20 CET 2009


Revision: 14314
Author: jghali
Date: 2009-11-19T13:30:55.913752Z
Commit message: remove dead code is pslib

Changeset: 
M  /branches/Version135/Scribus/scribus/pslib.cpp

Diffs:
Index: scribus/pslib.cpp
===================================================================
--- scribus/pslib.cpp	(revision 14313)
+++ scribus/pslib.cpp	(revision 14314)
@@ -3612,348 +3612,6 @@
 
 void PSLib::setTextCh(ScribusDoc* Doc, PageItem* ite, double x, double y, bool gcr, uint argh, uint doh, ScText *hl, const ParagraphStyle& pstyle, Page* pg, bool sep, bool farb, bool ic, bool master)
 {
-#if 0
-//#ifndef NLS_PROTO
-	QString chstr;
-	int h, s, v, k, tsz;
-	double wideR;
-	QList<double> dum;
-	dum.clear();
-	chstr = hl->ch;
-	tsz = hl->fontSize();
-	if (hl->effects() & 2048)
-	{
-		if (pstyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing())
-			tsz = qRound(10 * ((Doc->typographicSettings.valueBaseGrid *  (pstyle.dropCapLines()-1)+(hl->font().ascent(pstyle.charStyle().fontSize() / 10.0))) / (hl->font().realCharHeight(chstr, 10))));
-		else
-		{
-			if (pstyle.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
-				tsz = qRound(10 * ((pstyle.lineSpacing() *  (pstyle.dropCapLines()-1)+(hl->font().ascent(pstyle.charStyle().fontSize() / 10.0))) / (hl->font().realCharHeight(chstr, 10))));
-			else
-			{
-				double currasce = hl->font().height(pstyle.charStyle().fontSize());
-				tsz = qRound(10 * ((currasce * (pstyle.dropCapLines()-1)+(hl->font().ascent(pstyle.charStyle().fontSize() / 10.0))) / hl->font().realCharHeight(chstr, 10)));
-			}
-		}
-	}
-	if ((hl->ch == QChar(25)) && (hl->embedded.hasItem()))
-	{
-		QList<PageItem*> emG = hl->embedded.getGroupedItems();
-
-		for (uint em = 0; em < emG.count(); ++em)
-		{
-			PageItem* embedded = emG.at(em);
-			PS_save();
-			PS_translate(x+hl->glyph.xoffset + embedded->gXpos * (hl->scaleH() / 1000.0), (y+hl->glyph.yoffset - (embedded->gHeight * (hl->scaleV() / 1000.0)) + embedded->gYpos * (hl->scaleV() / 1000.0)) * -1);
-			if (hl->baselineOffset() != 0)
-				PS_translate(0, embedded->gHeight * (hl->baselineOffset() / 1000.0));
-			if (hl->scaleH() != 1000)
-				PS_scale(hl->scaleH() / 1000.0, 1);
-			if (hl->scaleV() != 1000)
-				PS_scale(1, hl->scaleV() / 1000.0);
-			ProcessItem(Doc, pg, embedded, argh, sep, farb, ic, gcr, master, true);
-			PS_restore();
-		}
-		return;
-	}
-	if (hl->ch == QChar(29))
-		chstr = " ";
-	if (hl->ch == QChar(24))
-		chstr = "-";
-	if (hl->ch == QChar(0xA0))
-		chstr = " ";
-	if (hl->ch == QChar(30))
-	{
-		//FIXME Stop duplicating PageItem::ExpandToken code!!!
-		if (Doc->masterPageMode())
-			chstr = "#";
-		else
-		{
-			uint zae = 0;
-			uint za2 = doh;
-			do
-			{
-				if (za2 == 0)
-					break;
-				za2--;
-			}
-			while (ite->itemText.text(za2) == QChar(30));
-			if (ite->itemText.text(za2) != QChar(30))
-				za2++;
-			while (ite->itemText.text(za2+zae) == QChar(30))
-			{
-				zae++;
-				if ( ! ite->frameDisplays(za2+zae) )
-					break;
-			}
-			QString out="%1";
-			QString out2;
-			//CB Section numbering
-			//out2 = out.arg(a+Doc->FirstPnum, -zae);
-			out2=out.arg(Doc->getSectionPageNumberForPageIndex(argh), -(int)zae);
-			chstr = out2.mid(doh-za2, 1);
-		}
-	}
-	if (hl->effects() & 32)
-	{
-		if (chstr.toUpper() != chstr)
-			chstr = chstr.toUpper();
-	}
-	if (hl->effects() & 64)
-	{
-		if (chstr.toUpper() != chstr)
-		{
-			tsz = hl->fontSize() * Doc->typographicSettings.valueSmallCaps / 100;
-			chstr = chstr.toUpper();
-		}
-	}
-	if (hl->effects() & 1)
-		tsz = hl->fontSize() * Doc->typographicSettings.scalingSuperScript / 100;
-	if (hl->effects() & 2)
-		tsz = hl->fontSize() * Doc->typographicSettings.scalingSuperScript / 100;
-	/* Subset all TTF Fonts until the bug in the TTF-Embedding Code is fixed */
-	ScFace::FontType ftype = hl->font().type();
-	if ((ftype == ScFace::TTF) || (hl->font().isOTF()) || (hl->font().subset()))
-	{
-		uint chr = chstr.unicode();
-		if ((hl->font().canRender(chstr)) && (chr != 32))
-		{
-			PS_save();
-			if (ite->reversed())
-			{
-				PS_translate(x+hl->glyph.xoffset, (y+hl->glyph.yoffset - (tsz / 10.0)) * -1);
-				PS_scale(-1, 1);
-				if (ite->frameDisplays(doh+1))
-				{
-					QString ctx = ite->itemText.text(doh+1, 1);
-					if (ctx == QChar(29))
-						ctx = " ";
-					if (ctx == QChar(0xA0))
-						ctx = " ";
-					wideR = - hl->font().charWidth(chstr, tsz, ctx[0]) * (hl->scaleH() / 1000.0);
-				}
-				else
-					wideR = - hl->font().charWidth(chstr, tsz) * (hl->scaleH() / 1000.0);
-				PS_translate(wideR, 0);
-			}
-			else
-				PS_translate(x+hl->glyph.xoffset, (y+hl->glyph.yoffset - (tsz / 10.0)) * -1);
-			if (hl->baselineOffset() != 0)
-				PS_translate(0, (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0));
-			if (hl->scaleH() != 100)
-				PS_scale(hl->scaleH() / 1000.0, 1);
-			if (hl->scaleV() != 100)
-			{
-				PS_translate(0, -((tsz / 10.0) - (tsz / 10.0) * (hl->scaleV() / 1000.0)));
-				PS_scale(1, hl->scaleV() / 1000.0);
-			}
-			if (hl->fillColor() != CommonStrings::None)
-			{
-				SetColor(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
-				PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
-				if ((colorsToUse[hl->fillColor()].isSpotColor()) && (!DoSep))
-					PutStream(ToStr(hl->fillShade() / 100.0)+" "+spotMap[hl->fillColor()]);
-				else
-					PutStream(FillColor + " cmyk");
-						PS_showSub(chr, FontSubsetMap[hl->font().scName()], tsz / 10.0, false);
-			}
-			PS_restore();
-		}
-	}
-	else
-	{
-		PS_selectfont(hl->font().replacementName(), tsz / 10.0);
-		PS_save();
-		PS_translate(x+hl->glyph.xoffset, -y-hl->glyph.yoffset);
-		if (ite->reversed())
-		{
-			int chs = hl->fontSize();
-			GlyphLayout dummy;
-			ite->layoutGlyphs(*hl, chstr, dummy);
-			// chs = ??? FIXME
-			PS_scale(-1, 1);
-			if (ite->frameDisplays(doh+1))
-			{
-				QString ctx = ite->itemText.text(doh+1, 1);
-				if (ctx[0] == QChar(29))
-					ctx = " ";
-				if (ctx[0] == QChar(0xA0))
-					ctx = " ";
-				wideR = - hl->font().charWidth(chstr, chs, ctx[0]) * (hl->scaleH() / 1000.0);
-				PS_translate(wideR, 0);
-			}
-			else
-			{
-				wideR = -hl->font().charWidth(chstr, chs) * (hl->scaleH() / 1000.0);
-				PS_translate(wideR, 0);
-			}
-		}
-		if (hl->baselineOffset() != 0)
-			PS_translate(0, (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0));
-		if (hl->scaleH() != 1000)
-			PS_scale(hl->scaleH() / 1000.0, 1);
-		if (hl->scaleV() != 1000)
-			PS_scale(1, hl->scaleV() / 1000.0);
-		if (hl->fillColor() != CommonStrings::None)
-		{
-			SetColor(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
-			PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
-			if ((colorsToUse[hl->fillColor()].isSpotColor()) && (!DoSep))
-			{
-				PutStream(ToStr(hl->fillShade() / 100.0)+" "+spotMap[hl->fillColor()]);
-				PS_show_xyG(hl->font().replacementName(), chstr, 0, 0, true);
-			}
-			else
-				PS_show_xyG(hl->font().replacementName(), chstr, 0, 0, false);
-		}
-		PS_restore();
-	}
-	if ((hl->effects() & 4) && (chstr != QChar(13)))
-	{
-		if (hl->font().canRender(chstr))
-		{
-			uint gl = hl->font().char2CMap(chstr);
-			FPointArray gly = hl->font().glyphOutline(gl);
-			QMatrix chma, chma2, chma3;
-			chma.scale(tsz / 100.0, tsz / 100.0);
-			chma2.scale(hl->scaleH() / 1000.0, hl->scaleV() / 1000.0);
-			if (hl->baselineOffset() != 0)
-				chma3.translate(0, -(hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0));
-			gly.map(chma * chma2 * chma3);
-			if (ite->reversed())
-			{
-				chma = QMatrix();
-				chma.scale(-1, 1);
-				chma.translate(wideR, 0);
-				gly.map(chma);
-			}
-			if ((hl->strokeColor() != CommonStrings::None) && ((tsz * hl->outlineWidth() / 10000.0) != 0))
-			{
-				PS_save();
-				PS_setlinewidth(tsz * hl->outlineWidth() / 10000.0);
-				PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
-				PS_setdash(Qt::SolidLine, 0, dum);
-				PS_translate(x+hl->glyph.xoffset, (y+hl->glyph.yoffset - (tsz / 10.0)) * -1);
-				if (hl->scaleV() != 1000)
-					PS_translate(0, -((tsz / 10.0) - (tsz / 10.0) * (hl->scaleV() / 1000.0)));
-				SetColor(hl->strokeColor(), hl->strokeShade(), &h, &s, &v, &k, gcr);
-				PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
-				SetClipPath(&gly);
-				PS_closepath();
-				putColor(hl->strokeColor(), hl->strokeShade(), false);
-				PS_restore();
-			}
-		}
-	}
-	if ((hl->effects() & 16) && (chstr != QChar(13)))
-	{
-		double Ulen = hl->font().charWidth(chstr, hl->fontSize()) * (hl->scaleH() / 1000.0);
-		double Upos, lw, kern;
-		if (hl->effects() & 16384)
-			kern = 0;
-		else
-			kern = hl->fontSize() * hl->tracking() / 10000.0;
-		if ((hl->strikethruOffset() != -1) || (hl->strikethruWidth() != -1))
-		{
-			if (hl->strikethruOffset() != -1)
-				Upos = (hl->strikethruOffset() / 1000.0) * (hl->font().ascent(hl->fontSize() / 10.0));
-			else
-				Upos = hl->font().strikeoutPos(hl->fontSize() / 10.0);
-			if (hl->strikethruWidth() != -1)
-				lw = (hl->strikethruWidth() / 1000.0) * (hl->fontSize() / 10.0);
-			else
-				lw = qMax(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
-		}
-		else
-		{
-			Upos = hl->font().strikeoutPos(hl->fontSize() / 10.0);
-			lw = qMax(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
-		}
-		if (hl->baselineOffset() != 0)
-			Upos += (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0);
-		if (hl->fillColor() != CommonStrings::None)
-		{
-			PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
-			PS_setdash(Qt::SolidLine, 0, dum);
-			SetColor(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
-			PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
-		}
-		PS_setlinewidth(lw);
-		PS_moveto(x+hl->glyph.xoffset-kern, -y-hl->glyph.yoffset+Upos);
-		PS_lineto(x+hl->glyph.xoffset+Ulen, -y-hl->glyph.yoffset+Upos);
-		putColor(hl->fillColor(), hl->fillShade(), false);
-	}
-	if (((hl->effects() & 8) && (chstr != QChar(13)))  || ((hl->effects() & 512) && (!chstr.isSpace())))
-	{
-		double Ulen = hl->font().charWidth(chstr, hl->fontSize()) * (hl->scaleH() / 1000.0);
-		double Upos, lw, kern;
-		if (hl->effects() & 16384)
-			kern = 0;
-		else
-			kern = hl->fontSize() * hl->tracking() / 10000.0;
-		if ((hl->underlineOffset() != -1) || (hl->underlineWidth() != -1))
-		{
-			if (hl->underlineOffset() != -1)
-				Upos = (hl->underlineOffset() / 1000.0) * (hl->font().descent(hl->fontSize() / 10.0));
-			else
-				Upos = hl->font().underlinePos(hl->fontSize() / 10.0);
-			if (hl->underlineWidth() != -1)
-				lw = (hl->underlineWidth() / 1000.0) * (hl->fontSize() / 10.0);
-			else
-				lw = qMax(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
-		}
-		else
-		{
-			Upos = hl->font().underlinePos(hl->fontSize() / 10.0);
-			lw = qMax(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
-		}
-		if (hl->baselineOffset() != 0)
-			Upos += (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0);
-		if (hl->fillColor() != CommonStrings::None)
-		{
-			PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
-			PS_setdash(Qt::SolidLine, 0, dum);
-			SetColor(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
-			PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
-		}
-		PS_setlinewidth(lw);
-		PS_moveto(x+hl->glyph.xoffset-kern, -y-hl->glyph.yoffset+Upos);
-		PS_lineto(x+hl->glyph.xoffset+Ulen, -y-hl->glyph.yoffset+Upos);
-		putColor(hl->fillColor(), hl->fillShade(), false);
-	}
-	if (hl->effects() & 8192)
-	{
-		int chs = hl->fontSize();
-		GlyphLayout dummy;
-		ite->layoutGlyphs(*hl, chstr, dummy);
-		// chs = ???
-		double wide = hl->font().charWidth(chstr, chs) * (hl->scaleH() / 1000.0);
-		chstr = "-";
-		if (hl->font().canRender(chstr))
-		{
-			uint gl = hl->font().char2CMap(chstr);
-			FPointArray gly = hl->font().glyphOutline(gl);
-			QMatrix chma;
-			chma.scale(tsz / 100.0, tsz / 100.0);
-			gly.map(chma);
-			chma = QMatrix();
-			chma.scale(hl->scaleH() / 1000.0, hl->scaleV() / 1000.0);
-			gly.map(chma);
-			if (hl->fillColor() != CommonStrings::None)
-			{
-				PS_save();
-				PS_newpath();
-				PS_translate(x + hl->glyph.xoffset+wide, (y + hl->glyph.yoffset - (tsz / 10.0)) * -1);
-				SetColor(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
-				PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
-				SetClipPath(&gly);
-				PS_closepath();
-				putColor(hl->fillColor(), hl->fillShade(), true);
-				PS_restore();
-			}
-		}
-	}
-#else
 	const CharStyle & cstyle(*hl);
 	const GlyphLayout & glyphs(hl->glyph);
 	uint glyph = glyphs.glyph;
@@ -4323,7 +3981,6 @@
 			}
 		}
 	}*/
-#endif
 }
 
 void PSLib::putColor(const QString& color, double shade, bool fill)




More information about the scribus-commit mailing list