Skip to content

Commit

Permalink
bump crengine: minor fixes, add getPageXPointer() (#1590)
Browse files Browse the repository at this point in the history
Includes:
- Update German hyphenation patterns
- CSS stylesheets cache: also clear it after initial load
- getSurroundingAddedHeight(): use interline_scale_factor
- LVDocView::getNodeByPoint(): tweak again for text selection
- LVDocView::getPageBookmark(): behave as getBookmark()
  • Loading branch information
poire-z authored Mar 14, 2023
1 parent acba402 commit 82e6c28
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions cre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,19 @@ static int getXPointer(lua_State *L) {
return 1;
}

static int getPageXPointer(lua_State *L) {
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
int pageno = luaL_checkint(L, 2);
bool internal = false;
if (lua_isboolean(L, 3)) {
internal = lua_toboolean(L, 3);
}
ldomXPointer xp = doc->text_view->getPageBookmark(pageno - 1, true, internal);
lua_pushstring(L, UnicodeToLocal(xp.toString()).c_str());

return 1;
}

static int getFullHeight(lua_State *L) {
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");

Expand Down Expand Up @@ -3963,6 +3976,7 @@ static const struct luaL_Reg credocument_meth[] = {
{"getCurrentPos", getCurrentPos},
{"getCurrentPercent", getCurrentPercent},
{"getXPointer", getXPointer},
{"getPageXPointer", getPageXPointer},
{"getPageOffsetX", getPageOffsetX},
{"getPageStartY", getPageStartY},
{"getPageHeight", getPageHeight},
Expand Down

0 comments on commit 82e6c28

Please sign in to comment.