-rw-r--r-- | libopie/pim/ocontactaccessbackend_xml.cpp | 22 | ||||
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp | 22 |
2 files changed, 44 insertions, 0 deletions
diff --git a/libopie/pim/ocontactaccessbackend_xml.cpp b/libopie/pim/ocontactaccessbackend_xml.cpp index 661cd51..097142b 100644 --- a/libopie/pim/ocontactaccessbackend_xml.cpp +++ b/libopie/pim/ocontactaccessbackend_xml.cpp | |||
@@ -19,2 +19,5 @@ | |||
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.6 2003/07/07 16:19:47 eilers | ||
21 | * Fixing serious bug in hasQuerySettings() | ||
22 | * | ||
20 | * Revision 1.5 2003/04/13 18:07:10 zecke | 23 | * Revision 1.5 2003/04/13 18:07:10 zecke |
@@ -449,2 +452,18 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const | |||
449 | 452 | ||
453 | // Step 1: Check whether the given settings are supported by this backend | ||
454 | if ( ( querySettings & ( | ||
455 | OContactAccess::IgnoreCase | ||
456 | | OContactAccess::WildCards | ||
457 | | OContactAccess::DateDiff | ||
458 | | OContactAccess::DateYear | ||
459 | | OContactAccess::DateMonth | ||
460 | | OContactAccess::DateDay | ||
461 | | OContactAccess::RegExp | ||
462 | | OContactAccess::ExactMatch | ||
463 | ) ) != querySettings ) | ||
464 | return false; | ||
465 | |||
466 | // Step 2: Check whether the given combinations are ok.. | ||
467 | |||
468 | // IngoreCase alone is invalid | ||
450 | if ( querySettings == OContactAccess::IgnoreCase ) | 469 | if ( querySettings == OContactAccess::IgnoreCase ) |
@@ -452,2 +471,3 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const | |||
452 | 471 | ||
472 | // WildCards, RegExp and ExactMatch should never used at the same time | ||
453 | switch ( querySettings & ~( OContactAccess::IgnoreCase | 473 | switch ( querySettings & ~( OContactAccess::IgnoreCase |
@@ -465,2 +485,4 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const | |||
465 | return ( true ); | 485 | return ( true ); |
486 | case 0: // one of the upper removed bits were set.. | ||
487 | return ( true ); | ||
466 | default: | 488 | default: |
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 @@ | |||
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.6 2003/07/07 16:19:47 eilers | ||
21 | * Fixing serious bug in hasQuerySettings() | ||
22 | * | ||
20 | * Revision 1.5 2003/04/13 18:07:10 zecke | 23 | * Revision 1.5 2003/04/13 18:07:10 zecke |
@@ -449,2 +452,18 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const | |||
449 | 452 | ||
453 | // Step 1: Check whether the given settings are supported by this backend | ||
454 | if ( ( querySettings & ( | ||
455 | OContactAccess::IgnoreCase | ||
456 | | OContactAccess::WildCards | ||
457 | | OContactAccess::DateDiff | ||
458 | | OContactAccess::DateYear | ||
459 | | OContactAccess::DateMonth | ||
460 | | OContactAccess::DateDay | ||
461 | | OContactAccess::RegExp | ||
462 | | OContactAccess::ExactMatch | ||
463 | ) ) != querySettings ) | ||
464 | return false; | ||
465 | |||
466 | // Step 2: Check whether the given combinations are ok.. | ||
467 | |||
468 | // IngoreCase alone is invalid | ||
450 | if ( querySettings == OContactAccess::IgnoreCase ) | 469 | if ( querySettings == OContactAccess::IgnoreCase ) |
@@ -452,2 +471,3 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const | |||
452 | 471 | ||
472 | // WildCards, RegExp and ExactMatch should never used at the same time | ||
453 | switch ( querySettings & ~( OContactAccess::IgnoreCase | 473 | switch ( querySettings & ~( OContactAccess::IgnoreCase |
@@ -465,2 +485,4 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const | |||
465 | return ( true ); | 485 | return ( true ); |
486 | case 0: // one of the upper removed bits were set.. | ||
487 | return ( true ); | ||
466 | default: | 488 | default: |