diff options
author | Akshay Deep <akshaydeepiitr@gmail.com> | 2016-05-21 12:37:16 +0530 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-05-23 06:14:53 +0000 |
commit | 85ea267b7a8fbd5859569db6ef7ac8dd1bd9bcd1 (patch) | |
tree | ec7bebc861d14bf36bfa495c0bf852eec99b0644 /sfx2 | |
parent | c30ab370d7f574a1993e8770c9589296cbd54118 (diff) |
New Template Manager: Improved search for templates
Change-Id: I0a94abe09d82a58d892eb83aea0952d28aeb05ea
Reviewed-on: https://gerrit.libreoffice.org/25249
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 848aeb8733a2..2810ef5e79b7 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: |