forked from openlp/openlp
Don't use presentation until it actually exists
This commit is contained in:
parent
6928018f59
commit
8f7c22ecc2
@ -130,16 +130,17 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
self.controller.start_process()
|
self.controller.start_process()
|
||||||
self.controller.process.Presentations.Open(self.filepath, False,
|
self.controller.process.Presentations.Open(self.filepath, False,
|
||||||
False, True)
|
False, True)
|
||||||
|
self.presentation = self.controller.process.Presentations(
|
||||||
|
self.controller.process.Presentations.Count)
|
||||||
|
self.create_thumbnails()
|
||||||
# Powerpoint 2013 pops up when loading a file, so we minimize it again
|
# Powerpoint 2013 pops up when loading a file, so we minimize it again
|
||||||
if self.presentation.Application.Version == u'15.0':
|
if self.presentation.Application.Version == u'15.0':
|
||||||
self.presentation.ActiveWindow.WindowState = 2
|
self.presentation.ActiveWindow.WindowState = 2
|
||||||
except pywintypes.com_error:
|
return True
|
||||||
log.debug(u'PPT open failed')
|
except pywintypes.com_error as e:
|
||||||
|
log.error(u'PPT open failed')
|
||||||
|
log.error(e)
|
||||||
return False
|
return False
|
||||||
self.presentation = self.controller.process.Presentations(
|
|
||||||
self.controller.process.Presentations.Count)
|
|
||||||
self.create_thumbnails()
|
|
||||||
return True
|
|
||||||
|
|
||||||
def create_thumbnails(self):
|
def create_thumbnails(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user