summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}