check string length of file name before attempting to copy
File names CAN be shorter than 4 characters if they don't have a 3 character file name extension and the filter was selected. Change-Id: Ic25bdf44cd44d48313c748525e75318e05240e8e
This commit is contained in:
parent
e500b25b08
commit
d340d3bbcf
1 changed files with 9 additions and 5 deletions
|
@ -292,11 +292,15 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,OUString aDatName,
|
|||
bool bIsCSV = false;
|
||||
bool bIsTSV = false;
|
||||
|
||||
OUString aExtWithDot = aDatName.copy(aDatName.getLength() - 4); // All handled extensions (csv, tsv, tab) have length of 3
|
||||
if ( aExtWithDot.equalsIgnoreAsciiCase(".tsv") || aExtWithDot.equalsIgnoreAsciiCase(".tab") )
|
||||
bIsTSV = true;
|
||||
else if ( aExtWithDot.equalsIgnoreAsciiCase(".csv") )
|
||||
bIsCSV = true;
|
||||
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") )
|
||||
bIsCSV = true;
|
||||
}
|
||||
|
||||
// Default options are set in officecfg/registry/schema/org/openoffice/Office/Calc.xcs
|
||||
OUString sFieldSeparators(",;\t");
|
||||
|
|
Loading…
Reference in a new issue