]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textfile.cpp
wxFont can now raelly use the native fonts
[wxWidgets.git] / 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());