From 5d8a189660934ba57e60860ccaa5205e4b982bbf Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Sun, 18 Jul 2004 18:49:43 +0000 Subject: fixes fixes --- src/PSEditor.cxx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/PSEditor.cxx') diff --git a/src/PSEditor.cxx b/src/PSEditor.cxx index bc50b59..20e9de2 100644 --- a/src/PSEditor.cxx +++ b/src/PSEditor.cxx @@ -1,5 +1,5 @@ // -// "$Id: PSEditor.cxx,v 1.4 2004/07/09 22:51:39 hofmann Exp $" +// "$Id: PSEditor.cxx,v 1.5 2004/07/18 20:49:43 hofmann Exp $" // // PSEditor routines. // @@ -29,6 +29,7 @@ PSEditor::PSEditor(int X,int Y,int W, int H) : PSEditWidget(X, Y, W, H) { loaded = 0; mod = 0; + ps_level = 1; } int PSEditor::handle(int event) { @@ -137,7 +138,13 @@ int PSEditor::save(const char* savefile) { FILE *fp = fdopen(tmp_fd, "r"); rewind(fp); FILE *sfp = fopen(savefile, "w"); - PSWriter *pw = new PSLevel2Writer(this); + PSWriter *pw; + + if (ps_level == 2) { + pw = new PSLevel2Writer(this); + } else { + pw = new PSLevel1Writer(this); + } pw->write(fp, sfp); @@ -147,3 +154,15 @@ int PSEditor::save(const char* savefile) { mod = 0; return 0; } + +int PSEditor::get_ps_level() { + return ps_level; +} + +void PSEditor::set_ps_level(int l) { + if (l == 2) { + ps_level = 2; + } else { + ps_level = 1; + } +} -- cgit v1.2.3