aboutsummaryrefslogtreecommitdiff
path: root/libXaw/src/Box.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-04-10 14:58:33 +0200
committermarha <marha@users.sourceforge.net>2012-04-10 14:58:33 +0200
commit5f8448ef6b85a9ff72c5af4cec99183c8bb60dc6 (patch)
treec10939819ba1167cdc905a0c105c7ae4091abbc3 /libXaw/src/Box.c
parent67326634496ef21b4acbf4cef2f05040d34aef9b (diff)
downloadvcxsrv-5f8448ef6b85a9ff72c5af4cec99183c8bb60dc6.tar.gz
vcxsrv-5f8448ef6b85a9ff72c5af4cec99183c8bb60dc6.tar.bz2
vcxsrv-5f8448ef6b85a9ff72c5af4cec99183c8bb60dc6.zip
Updated following packages:
bigreqsproto-1.1.2 fontsproto-2.1.2 recordproto-1.14.2 scrnsaverproto-1.2.2 xcmiscproto-1.2.2 libXt-1.1.3 xhost-1.0.5 kbproto-1.0.6 libXrender-0.9.7 libxkbfile-1.0.8 freetype-2.4.9 libXaw-1.0.10 libXpm-3.5.10 xproto-7.0.23
Diffstat (limited to 'libXaw/src/Box.c')
-rw-r--r--libXaw/src/Box.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/libXaw/src/Box.c b/libXaw/src/Box.c
index 7aa14a5e8..266fb08ab 100644
--- a/libXaw/src/Box.c
+++ b/libXaw/src/Box.c
@@ -27,13 +27,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
+both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
+software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
@@ -204,13 +204,13 @@ DoLayout(BoxWidget bbw, unsigned int width, unsigned int height,
{
Boolean vbox = (bbw->box.orientation == XtorientVertical);
Cardinal i;
- Dimension w, h; /* Width and height needed for box */
- Dimension lw, lh; /* Width and height needed for current line */
- Dimension bw, bh; /* Width and height needed for current widget */
- Dimension h_space; /* Local copy of bbw->box.h_space */
- Widget widget; /* Current widget */
+ Dimension w, h; /* Width and height needed for box */
+ Dimension lw, lh; /* Width and height needed for current line */
+ Dimension bw, bh; /* Width and height needed for current widget */
+ Dimension h_space; /* Local copy of bbw->box.h_space */
+ Widget widget; /* Current widget */
unsigned int num_mapped_children = 0;
-
+
/* Box width and height */
h_space = bbw->box.h_space;
@@ -224,11 +224,11 @@ DoLayout(BoxWidget bbw, unsigned int width, unsigned int height,
if (w > width)
width = w;
h = bbw->box.v_space;
-
+
/* Line width and height */
lh = 0;
lw = h_space;
-
+
for (i = 0; i < bbw->composite.num_children; i++) {
widget = bbw->composite.children[i];
if (widget->core.managed) {
@@ -362,7 +362,7 @@ XawBoxQueryGeometry(Widget widget, XtWidgetGeometry *constraint,
else
return (XtGeometryAlmost);
}
-
+
/* else gotta do it the long way...
I have a preference for tall and narrow, so if my width is
constrained, I'll accept it; otherwise, I'll compute the minimum
@@ -392,9 +392,10 @@ XawBoxQueryGeometry(Widget widget, XtWidgetGeometry *constraint,
if (preferred_width <= constraint->width) {
width = preferred_width;
do { /* find some width big enough to stay within this height */
- width <<= 1;
- if (width > constraint->width)
+ if (width > (constraint->width >> 1)) /* avoid short int overflow */
width = constraint->width;
+ else
+ width <<= 1;
DoLayout(w, width, 0, &preferred_width, &preferred_height, False);
} while (preferred_height > constraint->height
&& width < constraint->width);