summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/evas/Evas_Legacy.h6
-rw-r--r--src/lib/evas/canvas/evas_object_table.c34
2 files changed, 31 insertions, 9 deletions
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 2e6f449302..f2b4b2b8c1 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -7707,6 +7707,12 @@ EAPI Eina_Bool evas_object_table_pack_get(const Evas_Ob
7707 * @param row relative-vertical position to place child. 7707 * @param row relative-vertical position to place child.
7708 * @param colspan how many relative-horizontal position to use for this child. 7708 * @param colspan how many relative-horizontal position to use for this child.
7709 * @param rowspan how many relative-vertical position to use for this child. 7709 * @param rowspan how many relative-vertical position to use for this child.
7710 *
7711 * Note that columns and rows only guarantee 16bit unsigned values at best.
7712 * That means that col + colspan AND row + rowspan must fit inside 16bit
7713 * unsigned values cleanly. You will be warned once values exceed 15bit
7714 * storage, and attempting to use values not able to fit in 16bits will
7715 * result in failure.
7710 * 7716 *
7711 * @return 1 on success, 0 on failure. 7717 * @return 1 on success, 0 on failure.
7712 */ 7718 */
diff --git a/src/lib/evas/canvas/evas_object_table.c b/src/lib/evas/canvas/evas_object_table.c
index 237766935e..3b1f533af7 100644
--- a/src/lib/evas/canvas/evas_object_table.c
+++ b/src/lib/evas/canvas/evas_object_table.c
@@ -650,10 +650,8 @@ _evas_object_table_calculate_hints_regular(Evas_Object *o, Evas_Object_Table_Dat
650 _evas_object_table_cache_reset(priv); 650 _evas_object_table_cache_reset(priv);
651 651
652 /* cache interesting data */ 652 /* cache interesting data */
653 memset(c->expands.h, 1, priv->size.cols); 653 memset(c->expands.h, 1, priv->size.cols * sizeof(Eina_Bool));
654 memset(c->expands.v, 1, priv->size.rows); 654 memset(c->expands.v, 1, priv->size.rows * sizeof(Eina_Bool));
655 memset(c->weights.h, 0, priv->size.cols);
656 memset(c->weights.v, 0, priv->size.rows);
657 EINA_LIST_FOREACH(priv->children, l, opt) 655 EINA_LIST_FOREACH(priv->children, l, opt)
658 { 656 {
659 Evas_Object *child = opt->obj; 657 Evas_Object *child = opt->obj;
@@ -692,14 +690,14 @@ _evas_object_table_calculate_hints_regular(Evas_Object *o, Evas_Object_Table_Dat
692 } 690 }
693 691
694 if (!opt->expand_h) 692 if (!opt->expand_h)
695 memset(c->expands.h + opt->col, 0, opt->colspan); 693 memset(c->expands.h + opt->col, 0, opt->colspan * sizeof(Eina_Bool));
696 else 694 else
697 { 695 {
698 for (i = opt->col; i < opt->col + opt->colspan; i++) 696 for (i = opt->col; i < opt->col + opt->colspan; i++)
699 c->weights.h[i] += (weightw / (double)opt->colspan); 697 c->weights.h[i] += (weightw / (double)opt->colspan);
700 } 698 }
701 if (!opt->expand_v) 699 if (!opt->expand_v)
702 memset(c->expands.v + opt->row, 0, opt->rowspan); 700 memset(c->expands.v + opt->row, 0, opt->rowspan * sizeof(Eina_Bool));
703 else 701 else
704 { 702 {
705 for (i = opt->row; i < opt->row + opt->rowspan; i++) 703 for (i = opt->row; i < opt->row + opt->rowspan; i++)
@@ -1173,17 +1171,35 @@ _pack(Eo *o, void *_pd, va_list *list)
1173 1171
1174 Evas_Object_Table_Data *priv = _pd; 1172 Evas_Object_Table_Data *priv = _pd;
1175 1173
1174 if (colspan < 1)
1175 {
1176 ERR("colspan < 1");
1177 return;
1178 }
1179 if ((0xffff - col) < colspan)
1180 {
1181 ERR("col + colspan > 0xffff");
1182 return;
1183 }
1184 if ((col + colspan) >= 0x7ffff)
1185 {
1186 WRN("col + colspan getting rather large (>32767)");
1187 }
1176 if (rowspan < 1) 1188 if (rowspan < 1)
1177 { 1189 {
1178 ERR("rowspan < 1"); 1190 ERR("rowspan < 1");
1179 return; 1191 return;
1180 } 1192 }
1181 if (colspan < 1) 1193 if ((0xffff - row) < rowspan)
1182 { 1194 {
1183 ERR("colspan < 1"); 1195 ERR("row + rowspan > 0xffff");
1184 return; 1196 return;
1185 } 1197 }
1186 1198 if ((row + rowspan) >= 0x7ffff)
1199 {
1200 WRN("row + rowspan getting rather large (>32767)");
1201 }
1202
1187 opt = _evas_object_table_option_get(child); 1203 opt = _evas_object_table_option_get(child);
1188 if (!opt) 1204 if (!opt)
1189 { 1205 {