[Libreoffice-commits] .: dbaccess/source

Julien Nabet serval2412 at kemper.freedesktop.org
Sat Oct 22 02:27:19 PDT 2011


 dbaccess/source/ui/querydesign/QueryDesignView.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 48cdc0318b348c51742339b243dc05546148b335
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Oct 22 11:26:20 2011 +0200

    Fix fdo#38286. Perhaps it could be simplified

diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 8fc9e70..44c2503 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -3213,7 +3213,18 @@ void OQueryDesignView::fillFunctionInfo(  const ::connectivity::OSQLParseNode* p
     OQueryController& rController = static_cast<OQueryController&>(getController());
     sal_Int32 nDataType = DataType::DOUBLE;
     ::rtl::OUString sFieldName = sFunctionTerm;
-    OSQLParseNode* pFunctionName = pNode->getChild(0);
+    const OSQLParseNode* pFunctionName;
+    // Fix fdo#38286 : crash when constant in the query
+    // TODO : is it possible to have a child or children in the pNode ?
+    // if not this part could be simplified
+    if (pNode->count()) 
+    {
+        pFunctionName = pNode->getChild(0);
+    }
+    else
+    {
+        pFunctionName = pNode;
+    }
     if ( !SQL_ISPUNCTUATION(pFunctionName,"{") )
     {
         if ( SQL_ISRULEOR2(pNode,length_exp,char_value_fct) )


More information about the Libreoffice-commits mailing list