]> git.saurik.com Git - wxWidgets.git/commitdiff
do not add files in wxDebugReport::AddFile if copy failed
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 25 Jul 2010 11:26:04 +0000 (11:26 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 25 Jul 2010 11:26:04 +0000 (11:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

interface/wx/debugrpt.h
src/common/debugrpt.cpp

index dcae685d08a1a3e010b57d8b3f8bacaec82c768e..65aa1a51855da7a1abc67d65eacdbbe2f802fa38 100644 (file)
@@ -220,9 +220,11 @@ public:
     /**
         Add another file to the report. If @a filename is an absolute path, it
         is copied to a file in the debug report directory with the same name.
-        Otherwise the file should already exist in this directory
-        @a description only exists to be displayed to the user in the report
-        summary shown by wxDebugReportPreview.
+        Otherwise the file will be searched in the temporary directory returned
+        by GetDirectory().
+        
+        The argument @a description only exists to be displayed to the user in 
+        the report summary shown by wxDebugReportPreview.
 
         @see GetDirectory(), AddText()
     */
index 6f0327e59ec96d9770b182f3b72f35d935d85342..a903051fcf1a4e4c6e5b463fe0f103010fe3a87d 100644 (file)
@@ -268,8 +268,10 @@ wxDebugReport::AddFile(const wxString& filename, const wxString& description)
         // we need to copy the file to the debug report directory: give it the
         // same name there
         name = fn.GetFullName();
-        wxCopyFile(fn.GetFullPath(),
-                   wxFileName(GetDirectory(), name).GetFullPath());
+
+        if (!wxCopyFile(fn.GetFullPath(),
+                        wxFileName(GetDirectory(), name).GetFullPath()))
+           return;
     }
     else // file relative to the report directory
     {