Re: Dillo_grows merged
Jorge Arellano Cid <[email protected]>
| Newsgroups | gmane.comp.web.dillo.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Sebastian, On Sun, May 15, 2016 at 04:42:31PM -0400, Jorge Arellano Cid wrote: > Hi there! > > On Sun, May 15, 2016 at 01:17:40PM +0100, Nick Warne wrote: > > On Sat, 14 May 2016 22:48:12 +0000 > > eocene <[email protected]> wrote: > > > > > > Searching the page doesn't cause any more, though. > > > > > > Searching backward causes segfaults with regularity. > > > > Messing about with this this morning, the segfault happens when using > > 'previous' goes back past the first found 'next'. > > Yes. > > I sent this bug to Per Anderson a few weeks ago for him to debug, > but didn't get an answer. @Per: did you get the email? > > Anyway, today I made a simple patch for it, but will investigate > the issue a bit further before sending it to Sebastian for review. OK, the bisect shows the problem starts with commit 4241 which is a new design for textblock iterators. The attached patch works OK for the text search, but I don't know whether it fits with the overall design. It *seems to fit* but I'd prefer you to check it. ;) -- Cheers Jorge.- _______________________________________________ Dillo-dev mailing list [email protected] http://lists.dillo.org/cgi-bin/mailman/listinfo/dillo-dev
it.diff
(text/x-diff, 1.3 KB)
# HG changeset patch
# Parent 3e1669ea08412abb87376e9f53cca8fddb1ff78e
diff -r 3e1669ea0841 -r 0fdf16be6031 dw/oofawarewidget_iterator.cc
--- a/dw/oofawarewidget_iterator.cc Wed May 11 11:14:19 2016 -0300
+++ b/dw/oofawarewidget_iterator.cc Sun May 15 16:45:41 2016 -0400
@@ -31,7 +31,7 @@ namespace dw {
namespace oof {
-// "numContentsInFlow" is passed here to avoid indirectly callin the (virtual)
+// "numContentsInFlow" is passed here to avoid indirectly calling the (virtual)
// method numContentsInFlow() from the constructor.
OOFAwareWidget::OOFAwareWidgetIterator::OOFAwareWidgetIterator
(OOFAwareWidget *widget, Content::Type mask, bool atEnd,
@@ -79,6 +79,8 @@ int OOFAwareWidget::OOFAwareWidgetIterat
if (sectionIndex == 0)
result = numContentsInFlow == -1 ?
this->numContentsInFlow () : numContentsInFlow;
+ else if (sectionIndex >= NUM_SECTIONS - 1)
+ result = 0;
else
result = widget->outOfFlowMgr[sectionIndex - 1] ?
widget->outOfFlowMgr[sectionIndex - 1]->getNumWidgets () : 0;
@@ -200,7 +202,7 @@ bool OOFAwareWidget::OOFAwareWidgetItera
do {
index--;
- if (index >= 0)
+ if (index >= 0 && sectionIndex < numParts (sectionIndex))
getPart (sectionIndex, index, &content);
else {
sectionIndex--;