Tag: cws_dev300_rptchart02
User: oj      
Date: 2008-05-20 08:29:14+0000
Modified:
   dba/connectivity/source/drivers/dbase/DTable.cxx
   dba/connectivity/source/parse/sqlbison.y
   dba/connectivity/source/parse/sqliterator.cxx
   dba/connectivity/source/parse/sqlnode.cxx

Log:
 #i84290# range_variable changed

File Changes:

Directory: /dba/connectivity/source/drivers/dbase/
==================================================

File [changed]: DTable.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/dbase/DTable.cxx?r1=1.105&r2=1.105.14.1
Delta lines:  +20 -16
---------------------
--- DTable.cxx  2008-04-10 08:37:29+0000        1.105
+++ DTable.cxx  2008-05-20 08:29:10+0000        1.105.14.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: DTable.cxx,v $
- * $Revision: 1.105 $
+ * $Revision: 1.105.14.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -1547,19 +1547,23 @@
                                        // sein koennte und muesste
 
                                        ByteString aDefaultValue = 
::rtl::math::doubleToString( n, rtl_math_StringFormat_F, nScale, '.', NULL, 0);
-                    sal_Int32 nRealLen = aDefaultValue.Len() - nScale;
+                    sal_Int32 nRealLen = aDefaultValue.Len();
+                    BOOL bValidLength  = nRealLen <= nLen;
+                    if ( bValidLength )
+                    {
+                        nRealLen -= nScale;
                     if ( nScale ) // for '.'
                         --nRealLen;
                     if ( n < 0.0 ) // for the sign '-'
                         --nRealLen;
                     
-                                       BOOL bValidLength       = sal_False;
-                                       if ( nRealLen <= (nRealPrecision - 
nScale) )
+                           bValidLength = nRealLen < nRealPrecision;
+                                           if ( bValidLength )
                                        {
                                                
strncpy(pData,aDefaultValue.GetBuffer(),nLen);
                                                // write the resulting double 
back
                                                *rRow[nPos] = 
toDouble(aDefaultValue);
-                                               bValidLength = TRUE;
+                                           } // if ( nRealLen < nRealPrecision 
)
                                        }
                                        if (!bValidLength)
                                        {

Directory: /dba/connectivity/source/parse/
==========================================

File [changed]: sqlbison.y
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlbison.y?r1=1.63&r2=1.63.18.1
Delta lines:  +5 -3
-------------------
--- sqlbison.y  2008-04-10 11:50:22+0000        1.63
+++ sqlbison.y  2008-05-20 08:29:11+0000        1.63.18.1
@@ -9,7 +9,7 @@
 //
 // $RCSfile: sqlbison.y,v $
 //
-// $Revision: 1.63 $
+// $Revision: 1.63.18.1 $
 //
 // This file is part of OpenOffice.org.
 //
@@ -3090,7 +3090,9 @@
        ;
 ***/
 
-range_variable: SQL_TOKEN_NAME
+range_variable: 
+        {$$ = SQL_NEW_RULE;}
+    |   SQL_TOKEN_NAME
        ;
 
 user:  SQL_TOKEN_NAME

File [changed]: sqliterator.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqliterator.cxx?r1=1.57&r2=1.57.18.1
Delta lines:  +11 -6
--------------------
--- sqliterator.cxx     2008-04-10 11:52:50+0000        1.57
+++ sqliterator.cxx     2008-05-20 08:29:11+0000        1.57.18.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: sqliterator.cxx,v $
- * $Revision: 1.57 $
+ * $Revision: 1.57.18.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -514,6 +514,7 @@
     }
     else
     {
+        sal_uInt32 nTableRangePos = 0;
         if ( pTableRef->count() == 4 )
         {
             if ( SQL_ISPUNCTUATION( pTableRef->getChild(0), "{" ) )
@@ -523,7 +524,7 @@
             else
             {   // table_node as range_variable op_column_commalist
                 pTableNameNode = pTableRef->getChild(0);
-                rTableRange = pTableRef->getChild(2)->getTokenValue();
+                nTableRangePos = 2;
             }
         }
         else if ( pTableRef->count() == 3 )
@@ -534,7 +535,7 @@
             if ( SQL_ISRULE( pQueryExpression, select_statement ) )
             {
                 getSelect_statement( *m_pImpl->m_pSubTables, pQueryExpression 
);
-                rTableRange = pTableRef->getChild(2)->getTokenValue();
+                nTableRangePos = 2;
             }
             else
             {
@@ -545,7 +546,7 @@
         {
             // '(' joined_table ')' as range_variable op_column_commalist
             getQualified_join( _rTables, pTableRef->getChild(1), rTableRange );
-            rTableRange = pTableRef->getChild(4)->getTokenValue();
+            nTableRangePos = 4;
         }
         else if ( pTableRef->count() == 1 )
         {
@@ -554,6 +555,9 @@
         }
         else
             OSL_ENSURE( false, "OSQLParseTreeIterator::getTableNode: unhandled 
case!" );
+
+        if ( nTableRangePos != 0 && 
pTableRef->getChild(nTableRangePos)->isToken() )
+            rTableRange = pTableRef->getChild(nTableRangePos)->getTokenValue();
     }
 
        return pTableNameNode;
@@ -593,6 +597,7 @@
                 {   // table_node as range_variable op_column_commalist
                     OSL_ENSURE( 
pTableListElement->getChild(1)->getKnownRuleID() == OSQLParseNode::as,
                         "OSQLParseTreeIterator::getSelect_statement: table_ref 
rules changed?" );
+                    if ( pTableListElement->getChild(2)->isToken() )
                                        aTableRange = 
pTableListElement->getChild(2)->getTokenValue();
                 }
                                traverseOneTableName( _rTables, pTableName, 
aTableRange );

File [changed]: sqlnode.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlnode.cxx?r1=1.54&r2=1.54.18.1
Delta lines:  +16 -9
--------------------
--- sqlnode.cxx 2008-04-10 11:54:38+0000        1.54
+++ sqlnode.cxx 2008-05-20 08:29:11+0000        1.54.18.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: sqlnode.cxx,v $
- * $Revision: 1.54 $
+ * $Revision: 1.54.18.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -432,7 +432,7 @@
 
     // table refs
     case table_ref:
-        if  (   ( nCount == 4 )
+        if  (   ( nCount == 4 ) || ( nCount == 3 )
             ||  ( ( nCount == 6 ) &&  SQL_ISPUNCTUATION( m_aChilds[0], "(" ) )
             )
         {
@@ -696,11 +696,15 @@
        sal_uInt32 nCount(count());
        rString += ::rtl::OUString::createFromAscii(" ");
 
-       if (nCount == 4)
+       if ( nCount == 3 || nCount == 4 )
        {
                m_aChilds[0]->impl_parseNodeToString_throw( rString, rParam );
+        if ( m_aChilds[2]->isToken() )
+        {
                m_aChilds[1]->impl_parseNodeToString_throw( rString, rParam );
                m_aChilds[2]->impl_parseNodeToString_throw( rString, rParam );
+        } // if ( m_aChilds[2]->isToken() )
+        if ( nCount == 4 )
                m_aChilds[3]->impl_parseNodeToString_throw( rString, rParam );
        }
        else if(nCount == 6 && SQL_ISPUNCTUATION(m_aChilds[0],"("))
@@ -708,8 +712,11 @@
                m_aChilds[0]->impl_parseNodeToString_throw( rString, rParam );
                m_aChilds[1]->impl_parseNodeToString_throw( rString, rParam );
                m_aChilds[2]->impl_parseNodeToString_throw( rString, rParam );
+        if ( m_aChilds[4]->isToken() )
+        {
                m_aChilds[3]->impl_parseNodeToString_throw( rString, rParam );
                m_aChilds[4]->impl_parseNodeToString_throw( rString, rParam );
+        }
                m_aChilds[5]->impl_parseNodeToString_throw( rString, rParam );
        }
 }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to