author | eilers <eilers> | 2003-07-07 16:19:47 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-07-07 16:19:47 (UTC) |
commit | 7fed22ccbc1272fe0c5fb1c7f47bc330f118b854 (patch) (side-by-side diff) | |
tree | 73bd04b4fa6592f2a4caeee503c9a32ac89e24e8 /libopie2/opiepim/backend | |
parent | 1c24ec58bd7fc8a0a46cdaf41e4c6b7e68e4dba6 (diff) | |
download | opie-7fed22ccbc1272fe0c5fb1c7f47bc330f118b854.zip opie-7fed22ccbc1272fe0c5fb1c7f47bc330f118b854.tar.gz opie-7fed22ccbc1272fe0c5fb1c7f47bc330f118b854.tar.bz2 |
Fixing serious bug in hasQuerySettings()
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp index 661cd51..097142b 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp @@ -19,2 +19,5 @@ * $Log$ + * Revision 1.6 2003/07/07 16:19:47 eilers + * Fixing serious bug in hasQuerySettings() + * * Revision 1.5 2003/04/13 18:07:10 zecke @@ -449,2 +452,18 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const + // Step 1: Check whether the given settings are supported by this backend + if ( ( querySettings & ( + OContactAccess::IgnoreCase + | OContactAccess::WildCards + | OContactAccess::DateDiff + | OContactAccess::DateYear + | OContactAccess::DateMonth + | OContactAccess::DateDay + | OContactAccess::RegExp + | OContactAccess::ExactMatch + ) ) != querySettings ) + return false; + + // Step 2: Check whether the given combinations are ok.. + + // IngoreCase alone is invalid if ( querySettings == OContactAccess::IgnoreCase ) @@ -452,2 +471,3 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const + // WildCards, RegExp and ExactMatch should never used at the same time switch ( querySettings & ~( OContactAccess::IgnoreCase @@ -465,2 +485,4 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const return ( true ); + case 0: // one of the upper removed bits were set.. + return ( true ); default: |