diff options
author | Martin van Zijl <martin.vanzijl@gmail.com> | 2018-02-27 07:35:25 +1300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-13 14:03:18 +0100 |
commit | 607ab542d043c24bfbd6a08bb62fbebd095114e3 (patch) | |
tree | be432c064af7342c924046e3f375a57a2b5a6ba0 /sw/source/filter/basflt | |
parent | 4fdd85d0029a4d66b844a4e31c1ab1e041a2567a (diff) |
Fix tdf#44291. Allow saving text without byte-order mark.
Change-Id: Ib16a4f37adcb2cfb3d2af9b6af21a4b32e4ae54c
Reviewed-on: https://gerrit.libreoffice.org/50388
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/filter/basflt')
-rw-r--r-- | sw/source/filter/basflt/fltini.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 16756e475729..8ecd122d8757 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -570,6 +570,7 @@ OUString NameFromCharSet(rtl_TextEncoding nChrSet) // 2. LineEnd - as CR/LR/CRLF // 3. Fontname // 4. Language +// 5. Whether to include byte-order-mark // the delimiter character is "," void SwAsciiOptions::ReadUserData( const OUString& rStr ) @@ -599,6 +600,9 @@ void SwAsciiOptions::ReadUserData( const OUString& rStr ) case 3: // Language nLanguage = LanguageTag::convertToLanguageTypeWithFallback( sToken ); break; + case 4: + bIncludeBOM = !(sToken.equalsIgnoreAsciiCase("FALSE")); + break; } } ++nCnt; @@ -634,6 +638,17 @@ void SwAsciiOptions::WriteUserData(OUString& rStr) rStr += LanguageTag::convertToBcp47(nLanguage); } rStr += ","; + + // 5. Whether to include byte-order-mark + if( bIncludeBOM ) + { + rStr += "true"; + } + else + { + rStr += "false"; + } + rStr += ","; } #ifdef DISABLE_DYNLOADING |