]> git.saurik.com Git - wxWidgets.git/commitdiff
blind fix for temp file creation problem
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 19 Dec 2001 21:40:50 +0000 (21:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 19 Dec 2001 21:40:50 +0000 (21:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/textfile.cpp

index 63f02f1a37a75105bc23e39e7b68edf877bb620b..26053922cd0ada639c9c47e9758cdc7b4a9de14e 100644 (file)
 #if wxUSE_TEXTFILE
 
 #ifndef WX_PRECOMP
-    #include  "wx/string.h"
-    #include  "wx/intl.h"
-    #include  "wx/file.h"
-    #include  "wx/log.h"
+    #include "wx/string.h"
+    #include "wx/intl.h"
+    #include "wx/file.h"
+    #include "wx/log.h"
 #endif
 
 #include "wx/textfile.h"
+#include "wx/filename.h"
 
 // ============================================================================
 // wxTextFile class implementation
@@ -172,7 +173,11 @@ bool wxTextFile::OnRead(wxMBConv& conv)
 
 bool wxTextFile::OnWrite(wxTextFileType typeNew, wxMBConv& conv)
 {
-    wxTempFile fileTmp(m_strBufferName);
+    wxFileName fn = m_strBufferName;
+    if ( !fn.IsAbsolute() )
+        fn.Normalize();
+
+    wxTempFile fileTmp(fn.GetFullName());
 
     if ( !fileTmp.IsOpened() ) {
         wxLogError(_("can't write buffer '%s' to disk."), m_strBufferName.c_str());