summaryrefslogtreecommitdiff
path: root/wizards/com/sun
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-06-30 16:56:40 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2013-06-30 16:58:09 +0200
commitc84370cc7f31845daf084e2d701cb982f0fc19dc (patch)
treeeebc8acede732d78305d6078b395adcd6c27225a /wizards/com/sun
parent97d279b4c54951547b8c8f4bd29376bd6e111593 (diff)
robustify
- Survive case where direction not given - make ascending default in stronger way Change-Id: I41ab2fd683ea71ea668e3ca3ee4a9618d67c0107
Diffstat (limited to 'wizards/com/sun')
-rw-r--r--wizards/com/sun/star/wizards/db/SQLQueryComposer.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
index 464c6c0fc199..f7f88fde10b1 100644
--- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
+++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
@@ -181,8 +181,12 @@ public class SQLQueryComposer
String sSortValue = CurDBMetaData.getSortFieldNames()[_SortIndex][0];
XPropertySet xColumn = CurDBMetaData.getColumnObjectByFieldName(sSortValue, _baddAliasFieldNames);
- String sSort = CurDBMetaData.getSortFieldNames()[_SortIndex][1];
- boolean bascend = (sSort.equals("ASC"));
+ String sSort = "ASC";
+ if(CurDBMetaData.getSortFieldNames()[_SortIndex].length > 1)
+ {
+ sSort = CurDBMetaData.getSortFieldNames()[_SortIndex][1];
+ }
+ boolean bascend = !(sSort.equals("DESC"));
m_queryComposer.appendOrderByColumn(xColumn, bascend);
}