]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/docview.py
wxUSE_XX fix
[wxWidgets.git] / wxPython / wx / lib / docview.py
index 8f5f038ba7f4577673d74dae3bddadd79b310e41..aad8359e1478cc61b2c57e9cd017ef855919b0b5 100644 (file)
@@ -1318,7 +1318,7 @@ class DocManager(wx.EvtHandler):
         """
         Creates a new document and reads in the selected file.
         """
-        if not self.CreateDocument('', 0):
+        if not self.CreateDocument('', DEFAULT_DOCMAN_FLAGS):
             self.OnOpenFileFailure()
 
 
@@ -1709,6 +1709,11 @@ class DocManager(wx.EvtHandler):
             else:
                 return None
 
+        if path and flags & DOC_SILENT:
+            temp = self.FindTemplateForPath(path)
+        else:
+            temp, path = self.SelectDocumentPath(templates, path, flags)
+
         # Existing document
         if self.GetFlags() & DOC_OPEN_ONCE:
             for document in self._docs:
@@ -1720,11 +1725,6 @@ class DocManager(wx.EvtHandler):
                             firstView.GetFrame().Iconize(False)
                     return None
 
-        if flags & DOC_SILENT:
-            temp = self.FindTemplateForPath(path)
-        else:
-            temp, path = self.SelectDocumentPath(templates, path, flags)
-
         if temp:
             newDoc = temp.CreateDocument(path, flags)
             if newDoc: