summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-01-29 11:16:25 +0000
committerAlex Valavanis <valavanisalex@googlemail.com>2012-01-29 11:16:25 +0000
commit8d372ff663a9cb514126ccdfc14950f3e04daf00 (patch)
tree7de81f7a196226b828b1828085e153cf821f1411 /src
parentemf export. change text height property lfHeight from + to - (Bug 919728) (diff)
downloadinkscape-8d372ff663a9cb514126ccdfc14950f3e04daf00.tar.gz
inkscape-8d372ff663a9cb514126ccdfc14950f3e04daf00.zip
Cherry-pick upstream GDL patch 31886 (2011-08-08). Avoid a crash when the pane width is smaller than a button
Fixed bugs: - https://launchpad.net/bugs/923241 (bzr r10923)
Diffstat (limited to 'src')
-rw-r--r--src/libgdl/gdl-switcher.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libgdl/gdl-switcher.c b/src/libgdl/gdl-switcher.c
index fa52aa714..78ba1168d 100644
--- a/src/libgdl/gdl-switcher.c
+++ b/src/libgdl/gdl-switcher.c
@@ -301,6 +301,8 @@ layout_buttons (GdlSwitcher *switcher)
/* Figure out how many rows and columns we'll use. */
btns_per_row = allocation.width / (max_btn_width + H_PADDING);
+ /* Use at least one column */
+ if (btns_per_row == 0) btns_per_row = 1;
/* If all the buttons could fit in the single row, have it so */
if (allocation.width >= optimal_layout_width)