mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-26 14:07:05 +03:00
remove unused is_html parameter to text selection routines
This commit is contained in:
parent
a8c540ea59
commit
2ea577c47e
@ -493,7 +493,7 @@ html_create_html_data(html_content *c, const http_parameter *params)
|
|||||||
return NSERROR_NOMEM;
|
return NSERROR_NOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
selection_prepare(&c->sel, (struct content *)c, true);
|
selection_prepare(&c->sel, (struct content *)c);
|
||||||
|
|
||||||
nerror = http_parameter_list_find_item(params, corestring_lwc_charset, &charset);
|
nerror = http_parameter_list_find_item(params, corestring_lwc_charset, &charset);
|
||||||
if (nerror == NSERROR_OK) {
|
if (nerror == NSERROR_OK) {
|
||||||
|
@ -265,13 +265,11 @@ nserror
|
|||||||
html_create_selection(struct content *c, struct selection **sel_out)
|
html_create_selection(struct content *c, struct selection **sel_out)
|
||||||
{
|
{
|
||||||
struct selection *sel;
|
struct selection *sel;
|
||||||
sel = selection_create(c, true);
|
sel = selection_create(c);
|
||||||
if (sel == NULL) {
|
if (sel == NULL) {
|
||||||
return NSERROR_NOMEM;
|
return NSERROR_NOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
selection_init(sel);
|
|
||||||
|
|
||||||
*sel_out = sel;
|
*sel_out = sel;
|
||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ textplain_create_internal(textplain_content *c, lwc_string *encoding)
|
|||||||
c->formatted_width = 0;
|
c->formatted_width = 0;
|
||||||
c->bw = NULL;
|
c->bw = NULL;
|
||||||
|
|
||||||
selection_prepare(&c->sel, (struct content *)c, false);
|
selection_prepare(&c->sel, (struct content *)c);
|
||||||
|
|
||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
|
|
||||||
@ -1575,13 +1575,11 @@ static nserror
|
|||||||
textplain_create_selection(struct content *c, struct selection **sel_out)
|
textplain_create_selection(struct content *c, struct selection **sel_out)
|
||||||
{
|
{
|
||||||
struct selection *sel;
|
struct selection *sel;
|
||||||
sel = selection_create(c, false);
|
sel = selection_create(c);
|
||||||
if (sel == NULL) {
|
if (sel == NULL) {
|
||||||
return NSERROR_NOMEM;
|
return NSERROR_NOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
selection_init(sel);
|
|
||||||
|
|
||||||
*sel_out = sel;
|
*sel_out = sel;
|
||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
}
|
}
|
||||||
|
@ -49,13 +49,6 @@
|
|||||||
#include "netsurf/window.h"
|
#include "netsurf/window.h"
|
||||||
#include "desktop/gui_internal.h"
|
#include "desktop/gui_internal.h"
|
||||||
|
|
||||||
/**
|
|
||||||
* Text selection works by labelling each node in the box tree with its
|
|
||||||
* start index in the textual representation of the tree's content.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define SPACE_LEN(b) ((b->space == 0) ? 0 : 1)
|
|
||||||
|
|
||||||
|
|
||||||
struct selection_string {
|
struct selection_string {
|
||||||
char *buffer;
|
char *buffer;
|
||||||
@ -67,8 +60,6 @@ struct selection_string {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redraws the given range of text.
|
* Redraws the given range of text.
|
||||||
*
|
*
|
||||||
@ -254,24 +245,24 @@ selection_string_append(const char *text,
|
|||||||
|
|
||||||
|
|
||||||
/* exported interface documented in desktop/selection.h */
|
/* exported interface documented in desktop/selection.h */
|
||||||
struct selection *selection_create(struct content *c, bool is_html)
|
struct selection *selection_create(struct content *c)
|
||||||
{
|
{
|
||||||
struct selection *s;
|
struct selection *sel;
|
||||||
s = calloc(1, sizeof(struct selection));
|
sel = calloc(1, sizeof(struct selection));
|
||||||
if (s) {
|
if (sel) {
|
||||||
selection_prepare(s, c, is_html);
|
selection_prepare(sel, c);
|
||||||
|
selection_init(sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return sel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* exported interface documented in desktop/selection.h */
|
/* exported interface documented in desktop/selection.h */
|
||||||
void selection_prepare(struct selection *s, struct content *c, bool is_html)
|
void selection_prepare(struct selection *s, struct content *c)
|
||||||
{
|
{
|
||||||
if (s) {
|
if (s) {
|
||||||
s->c = c;
|
s->c = c;
|
||||||
s->is_html = is_html;
|
|
||||||
s->root = NULL;
|
s->root = NULL;
|
||||||
s->drag_state = DRAG_NONE;
|
s->drag_state = DRAG_NONE;
|
||||||
s->max_idx = 0;
|
s->max_idx = 0;
|
||||||
|
@ -53,7 +53,6 @@ struct selection
|
|||||||
unsigned end_idx;
|
unsigned end_idx;
|
||||||
|
|
||||||
bool defined;
|
bool defined;
|
||||||
bool is_html;
|
|
||||||
|
|
||||||
seln_drag_state drag_state;
|
seln_drag_state drag_state;
|
||||||
};
|
};
|
||||||
@ -79,7 +78,7 @@ struct selection
|
|||||||
*
|
*
|
||||||
* \return new selection context
|
* \return new selection context
|
||||||
*/
|
*/
|
||||||
struct selection *selection_create(struct content *c, bool is_html);
|
struct selection *selection_create(struct content *c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare a newly created selection object for use.
|
* Prepare a newly created selection object for use.
|
||||||
@ -88,9 +87,8 @@ struct selection *selection_create(struct content *c, bool is_html);
|
|||||||
*
|
*
|
||||||
* \param s selection object
|
* \param s selection object
|
||||||
* \param c content
|
* \param c content
|
||||||
* \param is_html true if content is html false if content is textplain
|
|
||||||
*/
|
*/
|
||||||
void selection_prepare(struct selection *s, struct content *c, bool is_html);
|
void selection_prepare(struct selection *s, struct content *c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroys a selection object clearing it if nesessary
|
* Destroys a selection object clearing it if nesessary
|
||||||
|
Loading…
Reference in New Issue
Block a user