[Libreoffice-commits] core.git: 2 commits - wizards/com

Lionel Elie Mamane lionel at mamane.lu
Sun Jun 30 07:58:45 PDT 2013


 wizards/com/sun/star/wizards/db/FieldColumn.java      |   10 ++++++++++
 wizards/com/sun/star/wizards/db/SQLQueryComposer.java |    8 ++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit c84370cc7f31845daf084e2d701cb982f0fc19dc
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Sun Jun 30 16:56:40 2013 +0200

    robustify
    
     - Survive case where direction not given
     - make ascending default in stronger way
    
    Change-Id: I41ab2fd683ea71ea668e3ca3ee4a9618d67c0107

diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
index 464c6c0..f7f88fd 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);
     }
 
commit 97d279b4c54951547b8c8f4bd29376bd6e111593
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Sun Jun 30 16:54:55 2013 +0200

    fdo#64985 try harder to populate m_sCommandName::m_sCommandName
    
    Change-Id: Ibef643498903c82eee5533d387a33ca26a77d496

diff --git a/wizards/com/sun/star/wizards/db/FieldColumn.java b/wizards/com/sun/star/wizards/db/FieldColumn.java
index 9f179fd..7f8cc70 100644
--- a/wizards/com/sun/star/wizards/db/FieldColumn.java
+++ b/wizards/com/sun/star/wizards/db/FieldColumn.java
@@ -90,6 +90,16 @@ public class FieldColumn
         m_sDisplayFieldName = m_sFieldName;
         ColIndex = JavaTools.FieldInList(_xColumns.getElementNames(), m_sFieldName) + 1;
         initializeFormatKeys(oCommandMetaData, _xColumns);
+        try
+        {
+            m_sCommandName = (String)m_xColPropertySet.getPropertyValue("TableName");
+        }
+        catch (com.sun.star.beans.UnknownPropertyException e)
+        {
+        }
+        catch (com.sun.star.lang.WrappedTargetException e)
+        {
+        }
     }
 
     public int getFieldType()


More information about the Libreoffice-commits mailing list