Skip to content

Commit

Permalink
Fix getBookmark() on multi-pages embedded block
Browse files Browse the repository at this point in the history
We need to look inside the inlineBox (which might not
be a small inline-block node, but can be a multi-pages
block node embedded in some inline node).
  • Loading branch information
poire-z committed Mar 11, 2020
1 parent faf01cb commit 1cec90f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crengine/src/lvtinydom.cpp
Expand Up @@ -7629,7 +7629,16 @@ ldomXPointer ldomDocument::createXPointer( lvPoint pt, int direction, bool stric
// Found right word/image
const src_text_fragment_t * src = txtform->GetSrcInfo(word->src_text_index);
ldomNode * node = (ldomNode *)src->object;
if ( word->flags & LTEXT_WORD_IS_INLINE_BOX || word->flags & LTEXT_WORD_IS_OBJECT ) {
if ( word->flags & LTEXT_WORD_IS_INLINE_BOX ) {
// pt is inside this inline-block inlineBox node
ldomXPointer inside_ptr = createXPointer( orig_pt, direction, strictBounds, node );
if ( !inside_ptr.isNull() ) {
return inside_ptr;
}
// Otherwise, return xpointer to the inlineBox itself
return ldomXPointer(node, 0);
}
if ( word->flags & LTEXT_WORD_IS_OBJECT ) {
return ldomXPointer(node, 0);
}
// It is a word
Expand Down

0 comments on commit 1cec90f

Please sign in to comment.