GNOME Bugzilla – Bug 339562
out of range marges
Last modified: 2006-05-21 12:55:55 UTC
Steps to reproduce: 1. menu file/page setup 2. set left marging to 22cm (it is replaced automatically by 21cm) 3. apply Stack trace: application just frozen, nothing can be done Other information: 4 marges seems to have the same problem.
*** Bug 339563 has been marked as a duplicate of this bug. ***
(gdb) where
+ Trace 67973
$6 = 24.055599212646484 (gdb) print pwidth $7 = -2.8199999332427979 I _think_ that the problem is that paper width is negative :-) Haypo
Some informations ... When you click on "OK" (and also "Apply?"), pagesetup_changed() is called. It read margins and compute page size (width x height). The problem is when margins are too big, width and/or height are negative, and so Dia becomes crazy ... Fix will can be written in: - pagesetup_changed(): fix margins - dia_page_layout_get_effective_area(): fix margins and/or page size - or the best will be in the dialog: all event handlers (margin_changed(), orient_changed(), ...) should update margins I tried to fix the dialog, but I get some strange behaviour (update maximum value display "29,70cm29,70cm" instead of "29,70cm"). Maybe a bug in Dia spinner (but don't have time to fix Dia widgets ...). My function was something like: -------------- 8< ------------- tmargin: fix spinner upper limit (width/height=max1) tmargin: fix value if it's too big bmargin: fix spinner upper limit (max1-tmargin value) bmargin: fix value if it's too big lmargin: fix spinner upper limit (width/height=max2) lmargin: fix value if it's too big rmargin: fix spinner upper limit (max2-lmargin value) rmargin: fix value if it's too big -------------- 8< ------------- I used a static int (works like lock) to avoid multiple called of the same handler. Haypo
2006-05-21 Hans Breuer <hans@breuer.org> * app/pagesetup.c app/diapagelayout.c : restrict every page margin to a little less than half of the page. This guarantees margins leaving some useable page area and thus avoids crashing on negative page sizes. Fixes bug #339562 (also applied to dia-0-95 branch)