summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/box.c7
-rw-r--r--render/box.h8
-rw-r--r--render/layout.c2
-rw-r--r--render/layout.h2
4 files changed, 9 insertions, 10 deletions
diff --git a/render/box.c b/render/box.c
index c8c435179..e5e363fbd 100644
--- a/render/box.c
+++ b/render/box.c
@@ -709,8 +709,7 @@ struct result box_textarea(xmlNode *n, struct status *status,
/* split the content at newlines and make an inline container with an
* inline box for each line */
current = content = xmlNodeGetContent(n);
- current += strspn(current, "\r\n"); /* skip any initial CR, LF */
- while (*current) {
+ do {
size_t len = strcspn(current, "\r\n");
char old = current[len];
current[len] = 0;
@@ -727,7 +726,7 @@ struct result box_textarea(xmlNode *n, struct status *status,
current[len] = old;
current += len;
current += strspn(current, "\r\n");
- }
+ } while (*current);
xmlFree(content);
if ((s = (char *) xmlGetProp(n, (const xmlChar *) "name")))
@@ -1444,8 +1443,6 @@ void gadget_free(struct gui_gadget* g)
xmlFree(g->data.checkbox.value);
break;
case GADGET_TEXTAREA:
- if (g->data.textarea.text != 0)
- xmlFree(g->data.textarea.text);
break;
case GADGET_TEXTBOX:
gui_remove_gadget(g);
diff --git a/render/box.h b/render/box.h
index 2422f2032..9e2321ec2 100644
--- a/render/box.h
+++ b/render/box.h
@@ -39,6 +39,8 @@ struct formoption {
struct formoption* next;
};
+struct box;
+
struct gui_gadget {
enum { GADGET_HIDDEN = 0, GADGET_TEXTBOX, GADGET_RADIO, GADGET_CHECKBOX,
GADGET_SELECT, GADGET_TEXTAREA, GADGET_ACTIONBUTTON,
@@ -86,9 +88,9 @@ struct gui_gadget {
char* value;
} radio;
struct {
- int cols;
- int rows;
- char* text;
+ struct box *caret_inline_container;
+ struct box *caret_text_box;
+ int caret_char_offset;
} textarea;
} data;
};
diff --git a/render/layout.c b/render/layout.c
index a759caf72..7ee46b898 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -31,8 +31,6 @@
static void layout_node(struct box * box, unsigned long width, struct box * cont,
unsigned long cx, unsigned long cy);
-static void layout_block(struct box * box, unsigned long width, struct box * cont,
- unsigned long cx, unsigned long cy);
static unsigned long layout_block_children(struct box * box, unsigned long width, struct box * cont,
unsigned long cx, unsigned long cy);
static void find_sides(struct box * fl, unsigned long y0, unsigned long y1,
diff --git a/render/layout.h b/render/layout.h
index 6e8ea6481..4a70cc7e4 100644
--- a/render/layout.h
+++ b/render/layout.h
@@ -13,5 +13,7 @@
*/
void layout_document(struct box * box, unsigned long width);
+void layout_block(struct box * box, unsigned long width, struct box * cont,
+ unsigned long cx, unsigned long cy);
#endif