Adding test for avoiding closing Clipboard when not opened
authorlaurent
Tue, 01 Sep 2009 16:58:03 +0200
changeset 403 2160fd6d83ed
parent 402 281fd35e7a7b
child 404 d5a5eaea7844
Adding test for avoiding closing Clipboard when not opened
PLCOpenEditor.py
--- a/PLCOpenEditor.py	Tue Sep 01 14:21:31 2009 +0200
+++ b/PLCOpenEditor.py	Tue Sep 01 16:58:03 2009 +0200
@@ -822,6 +822,7 @@
             dataobj = wx.TextDataObject()
             if wx.TheClipboard.GetData(dataobj):
                 data = dataobj.GetText()
+        if wx.TheClipboard.IsOpened():
             wx.TheClipboard.Close()
         return data
         
@@ -831,6 +832,7 @@
             data.SetText(text)
             wx.TheClipboard.SetData(data)
             wx.TheClipboard.Flush()
+        if wx.TheClipboard.IsOpened():
             wx.TheClipboard.Close()
         self.RefreshEditMenu()