Commit Graph

65 Commits

Author SHA1 Message Date
Vadim Zeitlin
b845aa636a Fix reading of files with Mac EOLs in wxTextFile.
The last CR-terminated line wasn't handled correctly.

Fix this now and add unit tests to ensure that it stays fixed.

Closes #15583.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-15 13:04:23 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
9a83f86094 Globally replace _T() with wxT().
Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-23 20:30:22 +00:00
Vadim Zeitlin
2059910d0b fix bug introduced by the last change: we could overwrite the buffer if the file size changed while we were reading it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-13 19:40:42 +00:00
Vadim Zeitlin
29a96d3c09 avoid extra reallocations and memcpy for seekable files in OnRead() (slightly modified patch 1935975)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-11 17:44:32 +00:00
Vadim Zeitlin
646c7e13ea corrected VC warning about possibly uninitialized variable in the last change
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44250 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-01-18 20:37:12 +00:00
Vadim Zeitlin
6594faa98e make wxTextFile work with unseekable files again (patch 1632613, bug 1629581)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-01-18 20:29:12 +00:00
Vadim Zeitlin
abc912df18 give the file name in the error message about failed Unicode conversion
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-12-04 16:50:51 +00:00
Václav Slavík
82bf96f548 don't crash on weird line endings like \r\r\n
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41829 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-09 19:28:46 +00:00
Vadim Zeitlin
830f8f11bc 1. changed all "wxMBConv& conv" parameters to "const wxMBConv&"
2. this allows to use wxConvAuto() instead of wxConvUTF8 as default value
   for this parameter in the classes which read text from the file: wxConvAuto
   automatically recognizes the BOM at the start of file and uses the correct
   conversion
3. don't use Windows for UTF-7 conversions as there is no way to make it
   fail on invalid UTF-7 strings; use our own wxMBConvUtf7 instead


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-04-05 14:37:47 +00:00
Włodzimierz Skiba
47eb93d02d Warning fix.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-04-03 17:38:05 +00:00
Vadim Zeitlin
44327ff375 don't give error when reading empty file in Unicode build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-31 14:00:31 +00:00
Vadim Zeitlin
dbcf443c7d rewrote Read() to slurp all the file at once to avoid problems in Unicode build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-31 13:53:20 +00:00
Vadim Zeitlin
c1981a2fa4 don't process previously read characters twice in OnRead()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-30 14:04:46 +00:00
Vadim Zeitlin
0cc88b4bb4 wxUSE_STL==1 compilation fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38431 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-29 14:22:03 +00:00
Włodzimierz Skiba
39987096b3 Warning fix.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-28 10:48:55 +00:00
Vadim Zeitlin
b260e323ea properly NUL-terminate the buffer before converting it to Unicode: we may need more than one trailing NUL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-28 00:05:52 +00:00
Vadim Zeitlin
86948c99a6 made wxTextFile work in Unicode; also made it possible to use it with non seekable files
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-27 23:27:29 +00:00
Mart Raudsepp
8907154c1a Nuke #pragma implementation/interface's
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-23 12:56:45 +00:00
Vadim Zeitlin
30984deafc new set of fixes for problems due to huge files support: drop wxFileSize_t, use wxFileOffset only, make wxInvalidOffset an int (main part of the patch 1063498)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-11-10 21:02:58 +00:00
Vadim Zeitlin
67c20e133e use wxFileSize_t instead of wxFileOffset or off_t
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-10-15 00:34:21 +00:00
Włodzimierz Skiba
cb719f2e29 Source cleaning: whitespaces, tabs, -1/wxID_ANY/wxNOT_FOUND/wxDefaultCoord, TRUE/true, FALSE/false, !!/!IsEmpty().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-09-23 18:20:56 +00:00
Julian Smart
655719367a Use old licence name
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-23 20:53:33 +00:00
Julian Smart
77ffb5937e Name and version changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-23 14:56:36 +00:00
Václav Slavík
14f355c2b5 added support for gcc precompiled headers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-09 12:46:53 +00:00
Julian Smart
55d99c7a77 Fixed copyrights and licence spelling
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19595 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-03-17 11:28:33 +00:00
Václav Slavík
32a0d013e9 changed wxFileName::Normalize signature to allow or-combination of flags and reverted Julian's hack-fix to wxTextFile
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-02-02 23:14:45 +00:00
Julian Smart
aa21a09f91 Corrected Normalize invocation by casting
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-31 12:29:54 +00:00
Julian Smart
baed107708 Removed wxPATH_NORM_CASE from Normalize or files won't be written
back as the same filename.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-31 12:25:50 +00:00
Václav Slavík
d9ade1df2f rewrote wxTextFile::OnRead to handle variable-length encodings correctly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-17 23:41:02 +00:00
Ron Lee
deab45402f Use GetFullPath not GetFullName in OnWrite else we'll always write the
file to the cwd.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-03 06:22:38 +00:00
Vadim Zeitlin
68c97af3c3 blind fix for temp file creation problem
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-19 21:40:50 +00:00
Vadim Zeitlin
77f859c38e fixed assert to avoid compilation warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-01 12:56:01 +00:00
David Webster
27752aab2a Can't just wxASSERT(0). Give "constant in conditional expression" errors on some compilers. Also bad control codes on the end of some preprocessor constants.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-11-30 22:10:31 +00:00
Mattia Barbon
9298c435cf Converting uninitialized data is not a Good Idea
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12582 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-11-22 09:09:17 +00:00
Vadim Zeitlin
a3a584a7a6 added wxTextBuffer and wxMemoryText which allow to use wxTextFile with in-memory data
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12424 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-11-14 20:40:20 +00:00
Gilles Depeyrot
a73523797c added comment concerning native line endings under Mac OS X
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12239 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-10-31 22:41:08 +00:00
Václav Slavík
adfed1ca92 Unicodification of wxTextFile
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-08-06 22:40:57 +00:00
Václav Slavík
4d5cd6e05d fixed wxTextFile::GuessType assertion
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-12-20 23:06:40 +00:00
Bryan Petty
f6bcfd974e merged 2.2 branch
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-07-15 19:51:35 +00:00
Vadim Zeitlin
b01ca3e3d9 fixed double eol problem
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-04-11 14:34:38 +00:00
Michael Bedward
1b6dea5de1 Added Create functions. They return TRUE if the file was successfully
created; FALSE if it couldn't be created (or already exists - is that
ok?).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-03-07 10:02:25 +00:00
Guillermo Rodriguez Garcia
967a322fe9 Don't try to translate empty strings (just a cosmetical issue - it should
not fail anyway, but it is cleaner this way)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-02-20 01:08:40 +00:00
Vadim Zeitlin
c0f587c500 bug fixes for '\r' handling in wxTextFile::Translate()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-01-06 15:24:37 +00:00
Vadim Zeitlin
ef8d96c29c wxThread::GetCPUCount() and SetConcurrency() added and documented
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-12-06 12:31:04 +00:00
Karsten Ballüder
223d09f6b5 replaced T() makro with wxT() due to namespace probs, _T() exists, too
fixed compilation problems, mainly in html code
compiles and links fine on Solaris, runs with samples and Mahogany


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-10-08 14:35:56 +00:00
Vadim Zeitlin
e90c1d2a19 many changes; major ones:
1. start of !wxUSE_GUI support
2. _T() macro renamed to T()
3. wxConvertWX2MB and MB2WX macro added


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-10-04 20:15:38 +00:00
David Webster
717b9bf234 OS/2 updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-07-30 21:47:13 +00:00
Vadim Zeitlin
a1b82138ef 1. new wxFFile class - as wxFile but uses fopen/fread/fseek... instead of
open/read/seek...
2. wxTextCtrlBase appears, several bug fixes in MSW wxTextCtrl and made
   LoadFile() behave in the same way under GTK and MSW (fixed it for MSW
   too)
3. Corrected the sash position calculation in sashwin.cpp - seems to work
   now but I wonder how it could ever work before?
4. new, tmake generated, MSW makefiles. They probably don't work - will fix
   them as soon as people start complaining.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-07-14 22:55:57 +00:00
Vadim Zeitlin
7cc98b3e3f 1. minor fixes in wxDynLib
2. added more symbols to winundef.h
3. fixed wxTextFile::IsOpen() - now it does what you'd suppose
4. listctrl now updates the item image when it changes
5. file dlg checks for an error and gives a message about it (debug only)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-07-10 00:50:16 +00:00