r22139 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Mon Aug 21 12:24:57 UTC 2017
Author: jghali
Date: Mon Aug 21 12:24:57 2017
New Revision: 22139
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22139
Log:
#14959: Adobe Reader shows "An error exists on this page" on PDF exported from Scribus
Modified:
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/pslib.cpp
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22139&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Mon Aug 21 12:24:57 2017
@@ -2774,7 +2774,8 @@
PutPage(PDF_TransparenzStroke(ite));
if (ite->NamedLStyle.isEmpty())
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
if (ite->patternStrokePath)
{
@@ -2828,7 +2829,8 @@
PutPage(PDF_TransparenzStroke(ite));
if (ite->NamedLStyle.isEmpty())
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
if (ite->patternStrokePath)
{
@@ -2947,7 +2949,8 @@
PutPage(PDF_TransparenzStroke(ite));
if ((ite->NamedLStyle.isEmpty()) && (ite->lineWidth() != 0.0))
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
if (ite->patternStrokePath)
{
@@ -3047,7 +3050,8 @@
PutPage(PDF_TransparenzStroke(ite));
if (ite->NamedLStyle.isEmpty())
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
if (ite->patternStrokePath)
{
@@ -4479,7 +4483,8 @@
tmp += PDF_TransparenzStroke(ite);
if (ite->NamedLStyle.isEmpty()) //&& (ite->lineWidth() != 0.0))
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
if (ite->patternStrokePath)
{
@@ -4600,7 +4605,8 @@
tmp += PDF_TransparenzStroke(ite);
if (ite->NamedLStyle.isEmpty()) //&& (ite->lineWidth() != 0.0))
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
if (ite->patternStrokePath)
{
@@ -4652,7 +4658,8 @@
tmp += PDF_TransparenzStroke(ite);
if (ite->NamedLStyle.isEmpty())
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
if (ite->patternStrokePath)
{
@@ -4772,7 +4779,8 @@
tmp += PDF_TransparenzStroke(ite);
if (ite->NamedLStyle.isEmpty()) //&& (ite->lineWidth() != 0.0))
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
if (ite->patternStrokePath)
{
@@ -4873,7 +4881,8 @@
tmp += PDF_TransparenzStroke(ite);
if (ite->NamedLStyle.isEmpty()) //&& (ite->lineWidth() != 0.0))
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
if (ite->patternStrokePath)
{
@@ -4968,7 +4977,8 @@
tmp += PDF_TransparenzStroke(ite);
if (ite->NamedLStyle.isEmpty()) //&& (ite->lineWidth() != 0.0))
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
if (ite->patternStrokePath)
{
@@ -5440,7 +5450,8 @@
}
if (ite->NamedLStyle.isEmpty())
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = doc.checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
tmp += SetClipPathArray(&arrow);
QByteArray tmpOut;
@@ -6476,18 +6487,19 @@
if (kind == 0)
{
QString itemPattern = currItem->pattern();
- if (itemPattern.isEmpty() || !doc.docPatterns.contains(itemPattern))
+ pat = doc.checkedPattern(itemPattern);
+ if (!pat)
{
if (currItem->fillColor() != CommonStrings::None)
output += putColor(currItem->fillColor(), currItem->fillShade(), true);
return true;
}
- pat = &doc.docPatterns[currItem->pattern()];
}
else if (kind == 1)
{
QString strokePattern = currItem->strokePattern();
- if (strokePattern.isEmpty() || !doc.docPatterns.contains(strokePattern))
+ pat = doc.checkedPattern(strokePattern);
+ if (!pat)
{
if (currItem->lineColor() != CommonStrings::None)
{
@@ -6496,14 +6508,13 @@
}
return true;
}
- pat = &doc.docPatterns[currItem->strokePattern()];
}
else if (kind == 2)
{
QString patternMask = currItem->patternMask();
- if (patternMask.isEmpty() || !doc.docPatterns.contains(patternMask))
+ pat = doc.checkedPattern(patternMask);
+ if (!pat)
return true;
- pat = &doc.docPatterns[currItem->patternMask()];
}
else
return false;
Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22139&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Mon Aug 21 12:24:57 2017
@@ -1849,7 +1849,8 @@
{
if (c->NamedLStyle.isEmpty()) // && (c->lineWidth() != 0.0))
{
- if ((!c->strokePattern().isEmpty()) && (c->patternStrokePath))
+ ScPattern* strokePattern = Doc->checkedPattern(c->strokePattern());
+ if ((strokePattern) && (c->patternStrokePath))
{
QPainterPath path = c->PoLine.toQPainterPath(false);
HandleBrushPattern(c, path, a, PNr, sep, farb, master);
@@ -1861,11 +1862,11 @@
PS_setdash(c->PLineArt, c->DashOffset, c->DashValues);
SetClipPath(&c->PoLine);
PS_closepath();
- if (!c->strokePattern().isEmpty())
+ if (strokePattern)
HandleStrokePattern(c);
else if (c->GrTypeStroke > 0)
HandleGradientFillStroke(c);
- else
+ else if (c->lineColor() != CommonStrings::None)
{
SetColor(c->lineColor(), c->lineShade(), &h, &s, &v, &k);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
@@ -1954,7 +1955,8 @@
PS_setdash(c->PLineArt, c->DashOffset, c->DashValues);
if ((c->NamedLStyle.isEmpty()) && (c->lineWidth() != 0.0))
{
- if ((!c->strokePattern().isEmpty()) && (c->patternStrokePath))
+ ScPattern* strokePattern = Doc->checkedPattern(c->strokePattern());
+ if ((strokePattern) && (c->patternStrokePath))
{
QPainterPath path = c->PoLine.toQPainterPath(false);
HandleBrushPattern(c, path, a, PNr, sep, farb, master);
@@ -1963,11 +1965,11 @@
{
SetClipPath(&c->PoLine);
PS_closepath();
- if (!c->strokePattern().isEmpty())
+ if (strokePattern)
HandleStrokePattern(c);
else if (c->GrTypeStroke > 0)
HandleGradientFillStroke(c);
- else
+ else if (c->lineColor() != CommonStrings::None)
{
SetColor(c->lineColor(), c->lineShade(), &h, &s, &v, &k);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
@@ -1998,7 +2000,8 @@
case PageItem::Line:
if (c->NamedLStyle.isEmpty()) // && (c->lineWidth() != 0.0))
{
- if (!c->strokePattern().isEmpty())
+ ScPattern* strokePattern = Doc->checkedPattern(c->strokePattern());
+ if (strokePattern)
{
if (c->patternStrokePath)
{
@@ -2085,7 +2088,8 @@
{
if (c->NamedLStyle.isEmpty()) //&& (c->lineWidth() != 0.0))
{
- if ((!c->strokePattern().isEmpty()) && (c->patternStrokePath))
+ ScPattern* strokePattern = Doc->checkedPattern(c->strokePattern());
+ if (strokePattern && (c->patternStrokePath))
{
QPainterPath path = c->PoLine.toQPainterPath(false);
HandleBrushPattern(c, path, a, PNr, sep, farb, master);
@@ -2094,7 +2098,7 @@
{
SetClipPath(&c->PoLine);
PS_closepath();
- if (!c->strokePattern().isEmpty())
+ if (strokePattern)
HandleStrokePattern(c);
else if (c->GrTypeStroke > 0)
HandleGradientFillStroke(c);
@@ -2141,7 +2145,8 @@
{
if (c->NamedLStyle.isEmpty()) //&& (c->lineWidth() != 0.0))
{
- if ((!c->strokePattern().isEmpty()) && (c->patternStrokePath))
+ ScPattern* strokePattern = Doc->checkedPattern(c->strokePattern());
+ if (strokePattern && (c->patternStrokePath))
{
QPainterPath path = c->PoLine.toQPainterPath(false);
HandleBrushPattern(c, path, a, PNr, sep, farb, master);
@@ -2149,7 +2154,7 @@
else
{
SetClipPath(&c->PoLine, false);
- if (!c->strokePattern().isEmpty())
+ if (strokePattern)
HandleStrokePattern(c);
else if (c->GrTypeStroke > 0)
HandleGradientFillStroke(c);
@@ -2222,7 +2227,8 @@
PS_save();
if (c->NamedLStyle.isEmpty()) //&& (c->lineWidth() != 0.0))
{
- if ((!c->strokePattern().isEmpty()) && (c->patternStrokePath))
+ ScPattern* strokePattern = Doc->checkedPattern(c->strokePattern());
+ if (strokePattern && (c->patternStrokePath))
{
QPainterPath path = c->PoLine.toQPainterPath(false);
HandleBrushPattern(c, path, a, PNr, sep, farb, master);
@@ -2230,7 +2236,7 @@
else
{
SetClipPath(&c->PoLine, false);
- if (!c->strokePattern().isEmpty())
+ if (strokePattern)
HandleStrokePattern(c);
else if (c->GrTypeStroke > 0)
HandleGradientFillStroke(c);
@@ -2879,7 +2885,8 @@
{
if (ite->NamedLStyle.isEmpty()) // && (ite->lineWidth() != 0.0))
{
- if ((!ite->strokePattern().isEmpty()) && (ite->patternStrokePath))
+ ScPattern* strokePattern = Doc->checkedPattern(ite->strokePattern());
+ if (strokePattern && (ite->patternStrokePath))
{
QPainterPath path = ite->PoLine.toQPainterPath(false);
HandleBrushPattern(ite, path, page, PNr, sep, farb, true);
@@ -2891,11 +2898,11 @@
PS_setdash(ite->PLineArt, ite->DashOffset, ite->DashValues);
SetClipPath(&ite->PoLine);
PS_closepath();
- if (!ite->strokePattern().isEmpty())
+ if (strokePattern)
HandleStrokePattern(ite);
else if (ite->GrTypeStroke > 0)
HandleGradientFillStroke(ite);
- else
+ else if (ite->lineColor() != CommonStrings::None)
{
SetColor(ite->lineColor(), ite->lineShade(), &h, &s, &v, &k);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
@@ -2935,7 +2942,8 @@
PS_save();
if (ite->NamedLStyle.isEmpty()) //&& (c->lineWidth() != 0.0))
{
- if ((!ite->strokePattern().isEmpty()) && (ite->patternStrokePath))
+ ScPattern* strokePattern = Doc->checkedPattern(ite->strokePattern());
+ if (strokePattern && (ite->patternStrokePath))
{
QPainterPath path = ite->PoLine.toQPainterPath(false);
HandleBrushPattern(ite, path, mPage, PNr, sep, farb, true);
@@ -2943,7 +2951,7 @@
else
{
SetClipPath(&ite->PoLine, false);
- if (!ite->strokePattern().isEmpty())
+ if (strokePattern)
HandleStrokePattern(ite);
else if (ite->GrTypeStroke > 0)
HandleGradientFillStroke(ite);
@@ -4244,7 +4252,8 @@
arrow.map(arrowTrans);
if (ite->NamedLStyle.isEmpty())
{
- if (!ite->strokePattern().isEmpty())
+ ScPattern* strokePattern = m_Doc->checkedPattern(ite->strokePattern());
+ if (strokePattern)
{
PS_newpath();
SetClipPath(&arrow);
More information about the scribus-commit
mailing list