summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui/imoptdlg.cxx
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2023-01-20 12:08:13 +0100
committerEike Rathke <erack@redhat.com>2023-02-18 20:05:49 +0000
commit509ab788baf54285b4e38f2560326657d97510fd (patch)
tree52b5691914cba7eb0629d5539bef2c1d2b791748 /sc/source/ui/dbgui/imoptdlg.cxx
parent0a27403bbc36c89efa321fb3c5061fe4ee7095fb (diff)
tdf#82254 - Don't remove UTF-8 BOM from CSV when saving file
Don't remove the byte-order-mark in the resulting CSV file when it was present in the CSV source file. Change-Id: Id26abad2686917f320f2ace85441621bcf57ea9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145879 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/dbgui/imoptdlg.cxx')
-rw-r--r--sc/source/ui/dbgui/imoptdlg.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index b285c6ae968e..2777eb9e450b 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -47,6 +47,7 @@ ScImportOptions::ScImportOptions( std::u16string_view rStr )
bRemoveSpace = false;
nSheetToExport = 0;
bEvaluateFormulas = true; // true if not present at all, for compatibility
+ bIncludeBOM = false;
sal_Int32 nTokenCount = comphelper::string::getTokenCount(rStr, ',');
if ( nTokenCount < 3 )
return;
@@ -94,6 +95,8 @@ ScImportOptions::ScImportOptions( std::u16string_view rStr )
if ( nTokenCount >= 13 )
// If present, defaults to "false".
bEvaluateFormulas = o3tl::getToken(rStr, 0, ',', nIdx) == u"true";
+ if (nTokenCount >= 14)
+ bIncludeBOM = o3tl::getToken(rStr, 0, ',', nIdx) == u"true";
}
}
@@ -120,7 +123,9 @@ OUString ScImportOptions::BuildString() const
"," +
OUString::number(nSheetToExport) + // Only available for command line --convert-to
"," +
- OUString::boolean( bEvaluateFormulas ) ; // same as "Evaluate formulas" in ScAsciiOptions
+ OUString::boolean( bEvaluateFormulas ) + // same as "Evaluate formulas" in ScAsciiOptions
+ "," +
+ OUString::boolean(bIncludeBOM) ; // same as "Include BOM" in ScAsciiOptions
return aResult;
}