summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-01-04 17:49:08 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-01-05 12:25:31 +0100
commite9aa3c99d2ae577d9e2fbddc95f10d6230cf1e68 (patch)
tree8a54186f4ace2c20174902872202d1a46bf009e3 /xmlhelp
parentce3dd82ca83eb9f3ec89f0e6eaae4e170febec3a (diff)
Simplify code
Change-Id: I28cff254d2cc1e2abe6fc893d918bd84bfc8645c
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx23
1 files changed, 8 insertions, 15 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index c09f2d7e8cf4..14e5c1c1b2e4 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -316,8 +316,6 @@ const std::vector< OUString >& Databases::getModuleList( const OUString& Languag
osl::DirectoryItem aDirItem;
osl::FileStatus aStatus( osl_FileStatus_Mask_FileName );
- sal_Int32 idx;
-
if( osl::FileBase::E_None != dirFile.open() )
return m_avModules;
@@ -330,22 +328,17 @@ const std::vector< OUString >& Databases::getModuleList( const OUString& Languag
fileName = aStatus.getFileName();
// Check, whether fileName is of the form *.cfg
- idx = fileName.lastIndexOf( '.' );
-
- if( idx == -1 )
+ if (!fileName.endsWithIgnoreAsciiCase(".cfg", &fileName)) {
continue;
-
- const sal_Unicode* str = fileName.getStr();
-
- if( fileName.getLength() == idx + 4 &&
- ( str[idx + 1] == 'c' || str[idx + 1] == 'C' ) &&
- ( str[idx + 2] == 'f' || str[idx + 2] == 'F' ) &&
- ( str[idx + 3] == 'g' || str[idx + 3] == 'G' ) &&
- ( fileName = fileName.copy(0,idx).toAsciiLowerCase() ) != "picture" ) {
- if(! m_bShowBasic && fileName == "sbasic" )
+ }
+ fileName = fileName.toAsciiLowerCase();
+ if (fileName == "picture"
+ || (!m_bShowBasic && fileName == "sbasic"))
+ {
continue;
- m_avModules.push_back( fileName );
}
+
+ m_avModules.push_back( fileName );
}
}
return m_avModules;