r20632 by fschmid -

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 29 09:02:06 UTC 2015


Author: fschmid
Date: Tue Dec 29 09:02:06 2015
New Revision: 20632

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20632
Log:
Fixed Bug #8427: Coloured background in a Paragraph or Character style.
Only need a good place for a "Paragraph Background" control. This is currently
only available in the paragraph style definition dialog.

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
    trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/plugins/gettext/docxim/docxim.cpp
    trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
    trunk/Scribus/scribus/plugins/import/odg/importodg.h
    trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
    trunk/Scribus/scribus/plugins/import/pages/importpages.h
    trunk/Scribus/scribus/pslib.cpp
    trunk/Scribus/scribus/sccolorengine.cpp
    trunk/Scribus/scribus/scribuscore.cpp
    trunk/Scribus/scribus/scribuscore.h
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/styles/charstyle.attrdefs.cxx
    trunk/Scribus/scribus/styles/charstyle.cpp
    trunk/Scribus/scribus/styles/paragraphstyle.attrdefs.cxx
    trunk/Scribus/scribus/text/textlayout.h
    trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h
    trunk/Scribus/scribus/third_party/rtf-qt/DocumentDestination.cpp
    trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
    trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h
    trunk/Scribus/scribus/ui/propertywidget_pareffect.h
    trunk/Scribus/scribus/ui/propertywidget_pareffectbase.ui
    trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
    trunk/Scribus/scribus/ui/propertywidget_textcolor.h
    trunk/Scribus/scribus/ui/propertywidget_textcolorbase.ui
    trunk/Scribus/scribus/ui/smcstylewidget.cpp
    trunk/Scribus/scribus/ui/smcstylewidget.ui
    trunk/Scribus/scribus/ui/smpstylewidget.cpp
    trunk/Scribus/scribus/ui/smpstylewidget.h
    trunk/Scribus/scribus/ui/smpstylewidget.ui
    trunk/Scribus/scribus/ui/smtextstyles.cpp
    trunk/Scribus/scribus/ui/smtextstyles.h

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Tue Dec 29 09:02:06 2015
@@ -540,6 +540,7 @@
 		line.width = 0.0;
 		line.naturalWidth = 0.0;
 		line.colLeft = colLeft;
+		line.isFirstLine = false;
 		breakIndex = -1;
 		breakXPos = 0.0;
 		maxShrink = 0.0;
@@ -828,9 +829,10 @@
 
 	void updateHeightMetrics(const StoryText& itemText)
 	{
-		double asce, desc;
+		double asce, desc, hei;
 		line.ascent  = 0;
 		line.descent = 0;
+		line.height = 0;
 		for (int zc = 0; zc < itemsInLine; ++zc)
 		{
 			QChar ch = itemText.text(line.firstItem+zc);
@@ -845,15 +847,18 @@
 			{
 				asce = (itemText.object(line.firstItem+zc)->height() + itemText.object(line.firstItem+zc)->lineWidth()) * scaleV + offset;
 				desc = 0.0;
+				hei = asce;
 			}
 			else //if ((itemText.flags(current.line.firstItem+zc) & ScLayout_DropCap) == 0)
 			{
 				asce = cStyle.font().realCharAscent(ch, cStyle.fontSize() / 10.0) * scaleV + offset;
 				desc = cStyle.font().realCharDescent(ch, cStyle.fontSize() / 10.0) * scaleV - offset;
+				hei = cStyle.font().height(cStyle.fontSize() / 10.0) * scaleV;
 			}
 			//	qDebug() << QString("checking char 'x%2' with ascender %1 > %3").arg(asce).arg(ch.unicode()).arg(result);
 			line.ascent  = qMax(line.ascent, asce);
 			line.descent = qMax(line.descent, desc);
+			line.height = qMax(line.height, hei);
 		}
 	}
 
@@ -1680,6 +1685,7 @@
 					}
 					else
 						DropCmode = false;
+					current.line.isFirstLine = true;
 				}
 			}
 
@@ -1748,6 +1754,7 @@
 						DropCapDrop = calculateLineSpacing (style, this) * (DropLines - 1);
 //						qDebug() << QString("dropcapdrop: y=%1+%2").arg(current.yPos).arg(DropCapDrop);
 					}
+					current.line.isFirstLine = true;
 				}
 			}
 			// find charsize factors
@@ -3687,11 +3694,51 @@
 		assert( firstInFrame() >= 0 );
 		assert( lastInFrame() < itemText.length() );
 		LineSpec ls;
+
+		for (uint ll = 0; ll < textLayout.lines(); ++ll)
+		{
+			ls = textLayout.line(ll);
+			const ParagraphStyle& LineStyle = itemText.paragraphStyle(ls.firstItem);
+			// This code is for rendering paragraph background color.
+			// We just need to define this attribute for the paragraphs now.
+			if ((!m_Doc->RePos) && (LineStyle.backgroundColor() != CommonStrings::None))
+			{
+				p->save();
+				p->setFillMode(1);
+				QColor tmp;
+				SetQColor(&tmp, LineStyle.backgroundColor(), LineStyle.backgroundShade());
+				p->setPen(tmp, 0, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin);
+				p->setBrush(tmp);
+				double y1 = ls.y;
+				double hl = ls.height;
+				double adjX = 0;
+				if (LineStyle.firstIndent() <= 0)
+					adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
+				if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+					hl = doc()->guidesPrefs().valueBaselineGrid;
+				if (ls.isFirstLine)
+				{
+					if (textLayout.lines() == 1)
+						hl = ls.ascent + ls.descent;
+					if (LineStyle.hasDropCap())
+						hl *= LineStyle.dropCapLines();
+				}
+				if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+					y1 -= LineStyle.lineSpacing();
+				else if (firstLineOffset() == FLOPRealGlyphHeight || firstLineOffset() == FLOPFontAscent)
+					y1 -= ls.ascent;
+				else
+					y1 -= LineStyle.lineSpacing();
+				p->drawRect(ls.colLeft + adjX, y1, columnWidth() - adjX - LineStyle.rightMargin(), hl);
+				p->restore();
+			}
+			// end background code
+		}
+
 		for (uint ll=0; ll < textLayout.lines(); ++ll)
 		{
 			ls = textLayout.line(ll);
 			double CurX = ls.x;
-
 			// Draw text selection rectangles
 			QRectF selectedFrame;
 			QList<QRectF> sFList;
@@ -3776,12 +3823,96 @@
 			//	End of selection
 
 			QColor tmp;
+			double CurXB = ls.x;
+			QRectF scrG;
+			QString oldBack = "";
+			double oldShade = 100;
+			for (int a = ls.firstItem; a <= last; ++a)
+			{
+				glyphs = itemText.getGlyphs(a);
+				const CharStyle& charStyle(itemText.charStyle(a));
+				if ((!m_Doc->RePos) && (charStyle.backgroundColor() != CommonStrings::None))
+				{
+					SetQColor(&tmp, charStyle.backgroundColor(), charStyle.backgroundShade());
+					const ParagraphStyle& LineStyle = itemText.paragraphStyle(ls.firstItem);
+					double y1 = ls.y;
+					double hl = ls.height;
+					if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+						hl = doc()->guidesPrefs().valueBaselineGrid;
+					else if (LineStyle.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
+						hl = LineStyle.lineSpacing();
+					if (ls.isFirstLine)
+					{
+						if (textLayout.lines() == 1)
+							hl = ls.ascent + ls.descent;
+						if (LineStyle.hasDropCap() && (a == ls.firstItem))
+							hl *= LineStyle.dropCapLines();
+						if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+							y1 -= LineStyle.lineSpacing();
+						else if (firstLineOffset() == FLOPRealGlyphHeight || firstLineOffset() == FLOPFontAscent)
+							y1 -= ls.ascent;
+						else
+							y1 -= LineStyle.lineSpacing();
+					}
+					else
+						y1 -= ls.ascent + (hl - (ls.ascent + ls.descent)) / 2.0;
+					QRectF scr;
+					if (itemText.hasObject(a))
+					{
+						PageItem* obj = itemText.object(a);
+						double ww = (obj->width() + obj->lineWidth()) * glyphs->scaleH;
+						double hh = (obj->height() + obj->lineWidth()) * glyphs->scaleV;
+						scr = QRectF(CurXB, ls.y - hh, ww , hh);
+					}
+					else
+						scr = QRectF(CurXB, y1, glyphs->wide(), hl);
+					if ((oldBack == "") || ((oldBack == charStyle.backgroundColor()) && (oldShade == charStyle.backgroundShade())))
+						scrG |= scr;
+					else if ((oldBack != charStyle.backgroundColor()) || (oldShade != charStyle.backgroundShade()))
+					{
+						p->save();
+						p->setFillMode(1);
+						p->setStrokeMode(0);
+						SetQColor(&tmp, oldBack, oldShade);
+						p->setBrush(tmp);
+						p->drawRect(scrG.x(), scrG.y(), scrG.width(), scrG.height());
+						p->restore();
+						scrG = scr;
+					}
+					oldBack = charStyle.backgroundColor();
+					oldShade = charStyle.backgroundShade();
+				}
+				else
+				{
+					oldBack = "";
+					oldShade = 100;
+					if (!scrG.isNull())
+					{
+						p->save();
+						p->setFillMode(1);
+						p->setStrokeMode(0);
+						p->setBrush(tmp);
+						p->drawRect(scrG.x(), scrG.y(), scrG.width(), scrG.height());
+						p->restore();
+					}
+					scrG = QRectF();
+				}
+				CurXB += glyphs->wide();
+			}
+			if (!scrG.isNull())
+			{
+				p->save();
+				p->setFillMode(1);
+				p->setStrokeMode(0);
+				p->setBrush(tmp);
+				p->drawRect(scrG.x(), scrG.y(), scrG.width(), scrG.height());
+				p->restore();
+			}
 			for (int a = ls.firstItem; a <= last; ++a)
 			{
 				glyphs = itemText.getGlyphs(a);
 				const CharStyle& charStyle(itemText.charStyle(a));
 				bool selected = itemText.selected(a);
-
 				actFill = charStyle.fillColor();
 				actFillShade = charStyle.fillShade();
 				if (actFill != CommonStrings::None)

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp	(original)
+++ trunk/Scribus/scribus/pdflib_core.cpp	Tue Dec 29 09:02:06 2015
@@ -2838,6 +2838,8 @@
 					case PageItem::Multiple:
 						Q_ASSERT(false);
 						break;
+					default:
+						break;
 				}
 				PutPage("Q\n");
 				PdfId templateObject = writer.newObject();
@@ -4925,6 +4927,8 @@
 		case PageItem::Multiple:
 			Q_ASSERT(false);
 			break;
+		default:
+			break;
 	}
 	tmp += "Q\n";
 	output = tmp;
@@ -5378,11 +5382,144 @@
 		straightPath.PRot = 0;
 		straightPath.PDx = 0;
 		tmp += "BT\n";
+		for (uint ll = 0; ll < ite->textLayout.lines(); ++ll)
+		{
+			LineSpec ls = ite->textLayout.line(ll);
+			const ParagraphStyle& LineStyle = ite->itemText.paragraphStyle(ls.firstItem);
+			// This code is for rendering paragraph background color.
+			// We just need to define this attribute for the paragraphs now.
+			if (LineStyle.backgroundColor() != CommonStrings::None)
+			{
+				double y1 = ls.y;
+				double hl = ls.height;
+				double adjX = 0;
+				if (LineStyle.firstIndent() <= 0)
+					adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
+				if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+					hl = doc.guidesPrefs().valueBaselineGrid;
+				if (ls.isFirstLine)
+				{
+					if (ite->textLayout.lines() == 1)
+						hl = ls.ascent + ls.descent;
+					if (LineStyle.hasDropCap())
+						hl *= LineStyle.dropCapLines();
+				}
+				if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+					y1 -= LineStyle.lineSpacing();
+				else if (ite->firstLineOffset() == FLOPRealGlyphHeight || ite->firstLineOffset() == FLOPFontAscent)
+					y1 -= ls.ascent;
+				else
+					y1 -= LineStyle.lineSpacing();
+				QRectF scr(ls.colLeft + adjX, y1, ite->asTextFrame()->columnWidth() - adjX - LineStyle.rightMargin(), hl);
+				tmp += "q\n";
+				tmp += putColor(LineStyle.backgroundColor(), LineStyle.backgroundShade(), true);
+				tmp += FToStr(scr.x())     +" "+FToStr(-scr.y())+" m\n";
+				tmp += FToStr(scr.x() + scr.width())+" "+FToStr(-scr.y())+" l\n";
+				tmp += FToStr(scr.x() + scr.width())+" "+FToStr(-scr.y() - scr.height())+" l\n";
+				tmp += FToStr(scr.x())+" "+FToStr(-scr.y() - scr.height())+" l\n";
+				tmp += "h\nf*\n";
+				tmp += "Q\n";
+			}
+			// end background code
+		}
 		for (uint ll=0; ll < ite->textLayout.lines(); ++ll)
 		{
 			LineSpec ls = ite->textLayout.line(ll);
 			tabDist = ls.x;
 			double CurX = ls.x;
+			double CurXB = ls.x;
+			int last = qMin(ls.lastItem, ite->itemText.length() - 1);
+			QRectF scr;
+			QString oldBack = "";
+			double oldShade = 100;
+			QByteArray colorB = "";
+			for (int a = ls.firstItem; a <= last; ++a)
+			{
+				const GlyphLayout* glyphs(ite->itemText.getGlyphs(a));
+				const CharStyle& charStyle(ite->itemText.charStyle(a));
+				if (charStyle.backgroundColor() != CommonStrings::None)
+				{
+					colorB += putColor(charStyle.backgroundColor(), charStyle.backgroundShade(), true);
+				// This code is for rendering character background color.
+					const ParagraphStyle& LineStyle = ite->itemText.paragraphStyle(ls.firstItem);
+					double y1 = ls.y;
+					double hl = ls.height;
+					if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+						hl = doc.guidesPrefs().valueBaselineGrid;
+					else if (LineStyle.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
+						hl = LineStyle.lineSpacing();
+					if (ls.isFirstLine)
+					{
+						if (ite->textLayout.lines() == 1)
+							hl = ls.ascent + ls.descent;
+						if (LineStyle.hasDropCap() && (a == ls.firstItem))
+							hl *= LineStyle.dropCapLines();
+						if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+							y1 -= LineStyle.lineSpacing();
+						else if (ite->firstLineOffset() == FLOPRealGlyphHeight || ite->firstLineOffset() == FLOPFontAscent)
+							y1 -= ls.ascent;
+						else
+							y1 -= LineStyle.lineSpacing();
+					}
+					else
+						y1 -= ls.ascent + (hl - (ls.ascent + ls.descent)) / 2.0;
+					QRectF scrG;
+					if (ite->itemText.hasObject(a))
+					{
+						PageItem* obj = ite->itemText.object(a);
+						double ww = (obj->width() + obj->lineWidth()) * glyphs->scaleH;
+						double hh = (obj->height() + obj->lineWidth()) * glyphs->scaleV;
+						scrG = QRectF(CurXB, ls.y - hh, ww , hh);
+					}
+					else
+						scrG = QRectF(CurXB, y1, glyphs->wide(), hl);
+					if ((oldBack == "") || ((oldBack == charStyle.backgroundColor()) && (oldShade == charStyle.backgroundShade())))
+						scr |= scrG;
+					else if ((oldBack != charStyle.backgroundColor()) || (oldShade != charStyle.backgroundShade()))
+					{
+						tmp += "q\n";
+						tmp += putColor(oldBack, oldShade, true);
+						tmp += FToStr(scr.x())     +" "+FToStr(-scr.y())+" m\n";
+						tmp += FToStr(scr.x() + scr.width())+" "+FToStr(-scr.y())+" l\n";
+						tmp += FToStr(scr.x() + scr.width())+" "+FToStr(-scr.y() - scr.height())+" l\n";
+						tmp += FToStr(scr.x())+" "+FToStr(-scr.y() - scr.height())+" l\n";
+						tmp += "h\nf*\n";
+						tmp += "Q\n";
+						scr = scrG;
+					}
+					oldBack = charStyle.backgroundColor();
+					oldShade = charStyle.backgroundShade();
+				}
+				else
+				{
+					if (!scr.isNull())
+					{
+						tmp += "q\n";
+						tmp += colorB;
+						tmp += FToStr(scr.x())     +" "+FToStr(-scr.y())+" m\n";
+						tmp += FToStr(scr.x() + scr.width())+" "+FToStr(-scr.y())+" l\n";
+						tmp += FToStr(scr.x() + scr.width())+" "+FToStr(-scr.y() - scr.height())+" l\n";
+						tmp += FToStr(scr.x())+" "+FToStr(-scr.y() - scr.height())+" l\n";
+						tmp += "h\nf*\n";
+						tmp += "Q\n";
+					}
+					oldBack = "";
+					oldShade = 100;
+					scr = QRectF();
+				}
+				CurXB += glyphs->wide();
+			}
+			if (!scr.isNull())
+			{
+				tmp += "q\n";
+				tmp += colorB;
+				tmp += FToStr(scr.x())     +" "+FToStr(-scr.y())+" m\n";
+				tmp += FToStr(scr.x() + scr.width())+" "+FToStr(-scr.y())+" l\n";
+				tmp += FToStr(scr.x() + scr.width())+" "+FToStr(-scr.y() - scr.height())+" l\n";
+				tmp += FToStr(scr.x())+" "+FToStr(-scr.y() - scr.height())+" l\n";
+				tmp += "h\nf*\n";
+				tmp += "Q\n";
+			}
 			for (int d = ls.firstItem; d <= ls.lastItem; ++d)
 			{
 				GlyphLayout* glyphs = ite->itemText.getGlyphs(d);

Modified: trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp	Tue Dec 29 09:02:06 2015
@@ -1169,10 +1169,150 @@
 	}
 	double x, y, wide;
 	QString chstr;
+	for (uint ll = 0; ll < Item->textLayout.lines(); ++ll)
+	{
+		LineSpec ls = Item->textLayout.line(ll);
+		const ParagraphStyle& LineStyle = Item->itemText.paragraphStyle(ls.firstItem);
+		// This code is for rendering paragraph background color.
+		// We just need to define this attribute for the paragraphs now.
+		if (LineStyle.backgroundColor() != CommonStrings::None)
+		{
+			double y1 = ls.y;
+			double hl = ls.height;
+			double adjX = 0;
+			if (LineStyle.firstIndent() <= 0)
+				adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
+			if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+				hl = m_Doc->guidesPrefs().valueBaselineGrid;
+			if (ls.isFirstLine)
+			{
+				if (Item->textLayout.lines() == 1)
+					hl = ls.ascent + ls.descent;
+				if (LineStyle.hasDropCap())
+					hl *= LineStyle.dropCapLines();
+			}
+			if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+				y1 -= LineStyle.lineSpacing();
+			else if (Item->firstLineOffset() == FLOPRealGlyphHeight || Item->firstLineOffset() == FLOPFontAscent)
+				y1 -= ls.ascent;
+			else
+				y1 -= LineStyle.lineSpacing();
+			QRectF scr(ls.colLeft + adjX, y1, Item->asTextFrame()->columnWidth() - adjX - LineStyle.rightMargin(), hl);
+			QString paS = QString("M %1 %2 ").arg(scr.x()).arg(scr.y());
+			paS += QString("L %1 %2 ").arg(scr.x() + scr.width()).arg(scr.y());
+			paS += QString("L %1 %2 ").arg(scr.x() + scr.width()).arg(scr.y() + scr.height());
+			paS += QString("L %1 %2 ").arg(scr.x()).arg(scr.y() + scr.height());
+			paS += "Z";
+			QDomElement glyS = docu.createElement("path");
+			glyS.setAttribute("d", paS);
+			glyS.setAttribute("style", "fill:"+SetColor(LineStyle.backgroundColor(), LineStyle.backgroundShade())+";" + "stroke:none;");
+			ob.appendChild(glyS);
+		}
+		// end background code
+	}
 	for (uint ll=0; ll < Item->textLayout.lines(); ++ll)
 	{
 		LineSpec ls = Item->textLayout.line(ll);
 		double CurX = ls.x;
+
+		double CurXB = ls.x;
+		int last = qMin(ls.lastItem, Item->itemText.length() - 1);
+		QRectF scr;
+		QString oldBack = "";
+		double oldShade = 100;
+		QString colorB = "";
+		for (int a = ls.firstItem; a <= last; ++a)
+		{
+			const GlyphLayout* glyphs(Item->itemText.getGlyphs(a));
+			const CharStyle& charStyle(Item->itemText.charStyle(a));
+			if (charStyle.backgroundColor() != CommonStrings::None)
+			{
+			// This code is for rendering character background color.
+				colorB = SetColor(charStyle.backgroundColor(), charStyle.backgroundShade());
+				const ParagraphStyle& LineStyle = Item->itemText.paragraphStyle(ls.firstItem);
+				double y1 = ls.y;
+				double hl = ls.height;
+				if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+					hl = m_Doc->guidesPrefs().valueBaselineGrid;
+				else if (LineStyle.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
+					hl = LineStyle.lineSpacing();
+				if (ls.isFirstLine)
+				{
+					if (Item->textLayout.lines() == 1)
+						hl = ls.ascent + ls.descent;
+					if (LineStyle.hasDropCap() && (a == ls.firstItem))
+						hl *= LineStyle.dropCapLines();
+					if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+						y1 -= LineStyle.lineSpacing();
+					else if (Item->firstLineOffset() == FLOPRealGlyphHeight || Item->firstLineOffset() == FLOPFontAscent)
+						y1 -= ls.ascent;
+					else
+						y1 -= LineStyle.lineSpacing();
+				}
+				else
+					y1 -= ls.ascent + (hl - (ls.ascent + ls.descent)) / 2.0;
+				QRectF scrG;
+				if (Item->itemText.hasObject(a))
+				{
+					PageItem* obj = Item->itemText.object(a);
+					double ww = (obj->width() + obj->lineWidth()) * glyphs->scaleH;
+					double hh = (obj->height() + obj->lineWidth()) * glyphs->scaleV;
+					scrG = QRectF(CurXB, ls.y - hh, ww , hh);
+				}
+				else
+					scrG = QRectF(CurXB, y1, glyphs->wide(), hl);
+				if ((oldBack == "") || ((oldBack == charStyle.backgroundColor()) && (oldShade == charStyle.backgroundShade())))
+					scr |= scrG;
+				else if ((oldBack != charStyle.backgroundColor()) || (oldShade != charStyle.backgroundShade()))
+				{
+					QString paS = QString("M %1 %2 ").arg(scr.x()).arg(scr.y());
+					paS += QString("L %1 %2 ").arg(scr.x() + scr.width()).arg(scr.y());
+					paS += QString("L %1 %2 ").arg(scr.x() + scr.width()).arg(scr.y() + scr.height());
+					paS += QString("L %1 %2 ").arg(scr.x()).arg(scr.y() + scr.height());
+					paS += "Z";
+					QDomElement glyS = docu.createElement("path");
+					glyS.setAttribute("d", paS);
+					glyS.setAttribute("style", "fill:"+SetColor(oldBack, oldShade)+";" + "stroke:none;");
+					ob.appendChild(glyS);
+					scr = scrG;
+				}
+				oldBack = charStyle.backgroundColor();
+				oldShade = charStyle.backgroundShade();
+				// end background code
+			}
+			else
+			{
+				if (!scr.isNull())
+				{
+					QString paS = QString("M %1 %2 ").arg(scr.x()).arg(scr.y());
+					paS += QString("L %1 %2 ").arg(scr.x() + scr.width()).arg(scr.y());
+					paS += QString("L %1 %2 ").arg(scr.x() + scr.width()).arg(scr.y() + scr.height());
+					paS += QString("L %1 %2 ").arg(scr.x()).arg(scr.y() + scr.height());
+					paS += "Z";
+					QDomElement glyS = docu.createElement("path");
+					glyS.setAttribute("d", paS);
+					glyS.setAttribute("style", "fill:"+colorB+";" + "stroke:none;");
+					ob.appendChild(glyS);
+				}
+				oldBack = "";
+				oldShade = 100;
+				scr = QRectF();
+			}
+			CurXB += glyphs->wide();
+		}
+		if (!scr.isNull())
+		{
+			QString paS = QString("M %1 %2 ").arg(scr.x()).arg(scr.y());
+			paS += QString("L %1 %2 ").arg(scr.x() + scr.width()).arg(scr.y());
+			paS += QString("L %1 %2 ").arg(scr.x() + scr.width()).arg(scr.y() + scr.height());
+			paS += QString("L %1 %2 ").arg(scr.x()).arg(scr.y() + scr.height());
+			paS += "Z";
+			QDomElement glyS = docu.createElement("path");
+			glyS.setAttribute("d", paS);
+			glyS.setAttribute("style", "fill:"+colorB+";" + "stroke:none;");
+			ob.appendChild(glyS);
+		}
+
 		for (int a = ls.firstItem; a <= ls.lastItem; ++a)
 		{
 			x = 0.0;

Modified: trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp	Tue Dec 29 09:02:06 2015
@@ -879,6 +879,47 @@
 			grp.appendChild(ob);
 		}
 	}
+	for (uint ll = 0; ll < Item->textLayout.lines(); ++ll)
+	{
+		LineSpec ls = Item->textLayout.line(ll);
+		const ParagraphStyle& LineStyle = Item->itemText.paragraphStyle(ls.firstItem);
+		// This code is for rendering paragraph background color.
+		// We just need to define this attribute for the paragraphs now.
+		if (LineStyle.backgroundColor() != CommonStrings::None)
+		{
+			double y1 = ls.y;
+			double hl = ls.height;
+			double adjX = 0;
+			if (LineStyle.firstIndent() <= 0)
+				adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
+			if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+				hl = m_Doc->guidesPrefs().valueBaselineGrid;
+			if (ls.isFirstLine)
+			{
+				if (Item->textLayout.lines() == 1)
+					hl = ls.ascent + ls.descent;
+				if (LineStyle.hasDropCap())
+					hl *= LineStyle.dropCapLines();
+			}
+			if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+				y1 -= LineStyle.lineSpacing();
+			else if (Item->firstLineOffset() == FLOPRealGlyphHeight || Item->firstLineOffset() == FLOPFontAscent)
+				y1 -= ls.ascent;
+			else
+				y1 -= LineStyle.lineSpacing();
+			QRectF scr(ls.colLeft + adjX, y1, Item->asTextFrame()->columnWidth() - adjX - LineStyle.rightMargin(), hl);
+			QString paS = QString("M%1,%2 ").arg(scr.x() * conversionFactor).arg(scr.y() * conversionFactor);
+			paS += QString("L%1,%2 ").arg((scr.x() + scr.width()) * conversionFactor).arg(scr.y() * conversionFactor);
+			paS += QString("L%1,%2 ").arg((scr.x() + scr.width()) * conversionFactor).arg((scr.y() + scr.height()) * conversionFactor);
+			paS += QString("L%1,%2 ").arg(scr.x() * conversionFactor).arg((scr.y() + scr.height()) * conversionFactor);
+			paS += "Z";
+			QDomElement glyS = p_docu.createElement("Path");
+			glyS.setAttribute("Data", paS);
+			glyS.setAttribute("Fill", SetColor(LineStyle.backgroundColor(), LineStyle.backgroundShade(), 0));
+			grp.appendChild(glyS);
+		}
+		// end background code
+	}
 	for (uint ll=0; ll < Item->textLayout.lines(); ++ll)
 	{
 		LineSpec ls = Item->textLayout.line(ll);
@@ -886,6 +927,104 @@
 		QList<QList<txtRunItem> > textRuns;
 		QList<txtRunItem> specialText;
 		double CurX = ls.x;
+
+		double CurXB = ls.x;
+		int last = qMin(ls.lastItem, Item->itemText.length() - 1);
+		QRectF scr;
+		QString oldBack = "";
+		double oldShade = 100;
+		QString colorB = "";
+		for (int a = ls.firstItem; a <= last; ++a)
+		{
+			const GlyphLayout* glyphs(Item->itemText.getGlyphs(a));
+			const CharStyle& charStyle(Item->itemText.charStyle(a));
+			if (charStyle.backgroundColor() != CommonStrings::None)
+			{
+			// This code is for rendering character background color.
+				colorB = SetColor(charStyle.backgroundColor(), charStyle.backgroundShade(), 0);
+				const ParagraphStyle& LineStyle = Item->itemText.paragraphStyle(ls.firstItem);
+				double y1 = ls.y;
+				double hl = ls.height;
+				if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+					hl = m_Doc->guidesPrefs().valueBaselineGrid;
+				else if (LineStyle.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
+					hl = LineStyle.lineSpacing();
+				if (ls.isFirstLine)
+				{
+					if (Item->textLayout.lines() == 1)
+						hl = ls.ascent + ls.descent;
+					if (LineStyle.hasDropCap() && (a == ls.firstItem))
+						hl *= LineStyle.dropCapLines();
+					if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+						y1 -= LineStyle.lineSpacing();
+					else if (Item->firstLineOffset() == FLOPRealGlyphHeight || Item->firstLineOffset() == FLOPFontAscent)
+						y1 -= ls.ascent;
+					else
+						y1 -= LineStyle.lineSpacing();
+				}
+				else
+					y1 -= ls.ascent + (hl - (ls.ascent + ls.descent)) / 2.0;
+				QRectF scrG;
+				if (Item->itemText.hasObject(a))
+				{
+					PageItem* obj = Item->itemText.object(a);
+					double ww = (obj->width() + obj->lineWidth()) * glyphs->scaleH;
+					double hh = (obj->height() + obj->lineWidth()) * glyphs->scaleV;
+					scrG = QRectF(CurXB, ls.y - hh, ww , hh);
+				}
+				else
+					scrG = QRectF(CurXB, y1, glyphs->wide(), hl);
+				if ((oldBack == "") || ((oldBack == charStyle.backgroundColor()) && (oldShade == charStyle.backgroundShade())))
+					scr |= scrG;
+				else if ((oldBack != charStyle.backgroundColor()) || (oldShade != charStyle.backgroundShade()))
+				{
+					QString paS = QString("M%1,%2 ").arg(scr.x() * conversionFactor).arg(scr.y() * conversionFactor);
+					paS += QString("L%1,%2 ").arg((scr.x() + scr.width()) * conversionFactor).arg(scr.y() * conversionFactor);
+					paS += QString("L%1,%2 ").arg((scr.x() + scr.width()) * conversionFactor).arg((scr.y() + scr.height()) * conversionFactor);
+					paS += QString("L%1,%2 ").arg(scr.x() * conversionFactor).arg((scr.y() + scr.height()) * conversionFactor);
+					paS += "Z";
+					QDomElement glyS = p_docu.createElement("Path");
+					glyS.setAttribute("Data", paS);
+					glyS.setAttribute("Fill", SetColor(oldBack, oldShade, 0));
+					grp.appendChild(glyS);
+					scr = scrG;
+				}
+				oldBack = charStyle.backgroundColor();
+				oldShade = charStyle.backgroundShade();
+			}
+			else
+			{
+				if (!scr.isNull())
+				{
+					QString paS = QString("M%1,%2 ").arg(scr.x() * conversionFactor).arg(scr.y() * conversionFactor);
+					paS += QString("L%1,%2 ").arg((scr.x() + scr.width()) * conversionFactor).arg(scr.y() * conversionFactor);
+					paS += QString("L%1,%2 ").arg((scr.x() + scr.width()) * conversionFactor).arg((scr.y() + scr.height()) * conversionFactor);
+					paS += QString("L%1,%2 ").arg(scr.x() * conversionFactor).arg((scr.y() + scr.height()) * conversionFactor);
+					paS += "Z";
+					QDomElement glyS = p_docu.createElement("Path");
+					glyS.setAttribute("Data", paS);
+					glyS.setAttribute("Fill", colorB);
+					grp.appendChild(glyS);
+				}
+				oldBack = "";
+				oldShade = 100;
+				scr = QRectF();
+			}
+			CurXB += glyphs->wide();
+		}
+		if (!scr.isNull())
+		{
+			QString paS = QString("M%1,%2 ").arg(scr.x() * conversionFactor).arg(scr.y() * conversionFactor);
+			paS += QString("L%1,%2 ").arg((scr.x() + scr.width()) * conversionFactor).arg(scr.y() * conversionFactor);
+			paS += QString("L%1,%2 ").arg((scr.x() + scr.width()) * conversionFactor).arg((scr.y() + scr.height()) * conversionFactor);
+			paS += QString("L%1,%2 ").arg(scr.x() * conversionFactor).arg((scr.y() + scr.height()) * conversionFactor);
+			paS += "Z";
+			QDomElement glyS = p_docu.createElement("Path");
+			glyS.setAttribute("Data", paS);
+			glyS.setAttribute("Fill", colorB);
+			grp.appendChild(glyS);
+		}
+
 		for (int a = ls.firstItem; a <= ls.lastItem; ++a)
 		{
 			//ScText *hl = Item->itemText.item_p(a);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	Tue Dec 29 09:02:06 2015
@@ -2467,6 +2467,13 @@
 	if (attrs.hasAttribute(SCOLOR))
 		newStyle.setStrokeColor(attrs.valueAsString(SCOLOR, CommonStrings::None));
 
+	static const QString BCOLOR("BCOLOR");
+	if (attrs.hasAttribute(BCOLOR))
+		newStyle.setBackgroundColor(attrs.valueAsString(BCOLOR, CommonStrings::None));
+	static const QString BSHADE("BSHADE");
+	if (attrs.hasAttribute(BSHADE))
+		newStyle.setBackgroundShade(attrs.valueAsInt(BSHADE, 100));
+
 	static const QString SSHADE("SSHADE");
 	if (attrs.hasAttribute(SSHADE))
 		newStyle.setStrokeShade(attrs.valueAsInt(SSHADE));
@@ -2735,6 +2742,12 @@
 	static const QString KeepTogether("KeepTogether");
 	if (attrs.hasAttribute(KeepTogether))
 		newStyle.setKeepTogether(attrs.valueAsInt(KeepTogether));
+	static const QString BCOLOR("BCOLOR");
+	if (attrs.hasAttribute(BCOLOR))
+		newStyle.setBackgroundColor(attrs.valueAsString(BCOLOR, CommonStrings::None));
+	static const QString BSHADE("BSHADE");
+	if (attrs.hasAttribute(BSHADE))
+		newStyle.setBackgroundShade(attrs.valueAsInt(BSHADE, 100));
 
 	readCharacterStyleAttrs( doc, attrs, newStyle.charStyle());
 

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	Tue Dec 29 09:02:06 2015
@@ -723,6 +723,10 @@
 		docu.writeAttribute("KeepWithNext", style.keepWithNext());
 	if ( ! style.isInhKeepTogether())
 		docu.writeAttribute("KeepTogether", style.keepTogether());
+	if ( ! style.isInhBackgroundColor())
+		docu.writeAttribute("BCOLOR", style.backgroundColor());
+	if ( ! style.isInhBackgroundShade())
+		docu.writeAttribute("BSHADE", style.backgroundShade());
 
 	if ( ! style.shortcut().isEmpty() )
 		docu.writeAttribute("PSHORTCUT", style.shortcut()); // shortcuts won't be inherited
@@ -781,6 +785,10 @@
 		docu.writeAttribute("FSHADE", style.fillShade());
 	if ( ! style.isInhStrokeColor())
 		docu.writeAttribute("SCOLOR", style.strokeColor());
+	if ( ! style.isInhBackgroundColor())
+		docu.writeAttribute("BCOLOR", style.backgroundColor());
+	if ( ! style.isInhBackgroundShade())
+		docu.writeAttribute("BSHADE", style.backgroundShade());
 	if ( ! style.isInhStrokeShade())
 		docu.writeAttribute("SSHADE", style.strokeShade());
 	if ( ! style.isInhShadowXOffset())

Modified: trunk/Scribus/scribus/plugins/gettext/docxim/docxim.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/plugins/gettext/docxim/docxim.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/docxim/docxim.cpp	(original)
+++ trunk/Scribus/scribus/plugins/gettext/docxim/docxim.cpp	Tue Dec 29 09:02:06 2015
@@ -402,6 +402,21 @@
 			if (spt.hasAttribute("w:before"))
 				pStyle.setGapBefore(pixelsFromTwips(spt.attribute("w:before", "0.0").toDouble()));
 		}
+		else if (spt.tagName() == "w:shd")
+		{
+			if (spt.hasAttribute("w:fill"))
+			{
+				QString color = spt.attribute("w:fill");
+				QColor colour;
+				colour.setNamedColor("#" + color);
+				ScColor tmp;
+				tmp.fromQColor(colour);
+				tmp.setSpotColor(false);
+				tmp.setRegistrationColor(false);
+				QString fNam = m_Doc->PageColors.tryAddColor("FromDocX"+colour.name(), tmp);
+				pStyle.setBackgroundColor(fNam);
+			}
+		}
 	}
 }
 
@@ -526,6 +541,21 @@
 				tmp.setRegistrationColor(false);
 				QString fNam = m_Doc->PageColors.tryAddColor("FromDocX"+colour.name(), tmp);
 				pStyle.charStyle().setFillColor(fNam);
+			}
+		}
+		else if (spc.tagName() == "w:shd")
+		{
+			if (spc.hasAttribute("w:fill"))
+			{
+				QString color = spc.attribute("w:fill");
+				QColor colour;
+				colour.setNamedColor("#" + color);
+				ScColor tmp;
+				tmp.fromQColor(colour);
+				tmp.setSpotColor(false);
+				tmp.setRegistrationColor(false);
+				QString fNam = m_Doc->PageColors.tryAddColor("FromDocX"+colour.name(), tmp);
+				pStyle.charStyle().setBackgroundColor(fNam);
 			}
 		}
 		else if (spc.tagName() == "w:vertAlign")

Modified: trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/odg/importodg.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/odg/importodg.cpp	Tue Dec 29 09:02:06 2015
@@ -1863,6 +1863,7 @@
 	tmpCStyle.setFont((*m_Doc->AllFonts)[oStyle.fontName]);
 	tmpCStyle.setFontSize(oStyle.fontSize * 10);
 	tmpCStyle.setFillColor(oStyle.CurrColorText);
+	tmpCStyle.setBackgroundColor(oStyle.CurrColorBText);
 	StyleFlag styleEffects = tmpCStyle.effects();
 	if ((oStyle.textPos.startsWith("super")) || (oStyle.textPos.startsWith("sub")))
 	{
@@ -2223,6 +2224,7 @@
 						currStyle.fontName = AttributeValue(spe.attribute("fo:font-family", ""));
 					currStyle.fontSize = AttributeValue(spe.attribute("fo:font-size", ""));
 					currStyle.fontColor = AttributeValue(spe.attribute("fo:color", ""));
+					currStyle.textBackgroundColor = AttributeValue(spe.attribute("fo:background-color", ""));
 					currStyle.textPos = AttributeValue(spe.attribute("style:text-position", ""));
 					currStyle.textOutline = AttributeValue(spe.attribute("style:text-outline", ""));
 					currStyle.textUnderline = AttributeValue(spe.attribute("style:text-underline-style", ""));
@@ -2391,6 +2393,8 @@
 					actStyle.lineHeight = AttributeValue(currStyle.lineHeight.value);
 				if (currStyle.fontColor.valid)
 					actStyle.fontColor = AttributeValue(currStyle.fontColor.value);
+				if (currStyle.textBackgroundColor.valid)
+					actStyle.textBackgroundColor = AttributeValue(currStyle.textBackgroundColor.value);
 				if (currStyle.gradientAngle.valid)
 					actStyle.gradientAngle = AttributeValue(currStyle.gradientAngle.value);
 				if (currStyle.gradientBorder.valid)
@@ -2574,6 +2578,8 @@
 			tmpOStyle.fontSize = parseUnit(actStyle.fontSize.value);
 		if (actStyle.fontColor.valid)
 			tmpOStyle.CurrColorText = parseColor(actStyle.fontColor.value);
+		if (actStyle.textBackgroundColor.valid)
+			tmpOStyle.CurrColorBText = parseColor(actStyle.textBackgroundColor.value);
 		if (actStyle.margin_top.valid)
 			tmpOStyle.margin_top = parseUnit(actStyle.margin_top.value);
 		if (actStyle.margin_bottom.valid)

Modified: trunk/Scribus/scribus/plugins/import/odg/importodg.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/plugins/import/odg/importodg.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/odg/importodg.h	(original)
+++ trunk/Scribus/scribus/plugins/import/odg/importodg.h	Tue Dec 29 09:02:06 2015
@@ -56,6 +56,7 @@
 	  CurrColorFill(CommonStrings::None),
 	  CurrColorStroke(CommonStrings::None),
 	  CurrColorText("Black"),
+	  CurrColorBText(CommonStrings::None),
 	  CurrColorShadow("Black"),
 	  fillOpacity(0.0),
 	  strokeOpacity(0.0),
@@ -136,6 +137,7 @@
 	QString							CurrColorFill;
 	QString							CurrColorStroke;
 	QString							CurrColorText;
+	QString							CurrColorBText;
 	QString							CurrColorShadow;
 	double							fillOpacity;
 	double							strokeOpacity;
@@ -268,6 +270,7 @@
 		AttributeValue textUnderlineColor;
 		AttributeValue textStrikeThrough;
 		AttributeValue textShadow;
+		AttributeValue textBackgroundColor;
 		AttributeValue lineHeight;
 		AttributeValue margin_top;
 		AttributeValue margin_bottom;

Modified: trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pages/importpages.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pages/importpages.cpp	Tue Dec 29 09:02:06 2015
@@ -2055,6 +2055,8 @@
 			tmpCStyle.setFontSize(actStyle.fontSize.value.toInt() * 10);
 		if (actStyle.fontColor.valid)
 			tmpCStyle.setFillColor(actStyle.fontColor.value);
+		if (actStyle.backColor.valid)
+			tmpCStyle.setBackgroundColor(actStyle.backColor.value);
 	}
 }
 

Modified: trunk/Scribus/scribus/plugins/import/pages/importpages.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/plugins/import/pages/importpages.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pages/importpages.h	(original)
+++ trunk/Scribus/scribus/plugins/import/pages/importpages.h	Tue Dec 29 09:02:06 2015
@@ -156,6 +156,7 @@
 		AttributeValue fontName;
 		AttributeValue fontSize;
 		AttributeValue fontColor;
+		AttributeValue backColor;
 	};
 	struct ParStyle
 	{

Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp	(original)
+++ trunk/Scribus/scribus/pslib.cpp	Tue Dec 29 09:02:06 2015
@@ -1409,7 +1409,6 @@
 	bool farb = options.useColor;
 	bool Hm = options.mirrorH;
 	bool Vm = options.mirrorV;
-	bool gcr = options.doGCR;
 	bool doDev = options.setDevParam;
 	bool doClip = options.doClip;
 	int sepac;
@@ -5069,10 +5068,151 @@
 	if (ite->lineColor() != CommonStrings::None)
 		tabDist += ite->lineWidth() / 2.0;
 
-	for (uint ll=0; ll < ite->textLayout.lines(); ++ll) {
+	for (uint ll = 0; ll < ite->textLayout.lines(); ++ll)
+	{
+		LineSpec ls = ite->textLayout.line(ll);
+		const ParagraphStyle& LineStyle = ite->itemText.paragraphStyle(ls.firstItem);
+		// This code is for rendering paragraph background color.
+		// We just need to define this attribute for the paragraphs now.
+		if (LineStyle.backgroundColor() != CommonStrings::None)
+		{
+			double y1 = ls.y;
+			double hl = ls.height;
+			double adjX = 0;
+			if (LineStyle.firstIndent() <= 0)
+				adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
+			if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+				hl = Doc->guidesPrefs().valueBaselineGrid;
+			if (ls.isFirstLine)
+			{
+				if (ite->textLayout.lines() == 1)
+					hl = ls.ascent + ls.descent;
+				if (LineStyle.hasDropCap())
+					hl *= LineStyle.dropCapLines();
+			}
+			if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+				y1 -= LineStyle.lineSpacing();
+			else if (ite->firstLineOffset() == FLOPRealGlyphHeight || ite->firstLineOffset() == FLOPFontAscent)
+				y1 -= ls.ascent;
+			else
+				y1 -= LineStyle.lineSpacing();
+			QRectF scr(ls.colLeft + adjX, y1, ite->asTextFrame()->columnWidth() - adjX - LineStyle.rightMargin(), hl);
+			PS_save();
+			int h, s, v, k;
+			SetColor(LineStyle.backgroundColor(), LineStyle.backgroundShade(), &h, &s, &v, &k);
+			PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
+			PS_moveto(scr.x(), -scr.y());
+			PS_lineto(scr.x() + scr.width(), -scr.y());
+			PS_lineto(scr.x() + scr.width(), -scr.y() - scr.height());
+			PS_lineto(scr.x(), -scr.y() - scr.height());
+			PS_closepath();
+			putColor(LineStyle.backgroundColor(), LineStyle.backgroundShade(), true);
+			PS_restore();
+		}
+		// end background code
+	}
+
+	for (uint ll=0; ll < ite->textLayout.lines(); ++ll)
+	{
 		LineSpec ls = ite->textLayout.line(ll);
 		tabDist = ls.x;
 		double CurX = ls.x;
+		double CurXB = ls.x;
+		QRectF scrG;
+		QString oldBack = "";
+		double oldShade = 100;
+		int last = qMin(ls.lastItem, ite->itemText.length() - 1);
+		for (int a = ls.firstItem; a <= last; ++a)
+		{
+			const GlyphLayout* glyphs(ite->itemText.getGlyphs(a));
+			const CharStyle& charStyle(ite->itemText.charStyle(a));
+			if (charStyle.backgroundColor() != CommonStrings::None)
+			{
+			// This code is for rendering character background color.
+				int h, s, v, k;
+				SetColor(charStyle.backgroundColor(), charStyle.backgroundShade(), &h, &s, &v, &k);
+				PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
+				const ParagraphStyle& LineStyle = ite->itemText.paragraphStyle(ls.firstItem);
+				double y1 = ls.y;
+				double hl = ls.height;
+				if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+					hl = Doc->guidesPrefs().valueBaselineGrid;
+				else if (LineStyle.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
+					hl = LineStyle.lineSpacing();
+				if (ls.isFirstLine)
+				{
+					if (ite->textLayout.lines() == 1)
+						hl = ls.ascent + ls.descent;
+					if (LineStyle.hasDropCap() && (a == ls.firstItem))
+						hl *= LineStyle.dropCapLines();
+					if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
+						y1 -= LineStyle.lineSpacing();
+					else if (ite->firstLineOffset() == FLOPRealGlyphHeight || ite->firstLineOffset() == FLOPFontAscent)
+						y1 -= ls.ascent;
+					else
+						y1 -= LineStyle.lineSpacing();
+				}
+				else
+					y1 -= ls.ascent + (hl - (ls.ascent + ls.descent)) / 2.0;
+				QRectF scr;
+				if (ite->itemText.hasObject(a))
+				{
+					PageItem* obj = ite->itemText.object(a);
+					double ww = (obj->width() + obj->lineWidth()) * glyphs->scaleH;
+					double hh = (obj->height() + obj->lineWidth()) * glyphs->scaleV;
+					scr = QRectF(CurXB, ls.y - hh, ww , hh);
+				}
+				else
+					scr = QRectF(CurXB, y1, glyphs->wide(), hl);
+				if ((oldBack == "") || ((oldBack == charStyle.backgroundColor()) && (oldShade == charStyle.backgroundShade())))
+					scrG |= scr;
+				else if ((oldBack != charStyle.backgroundColor()) || (oldShade != charStyle.backgroundShade()))
+				{
+					PS_save();
+					PS_moveto(scrG.x(), -scrG.y());
+					PS_lineto(scrG.x() + scrG.width(), -scrG.y());
+					PS_lineto(scrG.x() + scrG.width(), -scrG.y() - scrG.height());
+					PS_lineto(scrG.x(), -scrG.y() - scrG.height());
+					PS_closepath();
+					SetColor(oldBack, oldShade, &h, &s, &v, &k);
+					PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
+					putColor(oldBack, oldShade, true);
+					PS_restore();
+					scrG = scr;
+				}
+				oldBack = charStyle.backgroundColor();
+				oldShade = charStyle.backgroundShade();
+			}
+			else
+			{
+				if (!scrG.isNull())
+				{
+					PS_save();
+					PS_moveto(scrG.x(), -scrG.y());
+					PS_lineto(scrG.x() + scrG.width(), -scrG.y());
+					PS_lineto(scrG.x() + scrG.width(), -scrG.y() - scrG.height());
+					PS_lineto(scrG.x(), -scrG.y() - scrG.height());
+					PS_closepath();
+					putColor(oldBack, oldShade, true);
+					PS_restore();
+				}
+				oldBack = "";
+				oldShade = 100;
+				scrG = QRectF();
+			}
+			CurXB += glyphs->wide();
+		}
+		if (!scrG.isNull())
+		{
+			PS_save();
+			PS_moveto(scrG.x(), -scrG.y());
+			PS_lineto(scrG.x() + scrG.width(), -scrG.y());
+			PS_lineto(scrG.x() + scrG.width(), -scrG.y() - scrG.height());
+			PS_lineto(scrG.x(), -scrG.y() - scrG.height());
+			PS_closepath();
+			putColor(oldBack, oldShade, true);
+			PS_restore();
+		}
 
 		for (int d = ls.firstItem; d <= ls.lastItem; ++d)
 		{

Modified: trunk/Scribus/scribus/sccolorengine.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/sccolorengine.cpp
==============================================================================
--- trunk/Scribus/scribus/sccolorengine.cpp	(original)
+++ trunk/Scribus/scribus/sccolorengine.cpp	Tue Dec 29 09:02:06 2015
@@ -25,6 +25,7 @@
 #include "scribuscore.h"
 #include "scribusdoc.h"
 #include "colormgmt/sccolormgmtengine.h"
+#include <cmath>
 
 QColor ScColorEngine::getRGBColor(const ScColor& color, const ScribusDoc* doc)
 {
@@ -138,7 +139,46 @@
 	}
 	else if (model == colorModelLab)
 	{
-		ScColorTransform trans = doc ? doc->stdLabToRGBTrans : ScCore->defaultLabToRGBTrans;
+		// First step: Lab -> XYZ
+		double var_Y = (color.L_val + 16) / 116.0;
+		double var_X = color.a_val / 500.0 + var_Y;
+		double var_Z = var_Y - color.b_val / 200.0;
+		if (pow(var_Y, 3) > 0.008856)
+			var_Y = pow(var_Y, 3);
+		else
+			var_Y = (var_Y - 16.0 / 116.0) / 7.787;
+		if (pow(var_X, 3) > 0.008856)
+			var_X = pow(var_X, 3);
+		else
+			var_X = (var_X - 16.0 / 116.0) / 7.787;
+		if (pow(var_Z, 3) > 0.008856)
+			var_Z = pow(var_Z, 3);
+		else
+			var_Z = (var_Z - 16.0 / 116.0) / 7.787;
+		// Second step: XYZ -> RGB
+		// Whitepoint D50
+		var_X = 0.990720 * var_X;
+		var_Y = 1.00000  * var_Y;
+		var_Z = 0.825210 * var_Z;
+		double var_R = var_X *  3.2406 + var_Y * -1.5372 + var_Z * -0.4986;
+		double var_G = var_X * -0.9689 + var_Y *  1.8758 + var_Z *  0.0415;
+		double var_B = var_X *  0.0557 + var_Y * -0.2040 + var_Z *  1.0570;
+		if (var_R > 0.0031308)
+			var_R = 1.055 * (pow(var_R, (1.0 / 2.4))) - 0.055;
+		else
+			var_R = 12.92 * var_R;
+		if (var_G > 0.0031308)
+			var_G = 1.055 * (pow(var_G, (1.0 / 2.4))) - 0.055;
+		else
+			var_G = 12.92 * var_G;
+		if (var_B > 0.0031308)
+			var_B = 1.055 * (pow(var_B, (1.0 / 2.4))) - 0.055;
+		else
+			var_B = 12.92 * var_B;
+		rgb.r = qRound(qMax(qMin(var_R, 1.0), 0.0) * 255.0);
+		rgb.g = qRound(qMax(qMin(var_G, 1.0), 0.0) * 255.0);
+		rgb.b = qRound(qMax(qMin(var_B, 1.0), 0.0) * 255.0);
+	/*	ScColorTransform trans = doc ? doc->stdLabToRGBTrans : ScCore->defaultLabToRGBTrans;
 		double inC[3];
 		inC[0] = color.L_val;
 		inC[1] = color.a_val;
@@ -147,7 +187,7 @@
 		trans.apply(inC, outC, 1);
 		rgb.r = outC[0] / 257;
 		rgb.g = outC[1] / 257;
-		rgb.b = outC[2] / 257;
+		rgb.b = outC[2] / 257;*/
 	}
 }
 
@@ -324,14 +364,62 @@
 	}
 	else if (color.getColorModel() == colorModelLab)
 	{
+		bool cmsUse = doc ? doc->HasCMS : false;
 		ScColorTransform trans  = doc ? doc->stdLabToRGBTrans : ScCore->defaultLabToRGBTrans;
-		double inC[3];
-		inC[0] = color.L_val;
-		inC[1] = color.a_val;
-		inC[2] = color.b_val;
-		quint16 outC[3];
-		trans.apply(inC, outC, 1);
-		tmp = QColor(outC[0] / 257, outC[1] / 257, outC[2] / 257);
+		if (cmsUse && trans)
+		{
+			double inC[3];
+			inC[0] = color.L_val;
+			inC[1] = color.a_val;
+			inC[2] = color.b_val;
+			quint16 outC[3];
+			trans.apply(inC, outC, 1);
+			tmp = QColor(outC[0] / 257, outC[1] / 257, outC[2] / 257);
+		}
+		else
+		{
+			// First step: Lab -> XYZ
+			double var_Y = (color.L_val + 16) / 116.0;
+			double var_X = color.a_val / 500.0 + var_Y;
+			double var_Z = var_Y - color.b_val / 200.0;
+			if (pow(var_Y, 3) > 0.008856)
+				var_Y = pow(var_Y, 3);
+			else
+				var_Y = (var_Y - 16.0 / 116.0) / 7.787;
+			if (pow(var_X, 3) > 0.008856)
+				var_X = pow(var_X, 3);
+			else
+				var_X = (var_X - 16.0 / 116.0) / 7.787;
+			if (pow(var_Z, 3) > 0.008856)
+				var_Z = pow(var_Z, 3);
+			else
+				var_Z = (var_Z - 16.0 / 116.0) / 7.787;
+			// Second step: XYZ -> RGB
+			// Whitepoint D50
+			var_X = 0.990720 * var_X;
+			var_Y = 1.00000  * var_Y;
+			var_Z = 0.825210 * var_Z;
+			double var_R = var_X *  3.2406 + var_Y * -1.5372 + var_Z * -0.4986;
+			double var_G = var_X * -0.9689 + var_Y *  1.8758 + var_Z *  0.0415;
+			double var_B = var_X *  0.0557 + var_Y * -0.2040 + var_Z *  1.0570;
+			if (var_R > 0.0031308)
+				var_R = 1.055 * (pow(var_R, (1.0 / 2.4))) - 0.055;
+			else
+				var_R = 12.92 * var_R;
+			if (var_G > 0.0031308)
+				var_G = 1.055 * (pow(var_G, (1.0 / 2.4))) - 0.055;
+			else
+				var_G = 12.92 * var_G;
+			if (var_B > 0.0031308)
+				var_B = 1.055 * (pow(var_B, (1.0 / 2.4))) - 0.055;
+			else
+				var_B = 12.92 * var_B;
+			tmp = QColor(0, 0, 0, 0);
+			var_R = qMax(qMin(var_R, 1.0), 0.0);
+			var_G = qMax(qMin(var_G, 1.0), 0.0);
+			var_B = qMax(qMin(var_B, 1.0), 0.0);
+			tmp.setRgbF(var_R, var_G, var_B);
+		}
 	}
 	return tmp;
 }

Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp	(original)
+++ trunk/Scribus/scribus/scribuscore.cpp	Tue Dec 29 09:02:06 2015
@@ -290,6 +290,7 @@
 	PrinterProfiles.clear();
 	InputProfiles.clear();
 	InputProfilesCMYK.clear();
+	LabProfiles.clear();
 	profDirs = ScPaths::getSystemProfilesDirs();
 	profDirs.prepend( prefsManager->appPrefs.pathPrefs.colorProfiles );
 	profDirs.prepend( ScPaths::instance().shareDir()+"profiles/");
@@ -349,6 +350,11 @@
 				if (!InputProfilesCMYK.contains(profileName))
 					InputProfilesCMYK.insert(profileName, profInfo.file);
 			}
+			if (profInfo.colorSpace == ColorSpace_Lab)
+			{
+				if (!LabProfiles.contains(profileName))
+					LabProfiles.insert(profileName, profInfo.file);
+			}
 			break;
 		case Class_Display:
 			if (profInfo.colorSpace == ColorSpace_Rgb)
@@ -362,6 +368,11 @@
 			{
 				if (!InputProfilesCMYK.contains(profileName))
 					InputProfilesCMYK.insert(profileName, profInfo.file);
+			}
+			if (profInfo.colorSpace == ColorSpace_Lab)
+			{
+				if (!LabProfiles.contains(profileName))
+					LabProfiles.insert(profileName, profInfo.file);
 			}
 			break;
 		case Class_Output:
@@ -429,7 +440,10 @@
 	// Now create default color transforms (used mainly when color management is "disabled")
 	int dcmsFlags        = Ctf_BlackPointCompensation;
 	eRenderIntent intent = Intent_Relative_Colorimetric;
-	defaultLabProfile = defaultEngine.createProfile_Lab();
+//	if (!LabProfiles.isEmpty())
+//		defaultLabProfile = defaultEngine.openProfileFromFile(LabProfiles.first());
+//	else
+		defaultLabProfile = defaultEngine.createProfile_Lab();
 
 	defaultRGBToScreenSolidTrans  = defaultEngine.createTransform(defaultRGBProfile, Format_RGB_16,  defaultRGBProfile, Format_RGB_16, intent, dcmsFlags);
 	defaultRGBToScreenImageTrans  = defaultEngine.createTransform(defaultRGBProfile, Format_RGBA_8,  defaultRGBProfile, Format_RGBA_8, intent, dcmsFlags);

Modified: trunk/Scribus/scribus/scribuscore.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/scribuscore.h
==============================================================================
--- trunk/Scribus/scribus/scribuscore.h	(original)
+++ trunk/Scribus/scribus/scribuscore.h	Tue Dec 29 09:02:06 2015
@@ -57,7 +57,7 @@
 	ScribusCore();
 	~ScribusCore();
 	
-	ScSplashScreen* splash() {return m_SplashScreen;};
+	ScSplashScreen* splash() {return m_SplashScreen;}
 	/*
 	int exportToPDF() {return 0;}
 	int exportToEPS() {return 0;}
@@ -66,7 +66,7 @@
 	*/	
 	int init(bool useGUI, const QList<QString>& filesToUse);
 	int initScribusCore(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString newGuiLanguage, const QString prefsUserFile);
-	bool initialized() const {return m_ScribusInitialized;};
+	bool initialized() const {return m_ScribusInitialized;}
 	const QString& getGuiLanguage() const;
 
 	void initSplash(bool showSplash);
@@ -88,7 +88,7 @@
 	*/
 	bool isWinGUI() const;
 	bool haveCMS() const {return m_HaveCMS;}
-	bool haveGS() const {return m_HaveGS;};
+	bool haveGS() const {return m_HaveGS;}
 	bool havePNGAlpha() const {return m_HavePngAlpha;}
 	bool haveTIFFSep() const {return m_HaveTiffSep;}
 	void getCMSProfiles(bool showInfo);
@@ -109,6 +109,7 @@
 	ProfilesL MonitorProfiles;
 	ProfilesL PrinterProfiles;
 	ProfilesL PDFXProfiles;
+	ProfilesL LabProfiles;
 
 	ScColorMgmtEngine defaultEngine;
 	ScColorProfile   monitorProfile;

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Tue Dec 29 09:02:06 2015
@@ -513,6 +513,8 @@
 	pstyle.setHasNum(false);
 	pstyle.setDropCapLines(2);
 	pstyle.setParEffectOffset(0);
+	pstyle.setBackgroundColor(CommonStrings::None);
+	pstyle.setBackgroundShade(100);
 	pstyle.charStyle().setParent("");
 	
 	CharStyle cstyle;
@@ -525,6 +527,8 @@
 	cstyle.setFillShade(docPrefsData.itemToolPrefs.textShade);
 	cstyle.setStrokeColor(docPrefsData.itemToolPrefs.textStrokeColor);
 	cstyle.setStrokeShade(docPrefsData.itemToolPrefs.textStrokeShade);
+	cstyle.setBackgroundColor(CommonStrings::None);
+	cstyle.setBackgroundShade(100);
 	cstyle.setBaselineOffset(0);
 	cstyle.setShadowXOffset(50);
 	cstyle.setShadowYOffset(-50);
@@ -3812,7 +3816,7 @@
 			continue;
 		}
 		// Current paragraph style colors
-		if ((it.key() == currentStyle.charStyle().fillColor()) || (it.key() == currentStyle.charStyle().strokeColor()))
+		if ((it.key() == currentStyle.charStyle().fillColor()) || (it.key() == currentStyle.charStyle().strokeColor()) || (it.key() == currentStyle.charStyle().backgroundColor()))
 			found = true;
 		// Resources colors
 		if (!found)
@@ -8161,6 +8165,38 @@
 		m_updateManager.setUpdatesEnabled();
 	}
 	changed();
+}
+
+void ScribusDoc::itemSelection_SetParBackgroundColor(QString farbe, Selection* customSelection)
+{
+	if (farbe == CommonStrings::tr_NoneColor)
+		farbe = CommonStrings::None;
+	ParagraphStyle newStyle;
+	newStyle.setBackgroundColor(farbe);
+	itemSelection_ApplyParagraphStyle(newStyle, customSelection);
+}
+
+void ScribusDoc::itemSelection_SetParBackgroundShade(int sha, Selection* customSelection)
+{
+	ParagraphStyle newStyle;
+	newStyle.setBackgroundShade(sha);
+	itemSelection_ApplyParagraphStyle(newStyle, customSelection);
+}
+
+void ScribusDoc::itemSelection_SetBackgroundColor(QString farbe, Selection* customSelection)
+{
+	if (farbe == CommonStrings::tr_NoneColor)
+		farbe = CommonStrings::None;
+	CharStyle newStyle;
+	newStyle.setBackgroundColor(farbe);
+	itemSelection_ApplyCharStyle(newStyle, customSelection, "BACK_COLOR");
+}
+
+void ScribusDoc::itemSelection_SetBackgroundShade(int sha, Selection* customSelection)
+{
+	CharStyle newStyle;
+	newStyle.setBackgroundShade(sha);
+	itemSelection_ApplyCharStyle(newStyle, customSelection, "BACK_SHADE");
 }
 
 void ScribusDoc::itemSelection_SetFillColor(QString farbe, Selection* customSelection)

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Tue Dec 29 09:02:06 2015
@@ -1055,6 +1055,10 @@
 	void itemSelection_SetLineSpacingMode(int w, Selection* customSelection=0);
 	void itemSetFont(const QString& newFont);
 	void itemSelection_SetFont(QString fon, Selection* customSelection=0);
+	void itemSelection_SetParBackgroundColor(QString farbe, Selection* customSelection=0);
+	void itemSelection_SetParBackgroundShade(int sha, Selection* customSelection=0);
+	void itemSelection_SetBackgroundColor(QString farbe, Selection* customSelection=0);
+	void itemSelection_SetBackgroundShade(int sha, Selection* customSelection=0);
 	void itemSelection_SetFillColor(QString farbe, Selection* customSelection=0);
 	void itemSelection_SetFillShade(int sha, Selection* customSelection=0);
 	void itemSelection_SetStrokeColor(QString farbe, Selection* customSelection=0);

Modified: trunk/Scribus/scribus/styles/charstyle.attrdefs.cxx
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/styles/charstyle.attrdefs.cxx
==============================================================================
--- trunk/Scribus/scribus/styles/charstyle.attrdefs.cxx	(original)
+++ trunk/Scribus/scribus/styles/charstyle.attrdefs.cxx	Tue Dec 29 09:02:06 2015
@@ -31,8 +31,10 @@
 ATTRDEF(double, strikethruWidth, StrikethruWidth, 0)
 ATTRDEF(double, tracking, Tracking, 0)
 ATTRDEF(double, wordTracking, WordTracking, 1.0)
-ATTRDEF(QString, fillColor, FillColor, "undef")
+ATTRDEF(QString, fillColor, FillColor, "None")
 ATTRDEF(QString, strokeColor, StrokeColor, "Black")
+ATTRDEF(QString, backgroundColor, BackgroundColor, "None")
+ATTRDEF(double, backgroundShade, BackgroundShade, 100)
 ATTRDEF(QString, language, Language, "")
 ATTRDEF(QString, fontVariant, FontVariant, "")
 ATTRDEF(ScFace, font, Font, ScFace::none())

Modified: trunk/Scribus/scribus/styles/charstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/styles/charstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/styles/charstyle.cpp	(original)
+++ trunk/Scribus/scribus/styles/charstyle.cpp	Tue Dec 29 09:02:06 2015
@@ -382,6 +382,7 @@
 		lists.collectCharStyle(sty->name());
 	lists.collectColor(fillColor());
 	lists.collectColor(strokeColor());
+	lists.collectColor(backgroundColor());
 	lists.collectFont(font().scName());
 }
 
@@ -395,6 +396,9 @@
 								  
 	if (!inh_StrokeColor && (it = newNames.colors().find(strokeColor())) != newNames.colors().end())
 		setStrokeColor(it.value());
+
+	if (!inh_BackgroundColor && (it = newNames.colors().find(backgroundColor())) != newNames.colors().end())
+		setBackgroundColor(it.value());
 
 	if (hasParent() && (it = newNames.charStyles().find(parent())) != newNames.charStyles().end())
 		setParent(it.value());

Modified: trunk/Scribus/scribus/styles/paragraphstyle.attrdefs.cxx
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/styles/paragraphstyle.attrdefs.cxx
==============================================================================
--- trunk/Scribus/scribus/styles/paragraphstyle.attrdefs.cxx	(original)
+++ trunk/Scribus/scribus/styles/paragraphstyle.attrdefs.cxx	Tue Dec 29 09:02:06 2015
@@ -53,4 +53,6 @@
 ATTRDEF(int, numRestart, NumRestart, 0)
 ATTRDEF(bool, numOther, NumOther, false)
 ATTRDEF(bool, numHigher, NumHigher, true)
+ATTRDEF(QString, backgroundColor, BackgroundColor, "None")
+ATTRDEF(double, backgroundShade, BackgroundShade, 100)
 

Modified: trunk/Scribus/scribus/text/textlayout.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/text/textlayout.h
==============================================================================
--- trunk/Scribus/scribus/text/textlayout.h	(original)
+++ trunk/Scribus/scribus/text/textlayout.h	Tue Dec 29 09:02:06 2015
@@ -39,6 +39,8 @@
 	int firstItem;
 	int lastItem;
 	qreal naturalWidth;
+	bool isFirstLine;
+	qreal height;
 };
 
 struct PathData

Modified: trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h	Tue Dec 29 09:02:06 2015
@@ -297,6 +297,7 @@
 	virtual void setForegroundColour( const int value ) = 0;
 	virtual void setHighlightColour( const int value ) = 0;
 	virtual void setParagraphPatternBackgroundColour( const int value ) = 0;
+	virtual void setCharacterPatternBackgroundColour( const int value ) = 0;
 	virtual void setFont( const int fontIndex ) = 0;
 	virtual void setDefaultFont( const int fontIndex ) = 0;
 	virtual void setTextDirectionLeftToRight() = 0;

Modified: trunk/Scribus/scribus/third_party/rtf-qt/DocumentDestination.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/third_party/rtf-qt/DocumentDestination.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/DocumentDestination.cpp	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/DocumentDestination.cpp	Tue Dec 29 09:02:06 2015
@@ -99,6 +99,8 @@
 			m_output->setForegroundColour(value);
 		else if (controlWord == "cbpat" )
 			m_output->setParagraphPatternBackgroundColour(value);
+		else if (controlWord == "chcbpat" )
+			m_output->setCharacterPatternBackgroundColour(value);
 		else if (controlWord == "highlight")
 			m_output->setHighlightColour(value);
 		else if ((controlWord == "deff") && hasValue)

Modified: trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp	Tue Dec 29 09:02:06 2015
@@ -374,7 +374,14 @@
 
 	void SlaDocumentRtfOutput::setParagraphPatternBackgroundColour(const int colourIndex)
 	{
-	//	qDebug() << "setParagraphPatternBackgroundColour";
+		if ((m_colourTable.count() != 0) && (colourIndex < m_colourTable.count()))
+			m_textStyle.top().setBackgroundColor(m_colourTable.value(colourIndex));
+	}
+
+	void SlaDocumentRtfOutput::setCharacterPatternBackgroundColour(const int colourIndex)
+	{
+		if ((m_colourTable.count() != 0) && (colourIndex < m_colourTable.count()))
+			m_textCharStyle.top().setBackgroundColor(m_colourTable.value(colourIndex));
 	}
 
 	void SlaDocumentRtfOutput::setFont(const int fontIndex)

Modified: trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h	Tue Dec 29 09:02:06 2015
@@ -69,6 +69,7 @@
 		virtual void setForegroundColour(const int colourIndex);
 		virtual void setHighlightColour(const int colourIndex);
 		virtual void setParagraphPatternBackgroundColour(const int colourIndex);
+		virtual void setCharacterPatternBackgroundColour(const int colourIndex);
 		virtual void setFont(const int fontIndex);
 		virtual void setDefaultFont(const int fontIndex);
 		virtual void setFontSuperscript();

Modified: trunk/Scribus/scribus/ui/propertywidget_pareffect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/propertywidget_pareffect.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_pareffect.h	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_pareffect.h	Tue Dec 29 09:02:06 2015
@@ -99,6 +99,7 @@
 		peCombo->addItem(tr("Drop Caps"));
 		peCombo->addItem(tr("Bulleted List"));
 		peCombo->addItem(tr("Numerated List"));
+		peCombo->addItem(tr("Background Color"));
 	}
 
 //	void SMPStyleWidget::fillNumRestartCombo()

Modified: trunk/Scribus/scribus/ui/propertywidget_pareffectbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/propertywidget_pareffectbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_pareffectbase.ui	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_pareffectbase.ui	Tue Dec 29 09:02:06 2015
@@ -6,81 +6,18 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>270</width>
-    <height>429</height>
+    <width>281</width>
+    <height>411</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout" columnstretch="0,0">
-   <item row="12" column="0" colspan="2">
-    <widget class="QGroupBox" name="peGroup">
-     <property name="title">
-      <string>Effect Parameters</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_4">
-      <item row="6" column="0">
-       <widget class="QLabel" name="peCharStyleLabel">
-        <property name="text">
-         <string>Char Style</string>
-        </property>
-        <property name="buddy">
-         <cstring>peCharStyleCombo</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="6" column="1">
-       <widget class="CharStyleComboBox" name="peCharStyleCombo"/>
-      </item>
-      <item row="1" column="0" colspan="2">
-       <layout class="QHBoxLayout" name="horizontalLayout_5">
-        <item>
-         <widget class="QCheckBox" name="peIndent">
-          <property name="text">
-           <string>AutoIndent</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_5">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLabel" name="peOffsetLabel">
-          <property name="text">
-           <string>Offset</string>
-          </property>
-          <property name="buddy">
-           <cstring>peOffset</cstring>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="ScrSpinBox" name="peOffset">
-          <property name="minimum">
-           <double>-3000.000000000000000</double>
-          </property>
-          <property name="maximum">
-           <double>3000.000000000000000</double>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="4" column="0" colspan="2">
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QComboBox" name="peCombo"/>
+   </item>
+   <item>
     <widget class="QGroupBox" name="dropCapsGroup">
      <property name="title">
       <string>Drop Caps</string>
@@ -119,164 +56,7 @@
      </layout>
     </widget>
    </item>
-   <item row="8" column="0" rowspan="2" colspan="2">
-    <widget class="QGroupBox" name="numGroup">
-     <property name="title">
-      <string>Numbered List</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_2">
-      <item row="3" column="0" colspan="2">
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <item>
-         <widget class="QLabel" name="numLevelLabel">
-          <property name="text">
-           <string>Level</string>
-          </property>
-          <property name="buddy">
-           <cstring>numLevelSpin</cstring>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QSpinBox" name="numLevelSpin">
-          <property name="minimum">
-           <number>1</number>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_2">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLabel" name="numStartLabel">
-          <property name="text">
-           <string>Start</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QSpinBox" name="numStart">
-          <property name="minimum">
-           <number>1</number>
-          </property>
-          <property name="maximum">
-           <number>999</number>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item row="0" column="0" colspan="2">
-       <layout class="QHBoxLayout" name="horizontalLayout_3">
-        <item>
-         <widget class="QLabel" name="numComboLabel">
-          <property name="text">
-           <string>Set</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QComboBox" name="numComboBox">
-          <property name="currentIndex">
-           <number>-1</number>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_3">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLabel" name="numFormatLabel">
-          <property name="text">
-           <string>Format</string>
-          </property>
-          <property name="buddy">
-           <cstring>numFormatCombo</cstring>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QComboBox" name="numFormatCombo">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item row="4" column="0" colspan="2">
-       <layout class="QHBoxLayout" name="horizontalLayout_4">
-        <item>
-         <widget class="QLabel" name="numPrefixLabel">
-          <property name="text">
-           <string>Prefix</string>
-          </property>
-          <property name="buddy">
-           <cstring>numPrefix</cstring>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="numPrefix"/>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_4">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLabel" name="numSuffixLabel">
-          <property name="text">
-           <string>Suffix</string>
-          </property>
-          <property name="buddy">
-           <cstring>numSuffix</cstring>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="numSuffix"/>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="2">
-    <widget class="QComboBox" name="peCombo"/>
-   </item>
-   <item row="7" column="0" colspan="2">
+   <item>
     <widget class="QGroupBox" name="bullGroup">
      <property name="title">
       <string>Bulleted List</string>
@@ -330,18 +110,238 @@
      </layout>
     </widget>
    </item>
+   <item>
+    <widget class="QGroupBox" name="numGroup">
+     <property name="title">
+      <string>Numbered List</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_2">
+      <item row="3" column="0" colspan="2">
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <widget class="QLabel" name="numLevelLabel">
+          <property name="text">
+           <string>Level</string>
+          </property>
+          <property name="buddy">
+           <cstring>numLevelSpin</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="numLevelSpin">
+          <property name="minimum">
+           <number>1</number>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer_2">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QLabel" name="numStartLabel">
+          <property name="text">
+           <string>Start</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="numStart">
+          <property name="minimum">
+           <number>1</number>
+          </property>
+          <property name="maximum">
+           <number>999</number>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item row="0" column="0" colspan="2">
+       <layout class="QHBoxLayout" name="horizontalLayout_3">
+        <item>
+         <widget class="QLabel" name="numComboLabel">
+          <property name="text">
+           <string>Set</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="numComboBox">
+          <property name="currentIndex">
+           <number>-1</number>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer_3">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QLabel" name="numFormatLabel">
+          <property name="text">
+           <string>Format</string>
+          </property>
+          <property name="buddy">
+           <cstring>numFormatCombo</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="numFormatCombo">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item row="4" column="0" colspan="2">
+       <layout class="QHBoxLayout" name="horizontalLayout_4">
+        <item>
+         <widget class="QLabel" name="numPrefixLabel">
+          <property name="text">
+           <string>Prefix</string>
+          </property>
+          <property name="buddy">
+           <cstring>numPrefix</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="numPrefix"/>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer_4">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QLabel" name="numSuffixLabel">
+          <property name="text">
+           <string>Suffix</string>
+          </property>
+          <property name="buddy">
+           <cstring>numSuffix</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="numSuffix"/>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="peGroup">
+     <property name="title">
+      <string>Effect Parameters</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_4">
+      <item row="6" column="0">
+       <widget class="QLabel" name="peCharStyleLabel">
+        <property name="text">
+         <string>Char Style</string>
+        </property>
+        <property name="buddy">
+         <cstring>peCharStyleCombo</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="6" column="1">
+       <widget class="CharStyleComboBox" name="peCharStyleCombo"/>
+      </item>
+      <item row="1" column="0" colspan="2">
+       <layout class="QHBoxLayout" name="horizontalLayout_5">
+        <item>
+         <widget class="QCheckBox" name="peIndent">
+          <property name="text">
+           <string>AutoIndent</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer_5">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QLabel" name="peOffsetLabel">
+          <property name="text">
+           <string>Offset</string>
+          </property>
+          <property name="buddy">
+           <cstring>peOffset</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="ScrSpinBox" name="peOffset">
+          <property name="minimum">
+           <double>-3000.000000000000000</double>
+          </property>
+          <property name="maximum">
+           <double>3000.000000000000000</double>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>
   <customwidget>
    <class>ScrSpinBox</class>
    <extends>QDoubleSpinBox</extends>
-   <header location="global">ui/scrspinbox.h</header>
+   <header>ui/scrspinbox.h</header>
   </customwidget>
   <customwidget>
    <class>CharStyleComboBox</class>
    <extends>QComboBox</extends>
-   <header location="global">ui/spalette.h</header>
+   <header>ui/spalette.h</header>
   </customwidget>
  </customwidgets>
  <resources/>

Modified: trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp	Tue Dec 29 09:02:06 2015
@@ -34,6 +34,11 @@
 	strokeIcon->setPixmap(IconManager::instance()->loadPixmap("16/color-stroke.png"));
 	strokeIcon->setScaledContents( false );
 	strokeShadeLabel->setPixmap(IconManager::instance()->loadPixmap("shade.png"));
+
+	backLayout->setAlignment( Qt::AlignLeft );
+	backIcon->setPixmap(IconManager::instance()->loadPixmap("16/color-fill.png"));
+	backIcon->setScaledContents( false );
+	backShadeLabel->setPixmap(IconManager::instance()->loadPixmap("shade.png"));
 
 	effectsLayout->setAlignment( Qt::AlignLeft );
 	revertButton->setIcon(IconManager::instance()->loadIcon("Revers.png"));
@@ -129,6 +134,8 @@
 	connect(strokeColor , SIGNAL(activated(int)), this, SLOT(handleTextStroke())   , Qt::UniqueConnection);
 	connect(fillShade   , SIGNAL(clicked())     , this, SLOT(handleTextShade())    , Qt::UniqueConnection);
 	connect(strokeShade , SIGNAL(clicked())     , this, SLOT(handleTextShade())    , Qt::UniqueConnection);
+	connect(backShade , SIGNAL(clicked())     , this, SLOT(handleTextShade())    , Qt::UniqueConnection);
+	connect(backColor   , SIGNAL(activated(int)), this, SLOT(handleTextBackground())     , Qt::UniqueConnection);
 
 	connect(textEffects, SIGNAL(State(int))      , this, SLOT(handleTypeStyle(int)), Qt::UniqueConnection);
 	connect(textEffects->ShadowVal->Xoffset  , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs()), Qt::UniqueConnection);
@@ -147,6 +154,8 @@
 	disconnect(strokeColor , SIGNAL(activated(int)), this, SLOT(handleTextStroke()));
 	disconnect(fillShade   , SIGNAL(clicked())     , this, SLOT(handleTextShade()));
 	disconnect(strokeShade , SIGNAL(clicked())     , this, SLOT(handleTextShade()));
+	disconnect(backShade , SIGNAL(clicked())     , this, SLOT(handleTextShade()));
+	disconnect(backColor   , SIGNAL(activated(int)), this, SLOT(handleTextBackground()));
 
 	disconnect(textEffects, SIGNAL(State(int))      , this, SLOT(handleTypeStyle(int)));
 	disconnect(textEffects->ShadowVal->Xoffset  , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs()));
@@ -202,8 +211,10 @@
 
 	fillColor->updateBox(m_doc->PageColors, ColorCombo::fancyPixmaps, true);
 	strokeColor->updateBox(m_doc->PageColors, ColorCombo::fancyPixmaps, false);
+	backColor->updateBox(m_doc->PageColors, ColorCombo::fancyPixmaps, true);
 	fillColor->view()->setMinimumWidth(fillColor->view()->maximumViewportSize().width() + 24);
 	strokeColor->view()->setMinimumWidth(strokeColor->view()->maximumViewportSize().width() + 24);
+	backColor->view()->setMinimumWidth(backColor->view()->maximumViewportSize().width() + 24);
 
 	if (m_item)
 		setCurrentItem(m_item);
@@ -216,7 +227,7 @@
 
 	showOutlineW  (charStyle.outlineWidth());
 	showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset());
-	showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.strokeShade(), charStyle.fillShade());
+	showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.backgroundColor(), charStyle.strokeShade(), charStyle.fillShade(), charStyle.backgroundShade());
 	showTextEffects(charStyle.effects());
 	showStrikeThru(charStyle.strikethruOffset()  , charStyle.strikethruWidth());
 	showUnderline (charStyle.underlineOffset(), charStyle.underlineWidth());
@@ -231,7 +242,7 @@
 
 	showOutlineW  (charStyle.outlineWidth());
 	showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset());
-	showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.strokeShade(), charStyle.fillShade());
+	showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.backgroundColor(), charStyle.strokeShade(), charStyle.fillShade(), charStyle.backgroundShade());
 	showTextEffects(charStyle.effects());
 	showStrikeThru(charStyle.strikethruOffset()  , charStyle.strikethruWidth());
 	showUnderline (charStyle.underlineOffset(), charStyle.underlineWidth());
@@ -260,7 +271,7 @@
 	textEffects->StrikeVal->LWidth->showValue(w / 10.0);
 }
 
-void PropertyWidget_TextColor::showTextColors(QString p, QString b, double shp, double shb)
+void PropertyWidget_TextColor::showTextColors(QString p, QString b, QString bc, double shp, double shb, double sbc)
 {
 	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
 		return;
@@ -268,6 +279,7 @@
 	int c = 0;
 	fillShade->setValue(qRound(shb));
 	strokeShade->setValue(qRound(shp));
+	backShade->setValue(qRound(sbc));
 	if ((b != CommonStrings::None) && (!b.isEmpty()))
 	{
 		c++;
@@ -290,6 +302,18 @@
 		}
 	}
 	strokeColor->setCurrentIndex(c);
+	c = 0;
+	if ((bc != CommonStrings::None) && (!bc.isEmpty()))
+	{
+		c++;
+		for (it = m_doc->PageColors.begin(); it != m_doc->PageColors.end(); ++it)
+		{
+			if (it.key() == bc)
+				break;
+			c++;
+		}
+	}
+	backColor->setCurrentIndex(c);
 }
 
 void PropertyWidget_TextColor::showTextEffects(int s)
@@ -406,41 +430,9 @@
 	}
 }
 
-void PropertyWidget_TextColor::handleTextShade()
+void PropertyWidget_TextColor::handleTextBackground()
 {
 	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if (strokeShade == sender())
-	{
-		int b = strokeShade->getValue();
-		PageItem *i2 = m_item;
-		if (m_doc->appMode == modeEditTable)
-			i2 = m_item->asTable()->activeCell().textFrame();
-		if (i2 != NULL)
-		{
-			Selection tempSelection(this, false);
-			tempSelection.addItem(i2, true);
-			m_doc->itemSelection_SetStrokeShade(b, &tempSelection);
-		}
-	}
-	else
-	{
-		int b = fillShade->getValue();
-		PageItem *i2 = m_item;
-		if (m_doc->appMode == modeEditTable)
-			i2 = m_item->asTable()->activeCell().textFrame();
-		if (i2 != NULL)
-		{
-			Selection tempSelection(this, false);
-			tempSelection.addItem(i2, true);
-			m_doc->itemSelection_SetFillShade(b, &tempSelection);
-		}
-	}
-}
-
-void PropertyWidget_TextColor::handleTypeStyle(int s)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
 	PageItem *i2 = m_item;
 	if (m_doc->appMode == modeEditTable)
@@ -449,6 +441,66 @@
 	{
 		Selection tempSelection(this, false);
 		tempSelection.addItem(i2, true);
+		m_doc->itemSelection_SetBackgroundColor(backColor->currentColor(), &tempSelection);
+	}
+}
+
+void PropertyWidget_TextColor::handleTextShade()
+{
+	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+	if (strokeShade == sender())
+	{
+		int b = strokeShade->getValue();
+		PageItem *i2 = m_item;
+		if (m_doc->appMode == modeEditTable)
+			i2 = m_item->asTable()->activeCell().textFrame();
+		if (i2 != NULL)
+		{
+			Selection tempSelection(this, false);
+			tempSelection.addItem(i2, true);
+			m_doc->itemSelection_SetStrokeShade(b, &tempSelection);
+		}
+	}
+	else if (fillShade == sender())
+	{
+		int b = fillShade->getValue();
+		PageItem *i2 = m_item;
+		if (m_doc->appMode == modeEditTable)
+			i2 = m_item->asTable()->activeCell().textFrame();
+		if (i2 != NULL)
+		{
+			Selection tempSelection(this, false);
+			tempSelection.addItem(i2, true);
+			m_doc->itemSelection_SetFillShade(b, &tempSelection);
+		}
+	}
+	else if (backShade == sender())
+	{
+		int b = backShade->getValue();
+		PageItem *i2 = m_item;
+		if (m_doc->appMode == modeEditTable)
+			i2 = m_item->asTable()->activeCell().textFrame();
+		if (i2 != NULL)
+		{
+			Selection tempSelection(this, false);
+			tempSelection.addItem(i2, true);
+			m_doc->itemSelection_SetBackgroundShade(b, &tempSelection);
+		}
+	}
+}
+
+void PropertyWidget_TextColor::handleTypeStyle(int s)
+{
+	if (!m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+	PageItem *i2 = m_item;
+	if (m_doc->appMode == modeEditTable)
+		i2 = m_item->asTable()->activeCell().textFrame();
+	if (i2 != NULL)
+	{
+		Selection tempSelection(this, false);
+		tempSelection.addItem(i2, true);
 		m_doc->itemSelection_SetEffects(s, &tempSelection);
 		m_ScMW->setStyleEffects(s);
 	}
@@ -498,8 +550,10 @@
 
 	fillColor->setToolTip( "<qt>" + tr("Color of selected text. If Outline text decoration is enabled, this color will be the fill color. If Drop Shadow Text is enabled, then this will be the top most color.") + "</qt>" );
 	strokeColor->setToolTip( "<qt>" + tr("Color of text stroke and/or drop shadow, depending which is chosen. If both are chosen, then they share the same color.") + "</qt>" );
+	backColor->setToolTip( "<qt>" + tr("Background color of selected text.") + "</qt>" );
 	fillShade->setToolTip( tr("Saturation of color of text fill"));
 	strokeShade->setToolTip( tr("Saturation of color of text stroke"));
+	backShade->setToolTip( tr("Saturation of color of text background"));
 
 	revertButton->setToolTip( tr("Right to Left Writing"));
 }

Modified: trunk/Scribus/scribus/ui/propertywidget_textcolor.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/propertywidget_textcolor.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_textcolor.h	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_textcolor.h	Tue Dec 29 09:02:06 2015
@@ -50,7 +50,7 @@
 	void showOutlineW(double x);
 	void showShadowOffset(double x, double y);
 	void showStrikeThru(double p, double w);
-	void showTextColors(QString p, QString b, double shp, double shb);
+	void showTextColors(QString p, QString b, QString bc, double shp, double shb, double sbc);
 	void showTextEffects(int s);
 	void showUnderline(double p, double w);
 
@@ -64,6 +64,7 @@
 	void handleTextFill();
 	void handleTextShade();
 	void handleTextStroke();
+	void handleTextBackground();
 	void handleTextDirection();
 	void handleTypeStyle(int s);
 	void handleUnderline();

Modified: trunk/Scribus/scribus/ui/propertywidget_textcolorbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/propertywidget_textcolorbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_textcolorbase.ui	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_textcolorbase.ui	Tue Dec 29 09:02:06 2015
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>210</width>
-    <height>94</height>
+    <width>127</width>
+    <height>116</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -19,19 +19,81 @@
   <property name="frameShadow">
    <enum>QFrame::Raised</enum>
   </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="margin">
-    <number>3</number>
-   </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
    <property name="spacing">
     <number>3</number>
    </property>
-   <item row="1" column="0">
+   <property name="leftMargin">
+    <number>3</number>
+   </property>
+   <property name="topMargin">
+    <number>3</number>
+   </property>
+   <property name="rightMargin">
+    <number>3</number>
+   </property>
+   <property name="bottomMargin">
+    <number>3</number>
+   </property>
+   <item>
+    <layout class="QHBoxLayout" name="fillLayout">
+     <property name="spacing">
+      <number>3</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="fillIcon">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="pixmap">
+        <pixmap>../../resources/icons/16/color-fill.png</pixmap>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="ColorCombo" name="fillColor">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="fillShadeLabel">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="pixmap">
+        <pixmap>../../resources/icons/shade.png</pixmap>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="ShadeButton" name="fillShade">
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
     <layout class="QHBoxLayout" name="strokeLayout">
      <property name="spacing">
       <number>3</number>
      </property>
-     <property name="margin">
+     <property name="leftMargin">
+      <number>0</number>
+     </property>
+     <property name="topMargin">
+      <number>0</number>
+     </property>
+     <property name="rightMargin">
+      <number>0</number>
+     </property>
+     <property name="bottomMargin">
       <number>0</number>
      </property>
      <item>
@@ -73,13 +135,13 @@
      </item>
     </layout>
    </item>
-   <item row="0" column="0">
-    <layout class="QHBoxLayout" name="fillLayout">
-     <property name="spacing">
-      <number>3</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="fillIcon">
+   <item>
+    <layout class="QHBoxLayout" name="backLayout">
+     <property name="spacing">
+      <number>3</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="backIcon">
        <property name="text">
         <string/>
        </property>
@@ -89,7 +151,7 @@
       </widget>
      </item>
      <item>
-      <widget class="ColorCombo" name="fillColor">
+      <widget class="ColorCombo" name="backColor">
        <property name="sizePolicy">
         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
@@ -99,7 +161,7 @@
       </widget>
      </item>
      <item>
-      <widget class="QLabel" name="fillShadeLabel">
+      <widget class="QLabel" name="backShadeLabel">
        <property name="text">
         <string/>
        </property>
@@ -109,15 +171,15 @@
       </widget>
      </item>
      <item>
-      <widget class="ShadeButton" name="fillShade">
-       <property name="text">
-        <string/>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="2" column="0">
+      <widget class="ShadeButton" name="backShade">
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
     <layout class="QHBoxLayout" name="effectsLayout">
      <property name="spacing">
       <number>3</number>

Modified: trunk/Scribus/scribus/ui/smcstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/smcstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.cpp	(original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.cpp	Tue Dec 29 09:02:06 2015
@@ -29,13 +29,17 @@
 	fillShadeLabel->setPixmap(im->loadPixmap("shade.png"));
 	StrokeIcon->setPixmap(im->loadPixmap("16/color-stroke.png"));
 	strokeShadeLabel->setPixmap(im->loadPixmap("shade.png"));
+	backIcon->setPixmap(im->loadPixmap("16/color-fill.png"));
+	backShadeLabel->setPixmap(im->loadPixmap("shade.png"));
 
 	fillColor_->clear();
 	strokeColor_->clear();
+	backColor_->clear();
 	ColorList::Iterator it;
 	QPixmap pm = QPixmap(15, 15);
 	fillColor_->addItem(CommonStrings::tr_NoneColor);
 	strokeColor_->addItem(CommonStrings::tr_NoneColor);
+	backColor_->addItem(CommonStrings::tr_NoneColor);
 	StrokeIcon->setEnabled(false);
 	strokeShade_->setEnabled(false);
 	strokeColor_->setEnabled(false);
@@ -59,18 +63,25 @@
 	LanguageManager::instance()->fillInstalledHyphStringList(&languageList);
 	fillLangComboFromList(languageList);
 
-	if (fillColor_->count() > 0)
-	{
-		bool sigBlocked = fillColor_->blockSignals(true);
-		fillColor_->setItemText(0, CommonStrings::tr_NoneColor);
-		fillColor_->blockSignals(sigBlocked);
-	}
-
-	if (strokeColor_->count() > 0)
-	{
-		bool sigBlocked = strokeColor_->blockSignals(true);
-		strokeColor_->setItemText(0, CommonStrings::tr_NoneColor);
-		strokeColor_->blockSignals(sigBlocked);
+	if (fillColor_->count() > 0)
+	{
+		bool sigBlocked = fillColor_->blockSignals(true);
+		fillColor_->setItemText(0, CommonStrings::tr_NoneColor);
+		fillColor_->blockSignals(sigBlocked);
+	}
+
+	if (strokeColor_->count() > 0)
+	{
+		bool sigBlocked = strokeColor_->blockSignals(true);
+		strokeColor_->setItemText(0, CommonStrings::tr_NoneColor);
+		strokeColor_->blockSignals(sigBlocked);
+	}
+
+	if (backColor_->count() > 0)
+	{
+		bool sigBlocked = backColor_->blockSignals(true);
+		backColor_->setItemText(0, CommonStrings::tr_NoneColor);
+		backColor_->blockSignals(sigBlocked);
 	}
 
 /***********************************/
@@ -92,6 +103,8 @@
 	fillShade_->setToolTip(      tr("Fill Shade"));
 	strokeColor_->setToolTip(    tr("Stroke Color"));
 	strokeShade_->setToolTip(    tr("Stroke Shade"));
+	backColor_->setToolTip(      tr("Background Color"));
+	backShade_->setToolTip(      tr("Background Shade"));
 
 	fontSizeLabel_->setToolTip(fontSize_->toolTip());
 	trackingLabel_->setToolTip(tracking_->toolTip());
@@ -103,6 +116,8 @@
 	fillShadeLabel->setToolTip(fillShade_->toolTip());
 	StrokeIcon->setToolTip(strokeColor_->toolTip());
 	strokeShadeLabel->setToolTip(strokeShade_->toolTip());
+	backIcon->setToolTip(backColor_->toolTip());
+	backShadeLabel->setToolTip(backShade_->toolTip());
 
 /***********************************/
 /*        End Tooltips             */
@@ -156,18 +171,22 @@
 {
 	fillColor_->clear();
 	strokeColor_->clear();
+	backColor_->clear();
 
 	fillColor_->addItem(CommonStrings::tr_NoneColor);
 	strokeColor_->addItem(CommonStrings::tr_NoneColor);
+	backColor_->addItem(CommonStrings::tr_NoneColor);
 	ColorList::Iterator itend=colors.end();
 	ScribusDoc* doc = colors.document();
 	for (ColorList::Iterator it = colors.begin(); it != itend; ++it)
 	{
 		fillColor_->insertFancyItem(it.value(), doc, it.key());
 		strokeColor_->insertFancyItem(it.value(), doc, it.key());
+		backColor_->insertFancyItem(it.value(), doc, it.key());
 	}
 	fillColor_->view()->setMinimumWidth(fillColor_->view()->maximumViewportSize().width()+24);
 	strokeColor_->view()->setMinimumWidth(strokeColor_->view()->maximumViewportSize().width()+24);
+	backColor_->view()->setMinimumWidth(backColor_->view()->maximumViewportSize().width()+24);
 }
 
 void SMCStyleWidget::show(CharStyle *cstyle, QList<CharStyle> &cstyles, const QString &defLang, int unitIndex)
@@ -210,6 +229,12 @@
 
 		strokeColor_->setCurrentText(cstyle->strokeColor(), cstyle->isInhStrokeColor());
 		strokeColor_->setParentText(parent->strokeColor());
+
+		backColor_->setCurrentText(cstyle->backgroundColor(), cstyle->isInhBackgroundColor());
+		backColor_->setParentText(parent->backgroundColor());
+
+		backShade_->setValue(qRound(cstyle->backgroundShade()), cstyle->isInhBackgroundShade());
+		backShade_->setParentValue(qRound(parent->backgroundShade()));
 
 		fontFace_->setCurrentFont(cstyle->font().scName(), cstyle->isInhFont());
 		fontFace_->setParentFont(parent->font().scName());
@@ -227,6 +252,8 @@
 		strokeShade_->setValue(qRound(cstyle->strokeShade()));
 		fillColor_->setCurrentText(cstyle->fillColor());
 		strokeColor_->setCurrentText(cstyle->strokeColor());
+		backColor_->setCurrentText(cstyle->backgroundColor());
+		backShade_->setValue(qRound(cstyle->backgroundShade()));
 		fontFace_->setCurrentFont(cstyle->font().scName());
 	}
 
@@ -503,6 +530,25 @@
 	else
 		strokeShade_->setValue(qRound(d));
 
+	d = -30000;
+	for (int i = 0; i < cstyles.count(); ++i)
+	{
+		if (d != -30000 && cstyles[i]->backgroundShade() != d)
+		{
+			d = -30000;
+			break;
+		}
+		else
+			d = cstyles[i]->backgroundShade();
+	}
+	if (d == -30000)
+	{
+		backShade_->setValue(21);
+		backShade_->setText( tr("Shade"));
+	}
+	else
+		backShade_->setValue(qRound(d));
+
 	QString s;
 	QString emptyString;
 	for (int i = 0; i < cstyles.count(); ++i)
@@ -543,6 +589,26 @@
 	}
 	else
 		strokeColor_->setCurrentText(s);
+
+	s = emptyString;
+	for (int i = 0; i < cstyles.count(); ++i)
+	{
+		if (!s.isNull() && s != cstyles[i]->backgroundColor())
+		{
+			s = emptyString;
+			break;
+		}
+		else
+			s = cstyles[i]->backgroundColor();
+	}
+	if (s.isEmpty())
+	{
+		if (backColor_->itemText(backColor_->count() - 1) != "")
+			backColor_->addItem("");
+		backColor_->setCurrentIndex(backColor_->count() - 1);
+	}
+	else
+		backColor_->setCurrentText(s);
 }
 
 void SMCStyleWidget::showLanguage(const QList<CharStyle*> &cstyles, const QString &defLang)

Modified: trunk/Scribus/scribus/ui/smcstylewidget.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/smcstylewidget.ui
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.ui	(original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.ui	Tue Dec 29 09:02:06 2015
@@ -6,11 +6,26 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>398</width>
-    <height>513</height>
+    <width>380</width>
+    <height>413</height>
    </rect>
   </property>
-  <layout class="QVBoxLayout">
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <property name="spacing">
+    <number>3</number>
+   </property>
+   <property name="leftMargin">
+    <number>5</number>
+   </property>
+   <property name="topMargin">
+    <number>5</number>
+   </property>
+   <property name="rightMargin">
+    <number>5</number>
+   </property>
+   <property name="bottomMargin">
+    <number>5</number>
+   </property>
    <item>
     <layout class="QHBoxLayout">
      <item>
@@ -44,6 +59,21 @@
       <string>Basic Formatting</string>
      </property>
      <layout class="QVBoxLayout">
+      <property name="spacing">
+       <number>3</number>
+      </property>
+      <property name="leftMargin">
+       <number>5</number>
+      </property>
+      <property name="topMargin">
+       <number>5</number>
+      </property>
+      <property name="rightMargin">
+       <number>5</number>
+      </property>
+      <property name="bottomMargin">
+       <number>5</number>
+      </property>
       <item>
        <widget class="SMFontComboH" name="fontFace_" native="true">
         <property name="sizePolicy">
@@ -225,6 +255,21 @@
       <string>Advanced Formatting</string>
      </property>
      <layout class="QVBoxLayout">
+      <property name="spacing">
+       <number>3</number>
+      </property>
+      <property name="leftMargin">
+       <number>5</number>
+      </property>
+      <property name="topMargin">
+       <number>5</number>
+      </property>
+      <property name="rightMargin">
+       <number>5</number>
+      </property>
+      <property name="bottomMargin">
+       <number>5</number>
+      </property>
       <item>
        <layout class="QHBoxLayout">
         <item>
@@ -401,7 +446,22 @@
      <property name="title">
       <string>Colors</string>
      </property>
-     <layout class="QVBoxLayout">
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <property name="spacing">
+       <number>3</number>
+      </property>
+      <property name="leftMargin">
+       <number>5</number>
+      </property>
+      <property name="topMargin">
+       <number>5</number>
+      </property>
+      <property name="rightMargin">
+       <number>5</number>
+      </property>
+      <property name="bottomMargin">
+       <number>5</number>
+      </property>
       <item>
        <layout class="QHBoxLayout">
         <item>
@@ -545,20 +605,75 @@
        </layout>
       </item>
       <item>
-       <spacer>
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeType">
-         <enum>QSizePolicy::MinimumExpanding</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>72</width>
-          <height>0</height>
-         </size>
-        </property>
-       </spacer>
+       <layout class="QHBoxLayout" name="_2">
+        <item>
+         <widget class="QLabel" name="backIcon">
+          <property name="minimumSize">
+           <size>
+            <width>20</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="maximumSize">
+           <size>
+            <width>22</width>
+            <height>22</height>
+           </size>
+          </property>
+          <property name="text">
+           <string/>
+          </property>
+          <property name="buddy">
+           <cstring>fillColor_</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="SMColorCombo" name="backColor_"/>
+        </item>
+        <item>
+         <widget class="QLabel" name="backShadeLabel">
+          <property name="minimumSize">
+           <size>
+            <width>20</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="maximumSize">
+           <size>
+            <width>22</width>
+            <height>22</height>
+           </size>
+          </property>
+          <property name="text">
+           <string/>
+          </property>
+          <property name="buddy">
+           <cstring>fillShade_</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="SMShadeButton" name="backShade_">
+          <property name="text">
+           <string/>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer>
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
       </item>
      </layout>
     </widget>

Modified: trunk/Scribus/scribus/ui/smpstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/smpstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.cpp	(original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.cpp	Tue Dec 29 09:02:06 2015
@@ -35,6 +35,10 @@
 	lineSpacingLabel->setPixmap(IconManager::instance()->loadPixmap("linespacing2.png"));
 	spaceAboveLabel->setPixmap(IconManager::instance()->loadPixmap("above.png") );
 	spaceBelowLabel->setPixmap(IconManager::instance()->loadPixmap("below.png") );
+	backIcon->setPixmap(IconManager::instance()->loadPixmap("16/color-fill.png"));
+	backShadeLabel->setPixmap(IconManager::instance()->loadPixmap("shade.png"));
+	backColor_->clear();
+	backColor_->addItem(CommonStrings::tr_NoneColor);
 
 	lineSpacingMode->addItem( tr("Fixed Linespacing"));
 	lineSpacingMode->addItem( tr("Automatic Linespacing"));
@@ -134,6 +138,10 @@
 	keepLabelEnd->setToolTip(keepLinesEnd->toolTip());
 	keepTogether->setToolTip("<qt>" + tr("If checked, ensures that the paragraph won't be split across multiple pages or columns") + "</qt>");
 	keepWithNext->setToolTip("<qt>" + tr("If checked, automatically moves the paragraph to the next column or page if the next paragraph isn't on the same page or column") + "</qt>");
+	backColor_->setToolTip(      tr("Background Color"));
+	backShade_->setToolTip(      tr("Background Shade"));
+	backIcon->setToolTip(backColor_->toolTip());
+	backShadeLabel->setToolTip(backShade_->toolTip());
 
 /***********************************/
 /*      End Tooltips               */
@@ -230,6 +238,13 @@
 
 	optMarginDefaultButton->setText(  tr("Reset to Default"));
 	optMarginParentButton->setText(   tr("Use Parent Value"));
+
+	if (backColor_->count() > 0)
+	{
+		bool sigBlocked = backColor_->blockSignals(true);
+		backColor_->setItemText(0, CommonStrings::tr_NoneColor);
+		backColor_->blockSignals(sigBlocked);
+	}
 }
 
 void SMPStyleWidget::unitChange(double oldRatio, double newRatio, int unitIndex)
@@ -248,6 +263,19 @@
 		connect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
 		fillNumerationsCombo();
 	}
+}
+
+void SMPStyleWidget::fillColorCombo(ColorList &colors)
+{
+	backColor_->clear();
+	backColor_->addItem(CommonStrings::tr_NoneColor);
+	ColorList::Iterator itend=colors.end();
+	ScribusDoc* doc = colors.document();
+	for (ColorList::Iterator it = colors.begin(); it != itend; ++it)
+	{
+		backColor_->insertFancyItem(it.value(), doc, it.key());
+	}
+	backColor_->view()->setMinimumWidth(backColor_->view()->maximumViewportSize().width()+24);
 }
 
 void SMPStyleWidget::fillBulletStrEditCombo()
@@ -452,6 +480,11 @@
 		numRestartOtherBox->setParentValue(parent->numOther());
 		numRestartHigherBox->setChecked(pstyle->numHigher(), pstyle->isInhNumHigher());
 		numRestartHigherBox->setParentValue(parent->numHigher());
+
+		backColor_->setCurrentText(pstyle->backgroundColor(), pstyle->isInhBackgroundColor());
+		backColor_->setParentText(parent->backgroundColor());
+		backShade_->setValue(qRound(pstyle->backgroundShade()), pstyle->isInhBackgroundShade());
+		backShade_->setParentValue(qRound(parent->backgroundShade()));
 	}
 	else
 	{
@@ -510,6 +543,8 @@
 		keepLinesEnd->setValue (pstyle->keepLinesEnd());
 		keepTogether->setChecked (pstyle->keepTogether());
 		keepWithNext->setChecked (pstyle->keepWithNext());
+		backColor_->setCurrentText(pstyle->backgroundColor());
+		backShade_->setValue(qRound(pstyle->backgroundShade()));
 	}
 
 	lineSpacing->setEnabled(pstyle->lineSpacingMode() == ParagraphStyle::FixedLineSpacing);
@@ -577,7 +612,51 @@
 		showCStyle(pstyles, cstyles, defLang, unitIndex);
 		showParent(pstyles);
 		checkParEffectState();
-	}
+		showColors(pstyles);
+	}
+}
+
+void SMPStyleWidget::showColors(const QList<ParagraphStyle*> &cstyles)
+{
+	double d = -30000;
+	for (int i = 0; i < cstyles.count(); ++i)
+	{
+		if (d != -30000 && cstyles[i]->backgroundShade() != d)
+		{
+			d = -30000;
+			break;
+		}
+		else
+			d = cstyles[i]->backgroundShade();
+	}
+	if (d == -30000)
+	{
+		backShade_->setValue(21);
+		backShade_->setText( tr("Shade"));
+	}
+	else
+		backShade_->setValue(qRound(d));
+
+	QString s;
+	QString emptyString;
+	for (int i = 0; i < cstyles.count(); ++i)
+	{
+		if (!s.isNull() && s != cstyles[i]->backgroundColor())
+		{
+			s = emptyString;
+			break;
+		}
+		else
+			s = cstyles[i]->backgroundColor();
+	}
+	if (s.isEmpty())
+	{
+		if (backColor_->itemText(backColor_->count() - 1) != "")
+			backColor_->addItem("");
+		backColor_->setCurrentIndex(backColor_->count() - 1);
+	}
+	else
+		backColor_->setCurrentText(s);
 }
 
 void SMPStyleWidget::showLineSpacing(QList<ParagraphStyle*> &pstyles)

Modified: trunk/Scribus/scribus/ui/smpstylewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/smpstylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.h	(original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.h	Tue Dec 29 09:02:06 2015
@@ -42,11 +42,13 @@
 	ParagraphStyle* m_currPStyle;
 	StyleSet<CharStyle> *m_cstyles;
 
+	void fillColorCombo(ColorList &colors);
 	void fillBulletStrEditCombo();
 	void fillNumFormatCombo();
 	void fillNumerationsCombo();
 	void fillNumRestartCombo();
 	void checkParEffectState();
+	void showColors(const QList<ParagraphStyle*> &cstyles);
 	void showLineSpacing(QList<ParagraphStyle*> &pstyles);
 	void showSpaceAB(QList<ParagraphStyle*> &pstyles, int unitIndex);
 	void showDropCap(QList<ParagraphStyle*> &pstyles, QList<CharStyle> &cstyles, int unitIndex);

Modified: trunk/Scribus/scribus/ui/smpstylewidget.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/smpstylewidget.ui
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.ui	(original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.ui	Tue Dec 29 09:02:06 2015
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>695</width>
-    <height>528</height>
+    <height>540</height>
    </rect>
   </property>
   <layout class="QVBoxLayout">
@@ -20,7 +20,7 @@
       <attribute name="title">
        <string>Properties</string>
       </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_4">
+      <layout class="QVBoxLayout" name="verticalLayout_8">
        <item>
         <layout class="QHBoxLayout">
          <property name="spacing">
@@ -585,6 +585,95 @@
         </widget>
        </item>
        <item>
+        <widget class="QGroupBox" name="smColorGroup">
+         <property name="title">
+          <string>Colors</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_4">
+          <property name="spacing">
+           <number>3</number>
+          </property>
+          <property name="leftMargin">
+           <number>5</number>
+          </property>
+          <property name="topMargin">
+           <number>5</number>
+          </property>
+          <property name="rightMargin">
+           <number>5</number>
+          </property>
+          <property name="bottomMargin">
+           <number>5</number>
+          </property>
+          <item>
+           <layout class="QHBoxLayout" name="_6">
+            <item>
+             <widget class="QLabel" name="backIcon">
+              <property name="minimumSize">
+               <size>
+                <width>20</width>
+                <height>0</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>22</width>
+                <height>22</height>
+               </size>
+              </property>
+              <property name="text">
+               <string/>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="SMColorCombo" name="backColor_"/>
+            </item>
+            <item>
+             <widget class="QLabel" name="backShadeLabel">
+              <property name="minimumSize">
+               <size>
+                <width>20</width>
+                <height>0</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>22</width>
+                <height>22</height>
+               </size>
+              </property>
+              <property name="text">
+               <string/>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="SMShadeButton" name="backShade_">
+              <property name="text">
+               <string/>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer>
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
         <spacer name="verticalSpacer">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
@@ -1160,6 +1249,21 @@
    <header>ui/smsccombobox.h</header>
   </customwidget>
   <customwidget>
+   <class>SMScrSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header>ui/smscrspinbox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>SMColorCombo</class>
+   <extends>QComboBox</extends>
+   <header>ui/smcolorcombo.h</header>
+  </customwidget>
+  <customwidget>
+   <class>SMShadeButton</class>
+   <extends>QPushButton</extends>
+   <header>ui/smshadebutton.h</header>
+  </customwidget>
+  <customwidget>
    <class>SMRadioButton</class>
    <extends>QRadioButton</extends>
    <header>ui/smradiobutton.h</header>
@@ -1168,11 +1272,6 @@
    <class>SMCheckBox</class>
    <extends>QCheckBox</extends>
    <header>ui/smcheckbox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>SMScrSpinBox</class>
-   <extends>QSpinBox</extends>
-   <header>ui/smscrspinbox.h</header>
   </customwidget>
   <customwidget>
    <class>SMAlignSelect</class>

Modified: trunk/Scribus/scribus/ui/smtextstyles.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/smtextstyles.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtextstyles.cpp	(original)
+++ trunk/Scribus/scribus/ui/smtextstyles.cpp	Tue Dec 29 09:02:06 2015
@@ -76,6 +76,7 @@
 			m_pwidget->cpage->fillLangComboFromList(languageList);
 			m_pwidget->cpage->fillColorCombo(m_doc->PageColors);
 			m_pwidget->cpage->fontFace_->RebuildList(m_doc);
+			m_pwidget->fillColorCombo(m_doc->PageColors);
 			if (m_unitRatio != m_doc->unitRatio())
 				unitChange();
 		}
@@ -549,6 +550,8 @@
 	connect(m_pwidget->tabList->first_, SIGNAL(valueChanged(double)), this, SLOT(slotFirstLine()));
 
 	connect(m_pwidget->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParentChanged(const QString&)));
+	connect(m_pwidget->backColor_, SIGNAL(activated(const QString&)), this, SLOT(slotBackPColor()));
+	connect(m_pwidget->backShade_, SIGNAL(clicked()), this, SLOT(slotBackPShade()));
 
 	// character attributes
 	connect(m_pwidget->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
@@ -572,6 +575,8 @@
 	connect(m_pwidget->cpage->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
 	connect(m_pwidget->cpage->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
 	connect(m_pwidget->cpage->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotCharParentChanged(const QString&)));
+	connect(m_pwidget->cpage->backColor_, SIGNAL(activated(const QString&)), this, SLOT(slotBackColor()));
+	connect(m_pwidget->cpage->backShade_, SIGNAL(clicked()), this, SLOT(slotBackShade()));
 }
 
 void SMParagraphStyle::removeConnections()
@@ -632,6 +637,8 @@
 	disconnect(m_pwidget->tabList->left_, SIGNAL(valueChanged(double)), this, SLOT(slotLeftIndent()));
 	disconnect(m_pwidget->tabList->right_, SIGNAL(valueChanged(double)), this, SLOT(slotRightIndent()));
 	disconnect(m_pwidget->tabList->first_, SIGNAL(valueChanged(double)), this, SLOT(slotFirstLine()));
+	disconnect(m_pwidget->backColor_, SIGNAL(activated(const QString&)), this, SLOT(slotBackPColor()));
+	disconnect(m_pwidget->backShade_, SIGNAL(clicked()), this, SLOT(slotBackPShade()));
 
 	disconnect(m_pwidget->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
 	disconnect(m_pwidget->cpage->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
@@ -654,6 +661,8 @@
 	disconnect(m_pwidget->cpage->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
 	disconnect(m_pwidget->cpage->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
 	disconnect(m_pwidget->cpage->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotCharParentChanged(const QString&)));
+	disconnect(m_pwidget->cpage->backColor_, SIGNAL(activated(const QString&)), this, SLOT(slotBackColor()));
+	disconnect(m_pwidget->cpage->backShade_, SIGNAL(clicked()), this, SLOT(slotBackShade()));
 }
 
 void SMParagraphStyle::slotLineSpacingMode(int mode)
@@ -1550,6 +1559,84 @@
 	}
 }
 
+void SMParagraphStyle::slotBackPColor()
+{
+	if (m_pwidget->backColor_->useParentValue())
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->resetBackgroundColor();
+	else {
+		QString col( m_pwidget->backColor_->currentText());
+		if (col == CommonStrings::tr_NoneColor)
+			col = CommonStrings::None;
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->setBackgroundColor(col);
+	}
+
+	if (!m_selectionIsDirty)
+	{
+		m_selectionIsDirty = true;
+		emit selectionDirty();
+	}
+}
+
+void SMParagraphStyle::slotBackPShade()
+{
+	if (m_pwidget->backShade_->useParentValue())
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->resetBackgroundShade();
+	else {
+		int fs = m_pwidget->backShade_->getValue();
+
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->setBackgroundShade(fs);
+	}
+
+	if (!m_selectionIsDirty)
+	{
+		m_selectionIsDirty = true;
+		emit selectionDirty();
+	}
+}
+
+void SMParagraphStyle::slotBackColor()
+{
+	if (m_pwidget->cpage->backColor_->useParentValue())
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->charStyle().resetBackgroundColor();
+	else {
+		QString col( m_pwidget->cpage->backColor_->currentText());
+		if (col == CommonStrings::tr_NoneColor)
+			col = CommonStrings::None;
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->charStyle().setBackgroundColor(col);
+	}
+
+	if (!m_selectionIsDirty)
+	{
+		m_selectionIsDirty = true;
+		emit selectionDirty();
+	}
+}
+
+void SMParagraphStyle::slotBackShade()
+{
+	if (m_pwidget->cpage->backShade_->useParentValue())
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->charStyle().resetBackgroundShade();
+	else {
+		int fs = m_pwidget->cpage->backShade_->getValue();
+
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->charStyle().setBackgroundShade(fs);
+	}
+
+	if (!m_selectionIsDirty)
+	{
+		m_selectionIsDirty = true;
+		emit selectionDirty();
+	}
+}
+
 void SMParagraphStyle::slotStrokeColor()
 {
 	if (m_pwidget->cpage->strokeColor_->useParentValue())
@@ -2240,20 +2327,13 @@
 
 	connect(m_page->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
 	connect(m_page->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
-	connect(m_page->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	connect(m_page->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	connect(m_page->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	connect(m_page->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	connect(m_page->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	connect(m_page->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	connect(m_page->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
+	connect(m_page->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	connect(m_page->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	connect(m_page->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	connect(m_page->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	connect(m_page->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	connect(m_page->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	connect(m_page->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
 	connect(m_page->fillColor_, SIGNAL(activated(const QString&)), this, SLOT(slotFillColor()));
 	connect(m_page->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade()));
 	connect(m_page->strokeColor_, SIGNAL(activated(const QString&)), this, SLOT(slotStrokeColor()));
@@ -2265,8 +2345,9 @@
 	connect(m_page->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
 	connect(m_page->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
 	connect(m_page->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
-	connect(m_page->parentCombo, SIGNAL(activated(const QString&)),
-	        this, SLOT(slotParentChanged(const QString&)));
+	connect(m_page->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParentChanged(const QString&)));
+	connect(m_page->backColor_, SIGNAL(activated(const QString&)), this, SLOT(slotBackColor()));
+	connect(m_page->backShade_, SIGNAL(clicked()), this, SLOT(slotBackShade()));
 }
 
 void SMCharacterStyle::removeConnections()
@@ -2276,20 +2357,13 @@
 
 	disconnect(m_page->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
 	disconnect(m_page->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
-	disconnect(m_page->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	disconnect(m_page->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	disconnect(m_page->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	disconnect(m_page->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	disconnect(m_page->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	disconnect(m_page->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
-	disconnect(m_page->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)),
-			   this, SLOT(slotEffectProperties()));
+	disconnect(m_page->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	disconnect(m_page->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	disconnect(m_page->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	disconnect(m_page->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	disconnect(m_page->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	disconnect(m_page->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+	disconnect(m_page->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
 	disconnect(m_page->fillColor_, SIGNAL(activated(const QString&)), this, SLOT(slotFillColor()));
 	disconnect(m_page->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade()));
 	disconnect(m_page->strokeColor_, SIGNAL(activated(const QString&)), this, SLOT(slotStrokeColor()));
@@ -2301,8 +2375,9 @@
 	disconnect(m_page->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
 	disconnect(m_page->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
 	disconnect(m_page->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
-	disconnect(m_page->parentCombo, SIGNAL(activated(const QString&)),
-			this, SLOT(slotParentChanged(const QString&)));
+	disconnect(m_page->parentCombo, SIGNAL(activated(const QString&)),  this, SLOT(slotParentChanged(const QString&)));
+	disconnect(m_page->backColor_, SIGNAL(activated(const QString&)), this, SLOT(slotBackColor()));
+	disconnect(m_page->backShade_, SIGNAL(clicked()), this, SLOT(slotBackShade()));
 }
 
 void SMCharacterStyle::slotFontSize()
@@ -2473,6 +2548,45 @@
 	}
 }
 
+void SMCharacterStyle::slotBackColor()
+{
+	if (m_page->backColor_->useParentValue())
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->resetBackgroundColor();
+	else {
+		QString col(m_page->backColor_->currentText());
+		if (col == CommonStrings::tr_NoneColor)
+			col = CommonStrings::None;
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->setBackgroundColor(col);
+	}
+
+	if (!m_selectionIsDirty)
+	{
+		m_selectionIsDirty = true;
+		emit selectionDirty();
+	}
+}
+
+void SMCharacterStyle::slotBackShade()
+{
+	if (m_page->backShade_->useParentValue())
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->resetBackgroundShade();
+	else {
+		int fs = m_page->backShade_->getValue();
+
+		for (int i = 0; i < m_selection.count(); ++i)
+			m_selection[i]->setBackgroundShade(fs);
+	}
+
+	if (!m_selectionIsDirty)
+	{
+		m_selectionIsDirty = true;
+		emit selectionDirty();
+	}
+}
+
 void SMCharacterStyle::slotStrokeColor()
 {
 	if (m_page->strokeColor_->useParentValue())

Modified: trunk/Scribus/scribus/ui/smtextstyles.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20632&path=/trunk/Scribus/scribus/ui/smtextstyles.h
==============================================================================
--- trunk/Scribus/scribus/ui/smtextstyles.h	(original)
+++ trunk/Scribus/scribus/ui/smtextstyles.h	Tue Dec 29 09:02:06 2015
@@ -108,6 +108,8 @@
 	void slotLeftIndent();
 	void slotRightIndent();
 	void slotFirstLine();
+	void slotBackPColor();
+	void slotBackPShade();
 	// cstyle
 	void slotFontSize();
 	void slotEffects(int e);
@@ -116,6 +118,8 @@
 	void slotFillShade();
 	void slotStrokeColor();
 	void slotStrokeShade();
+	void slotBackColor();
+	void slotBackShade();
 	void slotLanguage();
 	void slotScaleH();
 	void slotScaleV();
@@ -180,6 +184,8 @@
 	void slotEffectProperties();
 	void slotFillColor();
 	void slotFillShade();
+	void slotBackColor();
+	void slotBackShade();
 	void slotStrokeColor();
 	void slotStrokeShade();
 	void slotLanguage();




More information about the scribus-commit mailing list