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

Akshay Deep akshaydeepiitr at gmail.com
Mon May 23 06:15:17 UTC 2016


 sfx2/source/doc/templatedlg.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 85ea267b7a8fbd5859569db6ef7ac8dd1bd9bcd1
Author: Akshay Deep <akshaydeepiitr at gmail.com>
Date:   Sat May 21 12:37:16 2016 +0530

    New Template Manager: Improved search for templates
    
    Change-Id: I0a94abe09d82a58d892eb83aea0952d28aeb05ea
    Reviewed-on: https://gerrit.libreoffice.org/25249
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: jan iversen <jani at documentfoundation.org>

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 848aeb8..2810ef5 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -127,7 +127,18 @@ public:
             bRet = aExt == "otg" || aExt == "std";
         }
 
-        return bRet && rItem.aName.matchIgnoreAsciiCase(maKeyword);
+        return bRet && MatchSubstring(rItem.aName);
+    }
+
+    bool MatchSubstring( OUString sItemName )
+    {
+        if(maKeyword.isEmpty())
+            return false;
+        sItemName = sItemName.toAsciiLowerCase();
+        maKeyword = maKeyword.toAsciiLowerCase();
+        if(sItemName.indexOf(maKeyword) >= 0)
+            return true;
+        return false;
     }
 
 private:


More information about the Libreoffice-commits mailing list