After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 339562 - out of range marges
out of range marges
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: general
0.95
Other All
: Normal critical
: 0.95.1
Assigned To: Dia maintainers
Dia maintainers
: 339563 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-04-24 12:47 UTC by bigot
Modified: 2006-05-21 12:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description bigot 2006-04-24 12:47:33 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.
Comment 1 Sergej Kotliar 2006-04-24 15:47:24 UTC
*** Bug 339563 has been marked as a duplicate of this bug. ***
Comment 2 Victor STINNER 2006-05-02 09:16:56 UTC
(gdb) where
  • #0 pagebreak_draw
    at grid.c line 287
  • #1 ddisplay_render_pixmap
    at display.c line 671
  • #2 ddisplay_update_handler
    at display.c line 593
  • #3 g_idle_dispatch
    at gmain.c line 3796
  • #4 IA__g_main_context_dispatch
    at gmain.c line 1916
  • #5 g_main_context_iterate
    at gmain.c line 2547
  • #6 IA__g_main_loop_run
    at gmain.c line 2751
  • #7 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 main
    at main.c line 40
$6 = 24.055599212646484
(gdb) print pwidth
$7 = -2.8199999332427979

I _think_ that the problem is that paper width is negative :-)

Haypo
Comment 3 Victor STINNER 2006-05-02 13:20:53 UTC
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
Comment 4 Hans Breuer 2006-05-21 12:55:55 UTC
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)