Skip to content

Commit

Permalink
fix(cre): return nil for no text mathced in getTextFromPositions
Browse files Browse the repository at this point in the history
  • Loading branch information
houqp committed Mar 21, 2016
1 parent ac73e16 commit aee39bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,8 @@ static int getTextFromPositions(lua_State *L) {
lvPoint endpt(x1, y1);
ldomXPointer startp = tv->getNodeByPoint(startpt);
ldomXPointer endp = tv->getNodeByPoint(endpt);
lua_newtable(L); // new text boxes
if (!startp.isNull() && !endp.isNull()) {
lua_newtable(L); // new text boxes
ldomXRange r(startp, endp);
if (r.getStart().isNull() || r.getEnd().isNull())
return 0;
Expand Down Expand Up @@ -1022,8 +1022,9 @@ static int getTextFromPositions(lua_State *L) {
lua_pushstring(L, "percent");
lua_pushnumber(L, 1.0*page/(pages-1));
lua_settable(L, -3);
return 1;
}
return 1;
return 0;
}

void lua_pushLineRect(lua_State *L, int left, int top, int right, int bottom, int lcount) {
Expand Down

0 comments on commit aee39bc

Please sign in to comment.