summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui/imoptdlg.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2018-12-24 02:46:29 +0900
committerEike Rathke <erack@redhat.com>2019-01-16 17:44:44 +0100
commit86501f577638b44042c35e601d13651992b64fd5 (patch)
tree15937c639c2104d12474b69aaee7dbb7537d50cf /sc/source/ui/dbgui/imoptdlg.cxx
parent2cf3b1709203931dc6defd5af67e3feecda4895a (diff)
tdf#106678 Implement CSV filter option's 8th token
... which decides whether number cells are stored as numbers or quoted like strings, as documented in <https://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options#Token_8.2C_csv_export> but long unimplemented. Note that in this implementation the false value of the above token is superseded and ignored if either "Fixed column width" (1st token) or "Save cell content as shown" (9th token) option is on. Change-Id: Ib4ff02a2be81a8590e1fc249725f02cd83e91118 Reviewed-on: https://gerrit.libreoffice.org/65604 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 a71eaee2feb3..efaf07d8585a 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -41,6 +41,7 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
eCharSet = RTL_TEXTENCODING_DONTKNOW;
bSaveAsShown = true; // "true" if not in string (after CSV import)
bQuoteAllText = false;
+ bSaveNumberAsSuch = true;
bSaveFormulas = false;
bRemoveSpace = false;
sal_Int32 nTokenCount = comphelper::string::getTokenCount(rStr, ',');
@@ -67,6 +68,8 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
// look at the same positions as in ScAsciiOptions
if ( nTokenCount >= 7 )
bQuoteAllText = rStr.getToken(6, ',') == "true";
+ if ( nTokenCount >= 8 )
+ bSaveNumberAsSuch = rStr.getToken(7, ',') == "true";
if ( nTokenCount >= 9 )
bSaveAsShown = rStr.getToken(8, ',') == "true";
if ( nTokenCount >= 10 )
@@ -89,7 +92,9 @@ OUString ScImportOptions::BuildString() const
// use the same string format as ScAsciiOptions:
",1,,0," + // first row, no column info, default language
OUString::boolean( bQuoteAllText ) + // same as "quoted field as text" in ScAsciiOptions
- ",true," + // "detect special numbers"
+ "," +
+ OUString::boolean( bSaveNumberAsSuch ) + // "save number as such": not in ScAsciiOptions
+ "," +
OUString::boolean( bSaveAsShown ) + // "save as shown": not in ScAsciiOptions
"," +
OUString::boolean( bSaveFormulas ) + // "save formulas": not in ScAsciiOptions