2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00

Merge pull request #271 from tigran123/master

TOC cleanup in crengine.lua
This commit is contained in:
Dobrica Pavlinušić 2012-09-10 14:31:32 -07:00
commit 44d9daf07a

View File

@ -346,7 +346,7 @@ function CREReader:gotoPrevNextTocEntry(direction)
self:fillToc() self:fillToc()
end end
if #self.toc == 0 then if #self.toc == 0 then
showInfoMsgWithDelay("This document does not have a TOC.", 2000, 1) showInfoMsgWithDelay("No Table of Contents", 1500, 1)
return return
end end
-- search for current TOC-entry -- search for current TOC-entry
@ -442,7 +442,6 @@ function CREReader:adjustCreReaderCommands()
local prev_xpointer = self.doc:getXPointer() local prev_xpointer = self.doc:getXPointer()
Screen:screenRotate("anticlockwise") Screen:screenRotate("anticlockwise")
G_width, G_height = fb:getSize() G_width, G_height = fb:getSize()
self:fillToc()
self:goto(prev_xpointer, nil, "xpointer") self:goto(prev_xpointer, nil, "xpointer")
self.pos = self.doc:getCurrentPos() self.pos = self.doc:getCurrentPos()
end end
@ -455,7 +454,6 @@ function CREReader:adjustCreReaderCommands()
local prev_xpointer = self.doc:getXPointer() local prev_xpointer = self.doc:getXPointer()
Screen:screenRotate("clockwise") Screen:screenRotate("clockwise")
G_width, G_height = fb:getSize() G_width, G_height = fb:getSize()
self:fillToc()
self:goto(prev_xpointer, nil, "xpointer") self:goto(prev_xpointer, nil, "xpointer")
self.pos = self.doc:getCurrentPos() self.pos = self.doc:getCurrentPos()
end end
@ -507,7 +505,6 @@ function CREReader:adjustCreReaderCommands()
local prev_xpointer = self.doc:getXPointer() local prev_xpointer = self.doc:getXPointer()
self.doc:zoomFont(delta) self.doc:zoomFont(delta)
self:goto(prev_xpointer, nil, "xpointer") self:goto(prev_xpointer, nil, "xpointer")
self:fillToc()
end end
) )
self.commands:addGroup(MOD_ALT.."< >",{ self.commands:addGroup(MOD_ALT.."< >",{
@ -528,7 +525,6 @@ function CREReader:adjustCreReaderCommands()
local prev_xpointer = self.doc:getXPointer() local prev_xpointer = self.doc:getXPointer()
self.doc:setDefaultInterlineSpace(self.line_space_percent) self.doc:setDefaultInterlineSpace(self.line_space_percent)
self:goto(prev_xpointer, nil, "xpointer") self:goto(prev_xpointer, nil, "xpointer")
self:fillToc()
end end
) )
local numeric_keydefs = {} local numeric_keydefs = {}
@ -585,7 +581,6 @@ function CREReader:adjustCreReaderCommands()
InfoMessage:show("Redrawing with "..face_list[item_no], 0) InfoMessage:show("Redrawing with "..face_list[item_no], 0)
self.doc:setFontFace(face_list[item_no]) self.doc:setFontFace(face_list[item_no])
self.font_face = face_list[item_no] self.font_face = face_list[item_no]
self:fillToc()
end end
self:goto(prev_xpointer, nil, "xpointer") self:goto(prev_xpointer, nil, "xpointer")
end end
@ -608,7 +603,6 @@ function CREReader:adjustCreReaderCommands()
local prev_xpointer = self.doc:getXPointer() local prev_xpointer = self.doc:getXPointer()
self.doc:toggleFontBolder() self.doc:toggleFontBolder()
self:goto(prev_xpointer, nil, "xpointer") self:goto(prev_xpointer, nil, "xpointer")
self:fillToc()
end end
) )
self.commands:add(KEY_B, MOD_ALT, "B", self.commands:add(KEY_B, MOD_ALT, "B",