r20636 by fschmid -
scribus-commit
scribus-commit at lists.scribus.net
Tue Dec 29 14:16:45 UTC 2015
Author: fschmid
Date: Tue Dec 29 14:16:45 2015
New Revision: 20636
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20636
Log:
Some fixes for paragraph background rendering.
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/pages/importpages.cpp
trunk/Scribus/scribus/pslib.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/styles/charstyle.attrdefs.cxx
trunk/Scribus/scribus/styles/charstyle.cpp
trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
trunk/Scribus/scribus/ui/smcstylewidget.cpp
trunk/Scribus/scribus/ui/smtextstyles.cpp
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Tue Dec 29 14:16:45 2015
@@ -3704,10 +3704,11 @@
if ((!m_Doc->RePos) && (LineStyle.backgroundColor() != CommonStrings::None))
{
p->save();
+ p->setAntialiasing(false);
p->setFillMode(1);
+ p->setStrokeMode(0);
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;
@@ -3716,6 +3717,8 @@
adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
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)
@@ -3728,8 +3731,9 @@
else if (firstLineOffset() == FLOPRealGlyphHeight || firstLineOffset() == FLOPFontAscent)
y1 -= ls.ascent;
else
- y1 -= LineStyle.lineSpacing();
+ y1 -= ls.ascent + (hl - (ls.ascent + ls.descent)) / 2.0;
p->drawRect(ls.colLeft + adjX, y1, columnWidth() - adjX - LineStyle.rightMargin(), hl);
+ p->setAntialiasing(true);
p->restore();
}
// end background code
@@ -3831,9 +3835,9 @@
{
glyphs = itemText.getGlyphs(a);
const CharStyle& charStyle(itemText.charStyle(a));
- if ((!m_Doc->RePos) && (charStyle.backgroundColor() != CommonStrings::None))
- {
- SetQColor(&tmp, charStyle.backgroundColor(), charStyle.backgroundShade());
+ if ((!m_Doc->RePos) && (charStyle.backColor() != CommonStrings::None))
+ {
+ SetQColor(&tmp, charStyle.backColor(), charStyle.backShade());
const ParagraphStyle& LineStyle = itemText.paragraphStyle(ls.firstItem);
double y1 = ls.y;
double hl = ls.height;
@@ -3866,9 +3870,9 @@
}
else
scr = QRectF(CurXB, y1, glyphs->wide(), hl);
- if ((oldBack == "") || ((oldBack == charStyle.backgroundColor()) && (oldShade == charStyle.backgroundShade())))
+ if ((oldBack == "") || ((oldBack == charStyle.backColor()) && (oldShade == charStyle.backShade())))
scrG |= scr;
- else if ((oldBack != charStyle.backgroundColor()) || (oldShade != charStyle.backgroundShade()))
+ else if ((oldBack != charStyle.backColor()) || (oldShade != charStyle.backShade()))
{
p->save();
p->setFillMode(1);
@@ -3879,8 +3883,8 @@
p->restore();
scrG = scr;
}
- oldBack = charStyle.backgroundColor();
- oldShade = charStyle.backgroundShade();
+ oldBack = charStyle.backColor();
+ oldShade = charStyle.backShade();
}
else
{
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Tue Dec 29 14:16:45 2015
@@ -5397,6 +5397,8 @@
adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
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)
@@ -5409,15 +5411,16 @@
else if (ite->firstLineOffset() == FLOPRealGlyphHeight || ite->firstLineOffset() == FLOPFontAscent)
y1 -= ls.ascent;
else
- y1 -= LineStyle.lineSpacing();
+ y1 -= ls.ascent + (hl - (ls.ascent + ls.descent)) / 2.0;
QRectF scr(ls.colLeft + adjX, y1, ite->asTextFrame()->columnWidth() - adjX - LineStyle.rightMargin(), hl);
tmp += "q\n";
+ tmp += "n\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 += "h\nf\n";
tmp += "Q\n";
}
// end background code
@@ -5437,9 +5440,9 @@
{
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);
+ if (charStyle.backColor() != CommonStrings::None)
+ {
+ colorB = putColor(charStyle.backColor(), charStyle.backShade(), true);
// This code is for rendering character background color.
const ParagraphStyle& LineStyle = ite->itemText.paragraphStyle(ls.firstItem);
double y1 = ls.y;
@@ -5473,22 +5476,23 @@
}
else
scrG = QRectF(CurXB, y1, glyphs->wide(), hl);
- if ((oldBack == "") || ((oldBack == charStyle.backgroundColor()) && (oldShade == charStyle.backgroundShade())))
+ if ((oldBack == "") || ((oldBack == charStyle.backColor()) && (oldShade == charStyle.backShade())))
scr |= scrG;
- else if ((oldBack != charStyle.backgroundColor()) || (oldShade != charStyle.backgroundShade()))
+ else if ((oldBack != charStyle.backColor()) || (oldShade != charStyle.backShade()))
{
tmp += "q\n";
+ tmp += "n\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 += "h\nf\n";
tmp += "Q\n";
scr = scrG;
}
- oldBack = charStyle.backgroundColor();
- oldShade = charStyle.backgroundShade();
+ oldBack = charStyle.backColor();
+ oldShade = charStyle.backShade();
}
else
{
@@ -5500,7 +5504,7 @@
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 += "h\nf\n";
tmp += "Q\n";
}
oldBack = "";
@@ -5517,7 +5521,7 @@
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 += "h\nf\n";
tmp += "Q\n";
}
for (int d = ls.firstItem; d <= ls.lastItem; ++d)
Modified: trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&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 14:16:45 2015
@@ -1184,6 +1184,8 @@
adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
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)
@@ -1196,7 +1198,7 @@
else if (Item->firstLineOffset() == FLOPRealGlyphHeight || Item->firstLineOffset() == FLOPFontAscent)
y1 -= ls.ascent;
else
- y1 -= LineStyle.lineSpacing();
+ y1 -= ls.ascent + (hl - (ls.ascent + ls.descent)) / 2.0;
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());
@@ -1225,10 +1227,10 @@
{
const GlyphLayout* glyphs(Item->itemText.getGlyphs(a));
const CharStyle& charStyle(Item->itemText.charStyle(a));
- if (charStyle.backgroundColor() != CommonStrings::None)
+ if (charStyle.backColor() != CommonStrings::None)
{
// This code is for rendering character background color.
- colorB = SetColor(charStyle.backgroundColor(), charStyle.backgroundShade());
+ colorB = SetColor(charStyle.backColor(), charStyle.backShade());
const ParagraphStyle& LineStyle = Item->itemText.paragraphStyle(ls.firstItem);
double y1 = ls.y;
double hl = ls.height;
@@ -1261,9 +1263,9 @@
}
else
scrG = QRectF(CurXB, y1, glyphs->wide(), hl);
- if ((oldBack == "") || ((oldBack == charStyle.backgroundColor()) && (oldShade == charStyle.backgroundShade())))
+ if ((oldBack == "") || ((oldBack == charStyle.backColor()) && (oldShade == charStyle.backShade())))
scr |= scrG;
- else if ((oldBack != charStyle.backgroundColor()) || (oldShade != charStyle.backgroundShade()))
+ else if ((oldBack != charStyle.backColor()) || (oldShade != charStyle.backShade()))
{
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());
@@ -1276,8 +1278,8 @@
ob.appendChild(glyS);
scr = scrG;
}
- oldBack = charStyle.backgroundColor();
- oldShade = charStyle.backgroundShade();
+ oldBack = charStyle.backColor();
+ oldShade = charStyle.backShade();
// end background code
}
else
Modified: trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&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 14:16:45 2015
@@ -894,6 +894,8 @@
adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
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)
@@ -938,10 +940,10 @@
{
const GlyphLayout* glyphs(Item->itemText.getGlyphs(a));
const CharStyle& charStyle(Item->itemText.charStyle(a));
- if (charStyle.backgroundColor() != CommonStrings::None)
+ if (charStyle.backColor() != CommonStrings::None)
{
// This code is for rendering character background color.
- colorB = SetColor(charStyle.backgroundColor(), charStyle.backgroundShade(), 0);
+ colorB = SetColor(charStyle.backColor(), charStyle.backShade(), 0);
const ParagraphStyle& LineStyle = Item->itemText.paragraphStyle(ls.firstItem);
double y1 = ls.y;
double hl = ls.height;
@@ -974,9 +976,9 @@
}
else
scrG = QRectF(CurXB, y1, glyphs->wide(), hl);
- if ((oldBack == "") || ((oldBack == charStyle.backgroundColor()) && (oldShade == charStyle.backgroundShade())))
+ if ((oldBack == "") || ((oldBack == charStyle.backColor()) && (oldShade == charStyle.backShade())))
scr |= scrG;
- else if ((oldBack != charStyle.backgroundColor()) || (oldShade != charStyle.backgroundShade()))
+ else if ((oldBack != charStyle.backColor()) || (oldShade != charStyle.backShade()))
{
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);
@@ -989,8 +991,8 @@
grp.appendChild(glyS);
scr = scrG;
}
- oldBack = charStyle.backgroundColor();
- oldShade = charStyle.backgroundShade();
+ oldBack = charStyle.backColor();
+ oldShade = charStyle.backShade();
}
else
{
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&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 14:16:45 2015
@@ -2469,10 +2469,10 @@
static const QString BCOLOR("BCOLOR");
if (attrs.hasAttribute(BCOLOR))
- newStyle.setBackgroundColor(attrs.valueAsString(BCOLOR, CommonStrings::None));
+ newStyle.setBackColor(attrs.valueAsString(BCOLOR, CommonStrings::None));
static const QString BSHADE("BSHADE");
if (attrs.hasAttribute(BSHADE))
- newStyle.setBackgroundShade(attrs.valueAsInt(BSHADE, 100));
+ newStyle.setBackShade(attrs.valueAsInt(BSHADE, 100));
static const QString SSHADE("SSHADE");
if (attrs.hasAttribute(SSHADE))
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&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 14:16:45 2015
@@ -785,10 +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.isInhBackColor())
+ docu.writeAttribute("BCOLOR", style.backColor());
+ if ( ! style.isInhBackShade())
+ docu.writeAttribute("BSHADE", style.backShade());
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=20636&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 14:16:45 2015
@@ -555,7 +555,7 @@
tmp.setSpotColor(false);
tmp.setRegistrationColor(false);
QString fNam = m_Doc->PageColors.tryAddColor("FromDocX"+colour.name(), tmp);
- pStyle.charStyle().setBackgroundColor(fNam);
+ pStyle.charStyle().setBackColor(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=20636&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 14:16:45 2015
@@ -1863,7 +1863,7 @@
tmpCStyle.setFont((*m_Doc->AllFonts)[oStyle.fontName]);
tmpCStyle.setFontSize(oStyle.fontSize * 10);
tmpCStyle.setFillColor(oStyle.CurrColorText);
- tmpCStyle.setBackgroundColor(oStyle.CurrColorBText);
+ tmpCStyle.setBackColor(oStyle.CurrColorBText);
StyleFlag styleEffects = tmpCStyle.effects();
if ((oStyle.textPos.startsWith("super")) || (oStyle.textPos.startsWith("sub")))
{
Modified: trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&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 14:16:45 2015
@@ -2056,7 +2056,7 @@
if (actStyle.fontColor.valid)
tmpCStyle.setFillColor(actStyle.fontColor.value);
if (actStyle.backColor.valid)
- tmpCStyle.setBackgroundColor(actStyle.backColor.value);
+ tmpCStyle.setBackColor(actStyle.backColor.value);
}
}
Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Tue Dec 29 14:16:45 2015
@@ -5083,6 +5083,8 @@
adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
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)
@@ -5095,7 +5097,7 @@
else if (ite->firstLineOffset() == FLOPRealGlyphHeight || ite->firstLineOffset() == FLOPFontAscent)
y1 -= ls.ascent;
else
- y1 -= LineStyle.lineSpacing();
+ y1 -= ls.ascent + (hl - (ls.ascent + ls.descent)) / 2.0;
QRectF scr(ls.colLeft + adjX, y1, ite->asTextFrame()->columnWidth() - adjX - LineStyle.rightMargin(), hl);
PS_save();
int h, s, v, k;
@@ -5126,11 +5128,11 @@
{
const GlyphLayout* glyphs(ite->itemText.getGlyphs(a));
const CharStyle& charStyle(ite->itemText.charStyle(a));
- if (charStyle.backgroundColor() != CommonStrings::None)
+ if (charStyle.backColor() != CommonStrings::None)
{
// This code is for rendering character background color.
int h, s, v, k;
- SetColor(charStyle.backgroundColor(), charStyle.backgroundShade(), &h, &s, &v, &k);
+ SetColor(charStyle.backColor(), charStyle.backShade(), &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;
@@ -5164,9 +5166,9 @@
}
else
scr = QRectF(CurXB, y1, glyphs->wide(), hl);
- if ((oldBack == "") || ((oldBack == charStyle.backgroundColor()) && (oldShade == charStyle.backgroundShade())))
+ if ((oldBack == "") || ((oldBack == charStyle.backColor()) && (oldShade == charStyle.backShade())))
scrG |= scr;
- else if ((oldBack != charStyle.backgroundColor()) || (oldShade != charStyle.backgroundShade()))
+ else if ((oldBack != charStyle.backColor()) || (oldShade != charStyle.backShade()))
{
PS_save();
PS_moveto(scrG.x(), -scrG.y());
@@ -5180,8 +5182,8 @@
PS_restore();
scrG = scr;
}
- oldBack = charStyle.backgroundColor();
- oldShade = charStyle.backgroundShade();
+ oldBack = charStyle.backColor();
+ oldShade = charStyle.backShade();
}
else
{
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Tue Dec 29 14:16:45 2015
@@ -527,8 +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.setBackColor(CommonStrings::None);
+ cstyle.setBackShade(100);
cstyle.setBaselineOffset(0);
cstyle.setShadowXOffset(50);
cstyle.setShadowYOffset(-50);
@@ -3816,7 +3816,7 @@
continue;
}
// Current paragraph style colors
- if ((it.key() == currentStyle.charStyle().fillColor()) || (it.key() == currentStyle.charStyle().strokeColor()) || (it.key() == currentStyle.charStyle().backgroundColor()))
+ if ((it.key() == currentStyle.charStyle().fillColor()) || (it.key() == currentStyle.charStyle().strokeColor()) || (it.key() == currentStyle.charStyle().backColor()))
found = true;
// Resources colors
if (!found)
@@ -5777,6 +5777,7 @@
void ScribusDoc::itemAddDetails(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, PageItem* newItem)
{
+ ParagraphStyle defaultParagraphStyle;
Q_ASSERT(newItem->realItemType()==itemType);
switch( itemType )
{
@@ -5804,6 +5805,9 @@
newItem->setFillShade(docPrefsData.itemToolPrefs.textFillColorShade);
newItem->setLineColor(docPrefsData.itemToolPrefs.textLineColor);
newItem->setLineShade(docPrefsData.itemToolPrefs.textLineColorShade);
+ defaultParagraphStyle.setParent(CommonStrings::DefaultParagraphStyle);
+ defaultParagraphStyle.charStyle().setParent(CommonStrings::DefaultCharacterStyle);
+ newItem->itemText.setDefaultStyle(defaultParagraphStyle);
break;
case PageItem::Line:
newItem->PLineArt = Qt::PenStyle(docPrefsData.itemToolPrefs.lineStyle);
@@ -8188,14 +8192,14 @@
if (farbe == CommonStrings::tr_NoneColor)
farbe = CommonStrings::None;
CharStyle newStyle;
- newStyle.setBackgroundColor(farbe);
+ newStyle.setBackColor(farbe);
itemSelection_ApplyCharStyle(newStyle, customSelection, "BACK_COLOR");
}
void ScribusDoc::itemSelection_SetBackgroundShade(int sha, Selection* customSelection)
{
CharStyle newStyle;
- newStyle.setBackgroundShade(sha);
+ newStyle.setBackShade(sha);
itemSelection_ApplyCharStyle(newStyle, customSelection, "BACK_SHADE");
}
Modified: trunk/Scribus/scribus/styles/charstyle.attrdefs.cxx
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&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 14:16:45 2015
@@ -33,8 +33,8 @@
ATTRDEF(double, wordTracking, WordTracking, 1.0)
ATTRDEF(QString, fillColor, FillColor, "None")
ATTRDEF(QString, strokeColor, StrokeColor, "Black")
-ATTRDEF(QString, backgroundColor, BackgroundColor, "None")
-ATTRDEF(double, backgroundShade, BackgroundShade, 100)
+ATTRDEF(QString, backColor, BackColor, "None")
+ATTRDEF(double, backShade, BackShade, 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=20636&path=/trunk/Scribus/scribus/styles/charstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/styles/charstyle.cpp (original)
+++ trunk/Scribus/scribus/styles/charstyle.cpp Tue Dec 29 14:16:45 2015
@@ -382,7 +382,7 @@
lists.collectCharStyle(sty->name());
lists.collectColor(fillColor());
lists.collectColor(strokeColor());
- lists.collectColor(backgroundColor());
+ lists.collectColor(backColor());
lists.collectFont(font().scName());
}
@@ -397,8 +397,8 @@
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 (!inh_BackColor && (it = newNames.colors().find(backColor())) != newNames.colors().end())
+ setBackColor(it.value());
if (hasParent() && (it = newNames.charStyles().find(parent())) != newNames.charStyles().end())
setParent(it.value());
Modified: trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&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 14:16:45 2015
@@ -381,7 +381,7 @@
void SlaDocumentRtfOutput::setCharacterPatternBackgroundColour(const int colourIndex)
{
if ((m_colourTable.count() != 0) && (colourIndex < m_colourTable.count()))
- m_textCharStyle.top().setBackgroundColor(m_colourTable.value(colourIndex));
+ m_textCharStyle.top().setBackColor(m_colourTable.value(colourIndex));
}
void SlaDocumentRtfOutput::setFont(const int fontIndex)
Modified: trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&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 14:16:45 2015
@@ -227,7 +227,7 @@
showOutlineW (charStyle.outlineWidth());
showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset());
- showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.backgroundColor(), charStyle.strokeShade(), charStyle.fillShade(), charStyle.backgroundShade());
+ showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.backColor(), charStyle.strokeShade(), charStyle.fillShade(), charStyle.backShade());
showTextEffects(charStyle.effects());
showStrikeThru(charStyle.strikethruOffset() , charStyle.strikethruWidth());
showUnderline (charStyle.underlineOffset(), charStyle.underlineWidth());
@@ -242,7 +242,7 @@
showOutlineW (charStyle.outlineWidth());
showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset());
- showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.backgroundColor(), charStyle.strokeShade(), charStyle.fillShade(), charStyle.backgroundShade());
+ showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.backColor(), charStyle.strokeShade(), charStyle.fillShade(), charStyle.backShade());
showTextEffects(charStyle.effects());
showStrikeThru(charStyle.strikethruOffset() , charStyle.strikethruWidth());
showUnderline (charStyle.underlineOffset(), charStyle.underlineWidth());
Modified: trunk/Scribus/scribus/ui/smcstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&path=/trunk/Scribus/scribus/ui/smcstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.cpp Tue Dec 29 14:16:45 2015
@@ -230,11 +230,11 @@
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()));
+ backColor_->setCurrentText(cstyle->backColor(), cstyle->isInhBackColor());
+ backColor_->setParentText(parent->backColor());
+
+ backShade_->setValue(qRound(cstyle->backShade()), cstyle->isInhBackShade());
+ backShade_->setParentValue(qRound(parent->backShade()));
fontFace_->setCurrentFont(cstyle->font().scName(), cstyle->isInhFont());
fontFace_->setParentFont(parent->font().scName());
@@ -252,8 +252,8 @@
strokeShade_->setValue(qRound(cstyle->strokeShade()));
fillColor_->setCurrentText(cstyle->fillColor());
strokeColor_->setCurrentText(cstyle->strokeColor());
- backColor_->setCurrentText(cstyle->backgroundColor());
- backShade_->setValue(qRound(cstyle->backgroundShade()));
+ backColor_->setCurrentText(cstyle->backColor());
+ backShade_->setValue(qRound(cstyle->backShade()));
fontFace_->setCurrentFont(cstyle->font().scName());
}
@@ -533,13 +533,13 @@
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 && cstyles[i]->backShade() != d)
+ {
+ d = -30000;
+ break;
+ }
+ else
+ d = cstyles[i]->backShade();
}
if (d == -30000)
{
@@ -593,13 +593,13 @@
s = emptyString;
for (int i = 0; i < cstyles.count(); ++i)
{
- if (!s.isNull() && s != cstyles[i]->backgroundColor())
+ if (!s.isNull() && s != cstyles[i]->backColor())
{
s = emptyString;
break;
}
else
- s = cstyles[i]->backgroundColor();
+ s = cstyles[i]->backColor();
}
if (s.isEmpty())
{
Modified: trunk/Scribus/scribus/ui/smtextstyles.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20636&path=/trunk/Scribus/scribus/ui/smtextstyles.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtextstyles.cpp (original)
+++ trunk/Scribus/scribus/ui/smtextstyles.cpp Tue Dec 29 14:16:45 2015
@@ -1602,13 +1602,13 @@
{
if (m_pwidget->cpage->backColor_->useParentValue())
for (int i = 0; i < m_selection.count(); ++i)
- m_selection[i]->charStyle().resetBackgroundColor();
+ m_selection[i]->charStyle().resetBackColor();
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);
+ m_selection[i]->charStyle().setBackColor(col);
}
if (!m_selectionIsDirty)
@@ -1622,12 +1622,12 @@
{
if (m_pwidget->cpage->backShade_->useParentValue())
for (int i = 0; i < m_selection.count(); ++i)
- m_selection[i]->charStyle().resetBackgroundShade();
+ m_selection[i]->charStyle().resetBackShade();
else {
int fs = m_pwidget->cpage->backShade_->getValue();
for (int i = 0; i < m_selection.count(); ++i)
- m_selection[i]->charStyle().setBackgroundShade(fs);
+ m_selection[i]->charStyle().setBackShade(fs);
}
if (!m_selectionIsDirty)
@@ -2552,13 +2552,13 @@
{
if (m_page->backColor_->useParentValue())
for (int i = 0; i < m_selection.count(); ++i)
- m_selection[i]->resetBackgroundColor();
+ m_selection[i]->resetBackColor();
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);
+ m_selection[i]->setBackColor(col);
}
if (!m_selectionIsDirty)
@@ -2572,12 +2572,12 @@
{
if (m_page->backShade_->useParentValue())
for (int i = 0; i < m_selection.count(); ++i)
- m_selection[i]->resetBackgroundShade();
+ m_selection[i]->resetBackShade();
else {
int fs = m_page->backShade_->getValue();
for (int i = 0; i < m_selection.count(); ++i)
- m_selection[i]->setBackgroundShade(fs);
+ m_selection[i]->setBackShade(fs);
}
if (!m_selectionIsDirty)
More information about the scribus-commit
mailing list