From be69bfed7d82e011bd4aa0fbd9240ccedb335193 Mon Sep 17 00:00:00 2001 From: poire-z Date: Fri, 24 Apr 2026 23:45:47 +0200 Subject: [PATCH] bump crengine: MOBI and CSS fixes (#15310) Includes: - pdbfmt: don't overwrite extracted metadata - pdbfmt: extract more metadata from MOBI EXTH - pdbfmt: extract MOBI non-EXTH title if necessary - CSS first-line: fix possible crash - CSS width: fit-content: account for the element padding - getNodeByPoint(): improve fallback check cre.cpp / credocument.lua: add getNearestWordFromPosition() --- base | 2 +- frontend/document/credocument.lua | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/base b/base index 656dbec1c..6a2c36b6a 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 656dbec1cffaf1a6f40c9decd49a585444aff129 +Subproject commit 6a2c36b6a0a645e34c889a9f7ea453b9c1aa9fa9 diff --git a/frontend/document/credocument.lua b/frontend/document/credocument.lua index 41cbc4ec5..282cc826d 100644 --- a/frontend/document/credocument.lua +++ b/frontend/document/credocument.lua @@ -716,6 +716,10 @@ function CreDocument:getScreenBoxesFromPositions(pos0, pos1, get_segments) return line_boxes end +function CreDocument:getNearestWordFromPosition(pos, direction) + return self._document:getNearestWordFromPosition(pos.x, pos.y, direction) +end + function CreDocument:compareXPointers(xp1, xp2) -- Returns 1 if XPointers are ordered (if xp2 is after xp1), -1 if not, 0 if same -- Returns nil if any of XPointers are invalid @@ -1894,6 +1898,7 @@ function CreDocument:setupCallCache() elseif name == "getPageLinks" then cache_by_tag = true elseif name == "getScreenBoxesFromPositions" then cache_by_tag = true elseif name == "getScreenPositionFromXPointer" then cache_by_tag = true + elseif name == "getNearestWordFromPosition" then cache_by_tag = true elseif name == "getXPointer" then cache_by_tag = true elseif name == "isXPointerInCurrentPage" then cache_by_tag = true elseif name == "getPageMapCurrentPageLabel" then cache_by_tag = true