summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2004-07-09 16:28:19 +0000
committerJohannes Hofmann <johannes.hofmann@gmx.de>2004-07-09 16:28:19 +0000
commita22b493dae4d7c991b582aca565ef08b7a28ff13 (patch)
tree0c4f316b8e42acad355506d8465a6fc4506474b4
parenta926cb9248e232a03c1eb051c53db4c3133236de (diff)
fixes
fixes
-rw-r--r--src/PSEditor.cxx4
-rw-r--r--src/Postscript.cxx20
2 files changed, 18 insertions, 6 deletions
diff --git a/src/PSEditor.cxx b/src/PSEditor.cxx
index db501fd..76d3b4b 100644
--- a/src/PSEditor.cxx
+++ b/src/PSEditor.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: PSEditor.cxx,v 1.1 2004/07/09 17:22:55 hofmann Exp $"
+// "$Id: PSEditor.cxx,v 1.2 2004/07/09 18:28:19 hofmann Exp $"
//
// PSEditor routines.
//
@@ -41,7 +41,7 @@ int PSEditor::handle(int event) {
mark_x = Fl::event_x()-x();
mark_y = Fl::event_y()-y();
-
+ fprintf(stderr, "==> %d %d\n", mark_x, mark_y);
if (!set_cur_text(mark_x, mark_y) == 0) {
new_text(mark_x, mark_y, "");
mod++;
diff --git a/src/Postscript.cxx b/src/Postscript.cxx
index 969e71e..61ce8b3 100644
--- a/src/Postscript.cxx
+++ b/src/Postscript.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Postscript.cxx,v 1.2 2004/07/09 17:22:55 hofmann Exp $"
+// "$Id: Postscript.cxx,v 1.3 2004/07/09 18:28:19 hofmann Exp $"
//
// Postscript handling routines.
//
@@ -153,7 +153,11 @@ int PSWriter::write(FILE *in, FILE *out) {
fprintf(out, ps_header());
for (int i=1;i<pse->get_max_pages();i++) {
- write_text(out, pse->get_text(i));
+ if (pse->get_text(i)) {
+ fprintf(out, "dup %d eq { \n", i);
+ write_text(out, pse->get_text(i));
+ fprintf(out, "} if\n");
+ }
}
fprintf(out, ps_trailer());
@@ -228,7 +232,9 @@ PSLevel1Writer::PSLevel1Writer(PSEditWidget *p) : PSWriter(p) {};
char * PSLevel1Writer::ps_header() {
return \
+ "%%\n" \
"%% Begin PSEditWidget\n" \
+ "%%\n" \
"/PSEditWidgetPageCount 0 def\n" \
"/PSEditWidgetPC 0 def\n" \
"/PSEditWidgetshowpage /showpage load def\n" \
@@ -242,7 +248,9 @@ char * PSLevel1Writer::ps_header() {
char * PSLevel1Writer::ps_trailer() {
return "PSEditWidgetshowpage} def\n" \
- "%% End PSEditWidget\n";
+ "%%\n" \
+ "%% End PSEditWidget\n" \
+ "%%\n";
}
@@ -250,7 +258,9 @@ PSLevel2Writer::PSLevel2Writer(PSEditWidget *p) : PSWriter(p) {};
char * PSLevel2Writer::ps_header() {
return \
+ "%%\n" \
"%% Begin PSEditWidget\n" \
+ "%%\n" \
"/PSEditWidgetPageCount 0 def\n" \
"<< /EndPage {\n" \
"pop\n" \
@@ -264,5 +274,7 @@ char * PSLevel2Writer::ps_header() {
char * PSLevel2Writer::ps_trailer() {
return "true } >> setpagedevice\n" \
- "%% End PSEditWidget\n";
+ "%%\n" \
+ "%% End PSEditWidget\n" \
+ "%%\n";
}