Tag: cws_dev300_rptchart02
User: oj      
Date: 2008-03-12 09:27:11+0000
Modified:
   dba/dbaccess/qa/complex/dbaccess/RowSet.java
   dba/dbaccess/source/core/api/RowSet.cxx

Log:
 clear parameter when setting new command

File Changes:

Directory: /dba/dbaccess/qa/complex/dbaccess/
=============================================

File [changed]: RowSet.java
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/qa/complex/dbaccess/RowSet.java?r1=1.9&r2=1.9.30.1
Delta lines:  +23 -3
--------------------
--- RowSet.java 2008-01-30 08:27:03+0000        1.9
+++ RowSet.java 2008-03-12 09:27:08+0000        1.9.30.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: RowSet.java,v $
  *
- *  $Revision: 1.9 $
+ *  $Revision: 1.9.30.1 $
  *
- *  last change: $Author: rt $ $Date: 2008/01/30 08:27:03 $
+ *  last change: $Author: oj $ $Date: 2008/03/12 09:27:08 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -817,6 +817,24 @@
             assure( "testing the parameters of a table failed" + 
e.getMessage(), false );
         }
     }
+       // 
--------------------------------------------------------------------------------------------------------
+       private void testParametersAfterNormalExecute()
+       {
+               try
+               {
+                       createRowSet( "SELECT * FROM \"customers\"", 
CommandType.COMMAND, true );
+                       m_rowSetProperties.setPropertyValue( "Command", "SELECT 
* FROM \"customers\" WHERE \"City\" = :city");  
+                       XParameters rowsetParams = 
(XParameters)UnoRuntime.queryInterface( XParameters.class,
+                               m_rowSet );
+                       rowsetParams.setString( 1, "London" );
+                       m_rowSet.execute();
+               }
+               catch( AssureException e ) { throw e; }
+               catch( Exception e )
+               {
+                       assure( "testing the parameters of a table failed" + 
e.getMessage(), false );
+               }
+       }
 
     // 
--------------------------------------------------------------------------------------------------------
     private void verifyParameters( String[] _paramNames, String _context ) 
throws com.sun.star.uno.Exception
@@ -934,6 +952,8 @@
         testParametrizedQuery();
         testParametersInFilter();
 
+               testParametersAfterNormalExecute();
+
         testParametersInteraction();
    }
 }
\ No newline at end of file

Directory: /dba/dbaccess/source/core/api/
=========================================

File [changed]: RowSet.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSet.cxx?r1=1.155&r2=1.155.30.1
Delta lines:  +13 -6
--------------------
--- RowSet.cxx  2008-01-30 08:29:04+0000        1.155
+++ RowSet.cxx  2008-03-12 09:27:08+0000        1.155.30.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: RowSet.cxx,v $
  *
- *  $Revision: 1.155 $
+ *  $Revision: 1.155.30.1 $
  *
- *  last change: $Author: rt $ $Date: 2008/01/30 08:29:04 $
+ *  last change: $Author: oj $ $Date: 2008/03/12 09:27:08 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -2462,10 +2462,17 @@
 
     if ( m_pParameters.is() )
     {
+               if ( m_bCommandFacetsDirty )
+        // need to rebuild the parameters, since some property which 
contributes to the
+        // complete command, and thus the parameters, changed
+                       impl_disposeParametersContainer_nothrow();
+               if ( m_pParameters.is() )
+               {
         if ( (size_t)parameterIndex > m_pParameters->size() )
                    throwInvalidIndexException( *this );
         return (*m_pParameters)[ parameterIndex - 1 ];
     }
+    }
 
     if ( m_aPrematureParamValues.size() < (size_t)parameterIndex )
                m_aPrematureParamValues.resize( parameterIndex );




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

Reply via email to