summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2010-09-21 19:07:12 +0100
committerAlbert Astals Cid <aacid@kde.org>2010-09-21 19:07:12 +0100
commitdfdf3602bde47d1be7788a44722c258bfa0c6d6e (patch)
treec32482277a34b9bb82b819c8794593e523f5cb0f
parent01c85c08305bae16242f5979ab107fa5bb5f5100 (diff)
Give a value to color.c[i]
Might not be the better solution but it's better than having a random value there Found thanks to PDF provided by Joel Voss of Leviathan Security Group
-rw-r--r--poppler/Gfx.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 919086e0..7b85d79a 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -1530,12 +1530,14 @@ void Gfx::opSetFillColorN(Object args[], int numArgs) {
error(getPos(), "Incorrect number of arguments in 'scn' command");
return;
}
for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
if (args[i].isNum()) {
color.c[i] = dblToCol(args[i].getNum());
+ } else {
+ color.c[i] = 0; // TODO Investigate if this is what Adobe does
}
}
state->setFillColor(&color);
out->updateFillColor(state);
}
if (args[numArgs-1].isName() &&
@@ -1549,12 +1551,14 @@ void Gfx::opSetFillColorN(Object args[], int numArgs) {
return;
}
state->setFillPattern(NULL);
for (i = 0; i < numArgs && i < gfxColorMaxComps; ++i) {
if (args[i].isNum()) {
color.c[i] = dblToCol(args[i].getNum());
+ } else {
+ color.c[i] = 0; // TODO Investigate if this is what Adobe does
}
}
state->setFillColor(&color);
out->updateFillColor(state);
}
}
@@ -1573,12 +1577,14 @@ void Gfx::opSetStrokeColorN(Object args[], int numArgs) {
error(getPos(), "Incorrect number of arguments in 'SCN' command");
return;
}
for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
if (args[i].isNum()) {
color.c[i] = dblToCol(args[i].getNum());
+ } else {
+ color.c[i] = 0; // TODO Investigate if this is what Adobe does
}
}
state->setStrokeColor(&color);
out->updateStrokeColor(state);
}
if (args[numArgs-1].isName() &&
@@ -1592,12 +1598,14 @@ void Gfx::opSetStrokeColorN(Object args[], int numArgs) {
return;
}
state->setStrokePattern(NULL);
for (i = 0; i < numArgs && i < gfxColorMaxComps; ++i) {
if (args[i].isNum()) {
color.c[i] = dblToCol(args[i].getNum());
+ } else {
+ color.c[i] = 0; // TODO Investigate if this is what Adobe does
}
}
state->setStrokeColor(&color);
out->updateStrokeColor(state);
}
}