summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui/imoptdlg.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-29 16:13:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 08:27:52 +0200
commit5f646281f777019a4e91c467f1d6f8a7f2083ffd (patch)
tree742667b0a19517c75f1397df86ba45dd7e18b231 /sc/source/ui/dbgui/imoptdlg.cxx
parenta5be8e97b7699c7d12fa3ae5404af7b2eb50fafb (diff)
loplugin:flatten in sc/ui
Change-Id: I4e12da123924b1036c1348ad1b04eef1826ae26a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99703 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/dbgui/imoptdlg.cxx')
-rw-r--r--sc/source/ui/dbgui/imoptdlg.cxx64
1 files changed, 32 insertions, 32 deletions
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index 4229c2a307a5..071f1b0257bc 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -44,39 +44,39 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
bSaveFormulas = false;
bRemoveSpace = false;
sal_Int32 nTokenCount = comphelper::string::getTokenCount(rStr, ',');
- if ( nTokenCount >= 3 )
- {
- sal_Int32 nIdx{ 0 };
- // first 3 tokens: common
- 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(0, ',', nIdx).toInt32());
- aStrFont = rStr.getToken(0, ',', nIdx);
- eCharSet = ScGlobal::GetCharsetValue(aStrFont);
+ if ( nTokenCount < 3 )
+ return;
+
+ sal_Int32 nIdx{ 0 };
+ // first 3 tokens: common
+ 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(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(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(3, ',', nIdx) == "true"; // 7th token
- if ( nTokenCount >= 8 )
- bSaveNumberAsSuch = rStr.getToken(0, ',', nIdx) == "true";
- if ( nTokenCount >= 9 )
- bSaveAsShown = rStr.getToken(0, ',', nIdx) == "true";
- if ( nTokenCount >= 10 )
- bSaveFormulas = rStr.getToken(0, ',', nIdx) == "true";
- if ( nTokenCount >= 11 )
- bRemoveSpace = rStr.getToken(0, ',', nIdx) == "true";
- }
+ if ( nTokenCount == 4 )
+ {
+ // compatibility with old options string: "Save as shown" as 4th token, numeric
+ 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(3, ',', nIdx) == "true"; // 7th token
+ if ( nTokenCount >= 8 )
+ bSaveNumberAsSuch = rStr.getToken(0, ',', nIdx) == "true";
+ if ( nTokenCount >= 9 )
+ bSaveAsShown = rStr.getToken(0, ',', nIdx) == "true";
+ if ( nTokenCount >= 10 )
+ bSaveFormulas = rStr.getToken(0, ',', nIdx) == "true";
+ if ( nTokenCount >= 11 )
+ bRemoveSpace = rStr.getToken(0, ',', nIdx) == "true";
}
}