summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan The Thanh <hanthethanh@gmail.com>2010-03-24 13:08:02 +0000
committerHan The Thanh <hanthethanh@gmail.com>2010-03-24 13:08:02 +0000
commitb43a81e1ba916e7daaf0559ae06791e720533e7e (patch)
tree57bab2b37d7272724b32bb0054fc3a8afdff1583
parent0d4e8decfdf61900e814c436111d0f576519213a (diff)
minor fixes for pdftex
git-svn-id: svn://tug.org/texlive/trunk@17547 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftex.defines2
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftex.web35
-rw-r--r--Build/source/texk/web2c/pdftexdir/ptexlib.h2
-rw-r--r--Build/source/texk/web2c/pdftexdir/utils.c12
4 files changed, 30 insertions, 21 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.defines b/Build/source/texk/web2c/pdftexdir/pdftex.defines
index 7831314d8d2..5ea4c4e450a 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftex.defines
+++ b/Build/source/texk/web2c/pdftexdir/pdftex.defines
@@ -81,7 +81,7 @@ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@define procedure checkpdfrestore();
@define procedure pdfshipoutbegin();
@define procedure pdfshipoutend();
-@define procedure pdfsetmatrix();
+@define function pdfsetmatrix();
@define procedure matrixtransformpoint();
@define procedure matrixtransformrect();
@define function matrixused;
diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.web b/Build/source/texk/web2c/pdftexdir/pdftex.web
index 0c89a23618f..ff574014306 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftex.web
+++ b/Build/source/texk/web2c/pdftexdir/pdftex.web
@@ -18276,17 +18276,21 @@ begin
selector:=old_setting;
str_room(7);
str_pool[pool_ptr] := 0; { make C string for pdfsetmatrix }
- pdfsetmatrix(str_start[str_ptr], cur_h, cur_page_height - cur_v);
- str_room(7);
- append_char(" ");
- append_char("0");
- append_char(" ");
- append_char("0");
- append_char(" ");
- append_char("c");
- append_char("m");
- s := make_string;
- literal(s, set_origin, false);
+ if pdfsetmatrix(str_start[str_ptr], cur_h, cur_page_height - cur_v) = 1 then begin
+ str_room(7);
+ append_char(" ");
+ append_char("0");
+ append_char(" ");
+ append_char("0");
+ append_char(" ");
+ append_char("c");
+ append_char("m");
+ s := make_string;
+ literal(s, set_origin, false);
+ end
+ else begin
+ pdf_error("\pdfsetmatrix", "Unrecognized format.");
+ end;
flush_str(s);
end;
@@ -35366,8 +35370,13 @@ special_node:special_out(p);
language_node:do_nothing;
pdf_save_pos_node:
@<Save current position in DVI mode@>;
-othercases confusion("ext4")
-@:this can't happen ext4}{\quad ext4@>
+others: begin
+ if (pdftex_first_extension_code <= subtype(p)) and (subtype(p) <= pdftex_last_extension_code) then
+ pdf_error("ext4", "pdf node ended up in DVI mode")
+ else
+ confusion("ext4")
+ @:this can't happen ext4}{\quad ext4@>
+end;
endcases;
end;
diff --git a/Build/source/texk/web2c/pdftexdir/ptexlib.h b/Build/source/texk/web2c/pdftexdir/ptexlib.h
index 4adda8a455c..be316d9ea99 100644
--- a/Build/source/texk/web2c/pdftexdir/ptexlib.h
+++ b/Build/source/texk/web2c/pdftexdir/ptexlib.h
@@ -261,7 +261,7 @@ extern void checkpdfsave(int cur_h, int cur_v);
extern void checkpdfrestore(int cur_h, int cur_v);
extern void pdfshipoutbegin(boolean shipping_page);
extern void pdfshipoutend(boolean shipping_page);
-extern void pdfsetmatrix(poolpointer in, scaled cur_h, scaled cur_v);
+extern integer pdfsetmatrix(poolpointer in, scaled cur_h, scaled cur_v);
extern void matrixtransformpoint(scaled x, scaled y);
extern void matrixtransformrect(scaled llx, scaled lly, scaled urx, scaled ury);
extern boolean matrixused(void);
diff --git a/Build/source/texk/web2c/pdftexdir/utils.c b/Build/source/texk/web2c/pdftexdir/utils.c
index 1253e8d07ab..14d00a68549 100644
--- a/Build/source/texk/web2c/pdftexdir/utils.c
+++ b/Build/source/texk/web2c/pdftexdir/utils.c
@@ -1691,19 +1691,18 @@ void pdfshipoutend(boolean shipping_page)
*/
-void pdfsetmatrix(poolpointer in, scaled cur_h, scaled cur_v)
+integer pdfsetmatrix(poolpointer in, scaled cur_h, scaled cur_v)
{
/* Argument of \pdfsetmatrix starts with strpool[in] and ends
before strpool[poolptr]. */
matrix_entry x, *y, *z;
+ char dummy;
if (page_mode) {
- if (sscanf((const char *) &strpool[in], " %lf %lf %lf %lf ",
- &x.a, &x.b, &x.c, &x.d) != 4) {
- pdftex_warn("Unrecognized format of \\pdfsetmatrix{%s}",
- &strpool[poolptr]);
- return;
+ if (sscanf((const char *) &strpool[in], " %lf %lf %lf %lf %c",
+ &x.a, &x.b, &x.c, &x.d, &dummy) != 4) {
+ return 0; /* failure */
}
/* calculate this transformation matrix */
x.e = (double) cur_h *(1.0 - x.a) - (double) cur_v *x.c;
@@ -1728,6 +1727,7 @@ void pdfsetmatrix(poolpointer in, scaled cur_h, scaled cur_v)
}
matrix_stack_used++;
}
+ return 1; /* success */
}
/* Apply matrix to point (x,y)