---
scribo/ChangeLog | 4 ++++
scribo/scribo/text/merging.hh | 10 ++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index df923b8..b4f95c5 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,9 @@
2011-03-21 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * scribo/text/merging: Add a precondition. Fix merging policy.
+
+2011-03-21 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* scribo/primitive/link/internal/link_functor_base.hh: Stop
neighbor lookup when a separator is found.
diff --git a/scribo/scribo/text/merging.hh b/scribo/scribo/text/merging.hh
index f433e51..26e2da7 100644
--- a/scribo/scribo/text/merging.hh
+++ b/scribo/scribo/text/merging.hh
@@ -226,6 +226,9 @@ namespace scribo
bool between_separators(const scribo::line_info<L>& l1,
const scribo::line_info<L>& l2)
{
+ // No separators found in image.
+ mln_precondition(l1.holder().components().has_separators());
+
unsigned
col1 = l1.bbox().pcenter().col(),
col2 = l2.bbox().pcenter().col();
@@ -649,6 +652,13 @@ namespace scribo
//if (!non_text_and_text_can_merge(lines(l), lines(mc)))
// continue;
+ // Avoid the case when a large title ebbox overlap
+ // with a text column. In that case, the title may
+ // merge with punctuation from the text.
+ if (lines(l).holder().components().has_separators()
+ && between_separators(lines(l), lines(mc)))
+ continue;
+
// Mark current line as punctuation.
lines(l).update_type(line::Punctuation);
--
1.5.6.5
Show replies by date