sc/source/ui/dbgui/scuiasciiopt.cxx |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 255bd89286a09f715d08ea63681ea35f8bc8dacb
Author: Eike Rathke <er...@redhat.com>
Date:   Thu Dec 19 17:52:51 2013 +0100

    better use OUString::endsWithIgnoreAsciiCase()
    
    Change-Id: Ieedb71e58b1a690a38fcc93c56ea49483c224278

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 6ecdcf6..95b528c 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -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") )
-            bIsCSV = true;
-    }
+    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");
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to