octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #44387] Qt left in bad state when printing wit


From: Rik
Subject: [Octave-bug-tracker] [bug #44387] Qt left in bad state when printing with bogus device
Date: Tue, 03 Mar 2015 21:05:12 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0

Update of bug #44387 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #5:

Here is a sample piece of code that illustrates the problem


octave:30> close all
octave:31> surf (peaks)
octave:32> get (gcf, "color")
ans =

   1   1   1

octave:33> print -dfoo tst.eps
Unknown device: foo
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
    defaultdevice
warning: broken pipe

octave:33> get (gcf, "color")
ans = none


So it is clear that when an error occurs we are not restoring the plot to its
original state.  This is probably because error() short-circuits running the
normal end-of-print routines.

It probably means we need to have any code that might fail in a try/catch
block or in an unwind_protect statement so that errors are cleaned up
afterwards.

Actually, check out print.m.


    ## Set figure background to none.
    ## This is done both for consistency with Matlab and to eliminate
    ## the visible box along the figure's perimeter.
    props(3).h = opts.figure;
    props(3).name = "color";
    props(3).value{1} = get (props(3).h, props(3).name);
    set (props(3).h, "color", "none");


This is in an unwind_protect statement.  So, maybe there is some reason why
the restore code is not working.

In fact, I just did a bunch of insertions of printf statements into print.m
and lots of them do not seem to be executed after I use a function which calls
into the C++ graphics code such as ishandle() or set(). 


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44387>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]