diff options
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/db/SQLQueryComposer.java | 56 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/FilterComponent.java | 2 |
2 files changed, 1 insertions, 57 deletions
diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java index d169f7dd951a..17bc953affa9 100644 --- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java +++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java @@ -429,62 +429,6 @@ public class SQLQueryComposer } } - /** - * retrieves a normalized structured filter - * - * <p>XSingleSelectQueryComposer.getStructuredFilter has a strange habit of returning the predicate (equal, not equal, etc) - * effectively twice: Once as SQLFilterOperator, and once in the value. That is, if you have a term {@literal "column <> 3"}, then - * you'll get an SQLFilterOperator.NOT_EQUAL (which is fine), <strong>and</strong> the textual value of the condition - * will read {@literal "<> 3"}. The latter is strange enough, but even more strange is that this behavior is not even consistent: - * for SQLFilterOperator.EQUAL, the "=" sign is not include in the textual value.</p> - * - * <p>To abstract from this weirdness, use this function here, which strips the unwanted tokens from the textual value - * representation.</p> - */ - public PropertyValue[][] getNormalizedStructuredFilter() - { - final PropertyValue[][] structuredFilter = m_queryComposer.getStructuredFilter(); - for (int i = 0; i < structuredFilter.length; ++i) - { - for (int j = 0; j < structuredFilter[i].length; ++j) - { - if (!(structuredFilter[i][j].Value instanceof String)) - { - continue; - } - final StringBuffer textualValue = new StringBuffer((String) structuredFilter[i][j].Value); - switch (structuredFilter[i][j].Handle) - { - case SQLFilterOperator.EQUAL: - break; - case SQLFilterOperator.NOT_EQUAL: - case SQLFilterOperator.LESS_EQUAL: - case SQLFilterOperator.GREATER_EQUAL: - textualValue.delete(0, 2); - break; - case SQLFilterOperator.LESS: - case SQLFilterOperator.GREATER: - textualValue.delete(0, 1); - break; - case SQLFilterOperator.NOT_LIKE: - textualValue.delete(0, 8); - break; - case SQLFilterOperator.LIKE: - textualValue.delete(0, 4); - break; - case SQLFilterOperator.SQLNULL: - textualValue.delete(0, 7); - break; - case SQLFilterOperator.NOT_SQLNULL: - textualValue.delete(0, 11); - break; - } - structuredFilter[i][j].Value = textualValue.toString().trim(); - } - } - return structuredFilter; - } - public XSingleSelectQueryComposer getQueryComposer() { return m_queryComposer; diff --git a/wizards/com/sun/star/wizards/ui/FilterComponent.java b/wizards/com/sun/star/wizards/ui/FilterComponent.java index ad1eb18ca318..b6c39fc55603 100644 --- a/wizards/com/sun/star/wizards/ui/FilterComponent.java +++ b/wizards/com/sun/star/wizards/ui/FilterComponent.java @@ -274,7 +274,7 @@ public class FilterComponent composer.getQueryComposer().appendFilterByColumn(columnSet, getfilterstate() == this.SOI_MATCHALL, nOperator); } } - filterconditions = composer.getNormalizedStructuredFilter(); + filterconditions = composer.getQueryComposer().getStructuredFilter(); int[] iduplicate = JavaTools.getDuplicateFieldIndex(filterconditions); if (iduplicate[0] != -1) { |