diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2009-11-10 17:43:05 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2009-11-10 17:43:05 -0300 |
commit | 4fa42f715128885c26b8c441da5cdcd426cc062b (patch) | |
tree | 522a8f05901c6ecde1983daa49f78a643dd777bf | |
parent | a39453a02f230683c480d7643b1ecfcd3a5ad7a2 (diff) | |
parent | 03b7fb49d8717416f3d1b13a9754f330a0322da6 (diff) |
merge
-rw-r--r-- | dpi/downloads.cc | 4 | ||||
-rw-r--r-- | dpid/dpidc.c | 4 | ||||
-rw-r--r-- | dw/textblock.cc | 25 | ||||
-rw-r--r-- | src/html.cc | 2 | ||||
-rw-r--r-- | src/nav.c | 8 | ||||
-rw-r--r-- | src/nav.h | 1 |
6 files changed, 18 insertions, 26 deletions
diff --git a/dpi/downloads.cc b/dpi/downloads.cc index c5d43d8b..5aa7a87c 100644 --- a/dpi/downloads.cc +++ b/dpi/downloads.cc @@ -583,7 +583,9 @@ void DLItem::update_size(int new_sz) prBar->move(1); } else { prBar->showtext(true); - double pos = 100.0 * (double)curr_bytesize / total_bytesize; + double pos = 100.0; + if (total_bytesize > 0) + pos *= (double)curr_bytesize / total_bytesize; prBar->position(pos); } } diff --git a/dpid/dpidc.c b/dpid/dpidc.c index f4accaf2..54fa3b0a 100644 --- a/dpid/dpidc.c +++ b/dpid/dpidc.c @@ -95,7 +95,9 @@ int main(int argc, char *argv[]) bzero(buffer,256); fgets(buffer,255,stdin); } else { - MSG_ERR("main: Unknown operation '%s'\n", argv[1]); + MSG_ERR("main: Unknown operation '%s'\n" + "Usage:\n" + "%s {stop|register|chat}\n\n", argv[1], argv[0]); exit(1); } diff --git a/dw/textblock.cc b/dw/textblock.cc index 5d838277..613d04ce 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -1611,7 +1611,7 @@ void Textblock::addWidget (core::Widget *widget, core::style::Style *style) core::Requisition size; /* We first assign -1 as parent_ref, since the call of widget->size_request - * will otherwise let this DwPage be rewrapped from the beginning. + * will otherwise let this Textblock be rewrapped from the beginning. * (parent_ref is actually undefined, but likely has the value 0.) At the, * end of this function, the correct value is assigned. */ widget->parentRef = -1; @@ -1722,7 +1722,7 @@ void Textblock::addParbreak (int space, core::style::Style *style) (hasListitemValue && words->size () == 1)) { /* This is a bit hackish: If a break is added as the first/second word of a page, and the parent widget is also a - DwPage, and there is a break before -- this is the case when + Textblock, and there is a break before -- this is the case when a widget is used as a text box (lists, blockquotes, list items etc) -- then we simply adjust the break before, in a way that the space is in any case visible. */ @@ -1855,19 +1855,16 @@ core::Widget *Textblock::getWidgetAtPoint(int x, int y, int level) */ void Textblock::handOverBreak (core::style::Style *style) { - #if 0 - MISSING - DwPageLine *last_line; - DwWidget *parent; - - if (page->num_lines == 0) - return; + if (lines->size() > 0) { + Widget *parent; + Line *lastLine = lines->getRef (lines->size () - 1); - last_line = &page->lines[page->num_lines - 1]; - if (last_line->break_space != 0 && - (parent = DW_WIDGET(page)->parent) && DW_IS_PAGE (parent)) - a_Dw_page_add_parbreak (DW_PAGE (parent), last_line->break_space, style); -#endif + if (lastLine->breakSpace != 0 && (parent = getParent()) && + parent->instanceOf (Textblock::CLASS_ID)) { + Textblock *textblock2 = (Textblock*) parent; + textblock2->addParbreak(lastLine->breakSpace, style); + } + } } /* diff --git a/src/html.cc b/src/html.cc index 4fd6ab91..3f5a10ba 100644 --- a/src/html.cc +++ b/src/html.cc @@ -1218,7 +1218,7 @@ static bool Html_match_tag(const char *tagstr, char *tag, int tagsize) /* * This function is called after popping the stack, to - * handle nested DwPage widgets. + * handle nested Textblock widgets. */ static void Html_eventually_pop_dw(DilloHtml *html, bool hand_over_break) { @@ -445,14 +445,6 @@ void a_Nav_push_nw(BrowserWindow *bw, const DilloUrl *url) } /* - * Wraps a_Nav_push to match 'DwPage->link' function type - */ -void a_Nav_vpush(void *vbw, const DilloUrl *url) -{ - a_Nav_push(vbw, url); -} - -/* * Send the browser back to previous page */ void a_Nav_back(BrowserWindow *bw) @@ -16,7 +16,6 @@ extern "C" { void a_Nav_redirection0(BrowserWindow *bw, const DilloUrl *new_url); void a_Nav_push(BrowserWindow *bw, const DilloUrl *url); void a_Nav_push_nw(BrowserWindow *bw, const DilloUrl *url); -void a_Nav_vpush(void *vbw, const DilloUrl *url); void a_Nav_repush(BrowserWindow *bw); void a_Nav_back(BrowserWindow *bw); void a_Nav_forw(BrowserWindow *bw); |