[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Thu Dec 19 08:53:42 PST 2013


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

New commits:
commit 255bd89286a09f715d08ea63681ea35f8bc8dacb
Author: Eike Rathke <erack at 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");


More information about the Libreoffice-commits mailing list