summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui/imoptdlg.cxx
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2019-02-10 18:16:25 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2019-02-17 16:48:10 +0100
commit371c744799a3a5791e3a7d643aa8e84dff27527f (patch)
tree2bc66eac46fec00d8397748ff69a7c75d9c3b0c0 /sc/source/ui/dbgui/imoptdlg.cxx
parent1213cfde6b9052c1eb50b46d5cae2eef28d4b8b5 (diff)
Use indexed getToken()
Change-Id: I12f621a433d2f044fed11f7fac854c68efff9b5e Reviewed-on: https://gerrit.libreoffice.org/67658 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'sc/source/ui/dbgui/imoptdlg.cxx')
-rw-r--r--sc/source/ui/dbgui/imoptdlg.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index efaf07d8585a..a60541a85107 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -47,35 +47,36 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
sal_Int32 nTokenCount = comphelper::string::getTokenCount(rStr, ',');
if ( nTokenCount >= 3 )
{
+ sal_Int32 nIdx{ 0 };
// first 3 tokens: common
- OUString aToken( rStr.getToken( 0, ',' ) );
+ OUString aToken( rStr.getToken( 0, ',', nIdx ) );
if( aToken.equalsIgnoreAsciiCase( pStrFix ) )
bFixedWidth = true;
else
nFieldSepCode = ScAsciiOptions::GetWeightedFieldSep( aToken, true);
- nTextSepCode = static_cast<sal_Unicode>(rStr.getToken(1,',').toInt32());
- aStrFont = rStr.getToken(2,',');
+ nTextSepCode = static_cast<sal_Unicode>(rStr.getToken(0, ',', nIdx).toInt32());
+ aStrFont = rStr.getToken(0, ',', nIdx);
eCharSet = ScGlobal::GetCharsetValue(aStrFont);
if ( nTokenCount == 4 )
{
// compatibility with old options string: "Save as shown" as 4th token, numeric
- bSaveAsShown = rStr.getToken( 3, ',' ).toInt32() != 0;
+ bSaveAsShown = rStr.getToken(0, ',', nIdx).toInt32() != 0;
bQuoteAllText = true; // use old default then
}
else
{
// look at the same positions as in ScAsciiOptions
if ( nTokenCount >= 7 )
- bQuoteAllText = rStr.getToken(6, ',') == "true";
+ bQuoteAllText = rStr.getToken(3, ',', nIdx) == "true"; // 7th token
if ( nTokenCount >= 8 )
- bSaveNumberAsSuch = rStr.getToken(7, ',') == "true";
+ bSaveNumberAsSuch = rStr.getToken(0, ',', nIdx) == "true";
if ( nTokenCount >= 9 )
- bSaveAsShown = rStr.getToken(8, ',') == "true";
+ bSaveAsShown = rStr.getToken(0, ',', nIdx) == "true";
if ( nTokenCount >= 10 )
- bSaveFormulas = rStr.getToken(9, ',') == "true";
+ bSaveFormulas = rStr.getToken(0, ',', nIdx) == "true";
if ( nTokenCount >= 11 )
- bRemoveSpace = rStr.getToken(10, ',') == "true";
+ bRemoveSpace = rStr.getToken(0, ',', nIdx) == "true";
}
}
}