diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-01-14 18:07:51 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-01-14 18:11:10 +0100 |
commit | ab6e083f7d58b541a78b1a78ba127941808b2ed4 (patch) | |
tree | f7ef71f6d08ee1163e355d668e37098cddf0054e /connectivity/source/drivers/evoab2 | |
parent | 3bf277a044ded4e117020b42677bf45a307ffb76 (diff) |
bool improvements
Change-Id: Ibe8e80169b222e425df7016a0012591793546adf
Diffstat (limited to 'connectivity/source/drivers/evoab2')
-rw-r--r-- | connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx index adb178333492..2ae114fbccde 100644 --- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx @@ -41,13 +41,9 @@ using namespace com::sun::star::sdbcx; namespace { - int libo_strcmp0 (const char *str1, const char *str2) + bool equal(const char *str1, const char *str2) { - if (!str1) - return -(str1 != str2); - if (!str2) - return str1 != str2; - return strcmp (str1, str2); + return str1 == 0 || str2 == 0 ? str1 == str2 : strcmp(str1, str2) == 0; } } @@ -1093,7 +1089,7 @@ bool isSourceBackend(ESource *pSource, const char *backendname) return false; gpointer extension = e_source_get_extension (pSource, E_SOURCE_EXTENSION_ADDRESS_BOOK); - return extension && libo_strcmp0 (e_source_backend_get_backend_name (extension), backendname) == 0; + return extension && equal(e_source_backend_get_backend_name (extension), backendname); } Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables( |