better use OUString::endsWithIgnoreAsciiCase()

Change-Id: Ieedb71e58b1a690a38fcc93c56ea49483c224278
This commit is contained in:
Eike Rathke 2013-12-19 17:52:51 +01:00
parent d340d3bbcf
commit 255bd89286

View file

@ -292,15 +292,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,OUString aDatName,
bool bIsCSV = false;
bool bIsTSV = false;
if (aDatName.getLength() >= 4)
{
// All handled extensions (csv, tsv, tab) have length of 3
OUString aExtWithDot = aDatName.copy(aDatName.getLength() - 4);
if ( aExtWithDot.equalsIgnoreAsciiCase(".tsv") || aExtWithDot.equalsIgnoreAsciiCase(".tab") )
bIsTSV = true;
else if ( aExtWithDot.equalsIgnoreAsciiCase(".csv") )
if ( aDatName.endsWithIgnoreAsciiCase(".csv") )
bIsCSV = true;
}
else if ( aDatName.endsWithIgnoreAsciiCase(".tsv") || aDatName.endsWithIgnoreAsciiCase(".tab") )
bIsTSV = true;
// Default options are set in officecfg/registry/schema/org/openoffice/Office/Calc.xcs
OUString sFieldSeparators(",;\t");