Merge pull request #491 from chrox/master

several crash fixes
pull/492/head
Paulo Matias 10 years ago
commit 5c620e44ba

@ -75,7 +75,14 @@ function KoptInterface:createContext(doc, pageno, bbox)
kc:setDefectSize(doc.configurable.defect_size)
kc:setLineSpacing(doc.configurable.line_spacing)
kc:setWordSpacing(doc.configurable.word_spacing)
if bbox then kc:setBBox(bbox.x0, bbox.y0, bbox.x1, bbox.y1) end
if bbox then
if bbox.x0 >= bbox.x1 or bbox.y0 >= bbox.y1 then
local page_size = Document.getNativePageDimensions(doc, pageno)
bbox.x0, bbox.y0 = 0, 0
bbox.x1, bbox.y1 = page_size.w, page_size.h
end
kc:setBBox(bbox.x0, bbox.y0, bbox.x1, bbox.y1)
end
if DEBUG.is_on then kc:setDebug() end
return kc
end

@ -212,9 +212,10 @@ function ReaderHighlight:onHold(arg, ges)
return true
end
self.selected_word = self.ui.document:getWordFromPosition(self.hold_pos)
DEBUG("selected word:", self.selected_word)
if self.selected_word then
local ok, word = pcall(self.ui.document.getWordFromPosition, self.ui.document, self.hold_pos)
if ok and word then
DEBUG("selected word:", word)
self.selected_word = word
if self.ui.document.info.has_pages then
local boxes = {}
table.insert(boxes, self.selected_word.sbox)

@ -1 +1 @@
Subproject commit f35cbdff906b265712afffc8831bafe5fbb21f3b
Subproject commit 1bcc9603034d97cd196c2f3bb2a4a5713d215931
Loading…
Cancel
Save