promote user to save PDF document after highlighting

This is a wordaround for #791.
This commit is contained in:
chrox
2014-08-24 15:16:01 +08:00
parent bd2fa87c85
commit 092522b89d
3 changed files with 48 additions and 12 deletions

View File

@@ -51,6 +51,9 @@ local Document = {
-- flag to show that the document needs to be unlocked by a password
is_locked = false,
-- flag to show that the document is edited and needs to write back to disk
is_edited = false,
}
function Document:new(o)
@@ -85,6 +88,17 @@ function Document:close()
end
end
-- check if document is edited and needs to write to disk
function Document:isEdited()
return self.is_edited
end
-- discard change will set is_edited flag to false and implematation of Document
-- should check the is_edited flag before writing document
function Document:discardChange()
self.is_edited = false
end
-- this might be overridden by a document implementation
function Document:getNativePageDimensions(pageno)
local hash = "pgdim|"..self.file.."|"..pageno