Steps to reproduce: 1. Create a new document. 2. Make a header in one of the columns (in cell A1, for instance). The header should contain the dollar sign ('$'), e.g. 'X$USERS,C,16'. 3. Save the document in dBase format (*.dbf). The charset does not matter. 4. Close the document and open it again. 5. The dollar sign changed to underscore ('_'). In the example above the header will read 'X_USERS,C,16'. If a cell contains a dollar sign but it is not a column header, the sign stays there. Only the column headers are affected. It is possible to change the underscore to the dollar sign by editing the DBF in Notepad for example. Such file will be opened by Calc normally and the headers will contain dollar signs. However, after saving this file, the dollar signs will again change to underscores.
I can confirm with Version: 5.2.0.0.alpha0+ Build ID: 91a7580e03d5b47c6e2513afce85ddee45e730b6 CPU Threads: 4; OS Version: Linux 4.2; UI Render: GL; TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-02-04_00:17:43 and LO 3.5 Are you sure that $ character is allowed in header? I tried other characters @#%%^&* and all are substitute by _
Created attachment 122894 [details] Example of DBF containing '$'.
I've consulted the dBase format specifications (can be found here: http://web.archive.org/web/20150323061445/http://ulisse.elettra.trieste.it/services/doc/dbase/DBFstruct.htm#C1.2) and it does not contain any restrictions on header names. Moreover, it is possible to create a DBF file with '$' signs in headers (see attachment, I made it with LO Calc and then altered it with Notepad). Such files can be opened normally, headers change only when saving the file.
Ok, let's set to NEW then.
Here's a straightforward patch: diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index fe715fa66cf6..8aabdad1215c 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -565,7 +565,7 @@ void lcl_GetColumnTypes( sal_Unicode c; for ( const sal_Unicode* p = aFieldName.getStr(); ( c = *p ) != 0; p++ ) { - if ( rtl::isAsciiAlpha(c) || rtl::isAsciiDigit(c) || c == '_' ) + if ( rtl::isAsciiAlpha(c) || rtl::isAsciiDigit(c) || c == '_' || c == '$') aTmpStr += OUStringLiteral1(c); else aTmpStr += "_"; Lionel: with hexdump, I saw that exported file was dBaseIII (see http://opengrok.libreoffice.org/xref/core/connectivity/source/inc/dbase/DTable.hxx#dBaseIII) I don't find any doc which indicates precisely filename constraints. I read about 10 characters max and just ascii. But I suppose you can't use any ascii character. Any thoughts?
Michael: I found some ref here https://books.google.fr/books?id=JE6kukGlmwcC&pg=PA18&lpg=PA18&dq=%22field+name%22+dbase+authorized+character&source=bl&ots=QSH1P3b2Il&sig=xZzqPNx1m7sBGIrtnIo911K7XSs&hl=fr&sa=X&ved=0ahUKEwiKj8Oi5dTUAhUIJMAKHaNBDvIQ6AEISzAF#v=onepage&q=%22field%20name%22%20dbase%20authorized%20character&f=false indicating field shouldn't contain any special character except "_"
Julien is right. http://www.okstate.edu/sas/v8/sashtml/accpc/z0214453.htm "Filenames or field names start with a letter, and they can contain any combination of the letters A through Z, the digits 0 through 9, the colon (:) (in dBASE II field names only), and the underscore (_)." https://devzone.advantagedatabase.com/dz/webhelp/Advantage8.1/mergedProjects/ace/intro/supported_file_formats.htm "Field names in a DBF table are limited to just 10 characters and may contain only the letters a-z and A-Z, digits 0-9, and the underscore "_" character." https://bz.apache.org/ooo/show_bug.cgi?id=39683#c11 "A field name has to consist of alphanumeric (ASCII upper case alpha letters and digits) plus the underscore character."