Tag: cws_src680_dba24d User: fs Date: 2007-11-17 21:12:53+0000 Modified: dba/dbaccess/source/ui/uno/copytablewizard.cxx
Log: #i81658# disallow views when target connection does not support creating them / load some error strings from resource File Changes: Directory: /dba/dbaccess/source/ui/uno/ ======================================= File [changed]: copytablewizard.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/uno/copytablewizard.cxx?r1=1.1.2.9&r2=1.1.2.10 Delta lines: +23 -22 --------------------- --- copytablewizard.cxx 2007-11-15 15:17:51+0000 1.1.2.9 +++ copytablewizard.cxx 2007-11-17 21:12:51+0000 1.1.2.10 @@ -4,9 +4,9 @@ * * $RCSfile: copytablewizard.cxx,v $ * - * $Revision: 1.1.2.9 $ + * $Revision: 1.1.2.10 $ * - * last change: $Author: fs $ $Date: 2007/11/15 15:17:51 $ + * last change: $Author: fs $ $Date: 2007/11/17 21:12:51 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -35,6 +35,7 @@ #include "dbu_reghelper.hxx" #include "dbu_resource.hrc" +#include "dbu_uno.hrc" #include "dbustrings.hrc" #include "moduledbu.hxx" #include "sqlmessage.hxx" @@ -207,7 +208,7 @@ void impl_attributesToDialog_nothrow( OCopyTableWizard& _rDialog ) const; /// ensures the current dialog settings are reflected in our attributes - void impl_dialogToAttributes_nothrow(); + void impl_dialogToAttributes_nothrow( const OCopyTableWizard& _rDialog ); /** returns our typed dialog @@ -458,8 +459,7 @@ && !OCopyTableWizard::supportsViews( m_xDestConnection ) ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The destination database does not support views." ) ), - // TODO: resource: STR_CTW_NO_VIEWS_SUPPORT + String( ModuleRes( STR_CTW_NO_VIEWS_SUPPORT ) ), *this, 1 ); @@ -495,8 +495,7 @@ if ( _newPrimaryKey.IsPresent && !OCopyTableWizard::supportsPrimaryKey( m_xDestConnection ) ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The destination database does not support primary keys." ) ), - // TODO: resource: STR_CTW_NO_PRIMARY_KEY_SUPPORT + String( ModuleRes( STR_CTW_NO_PRIMARY_KEY_SUPPORT ) ), *this, 1 ); @@ -562,9 +561,17 @@ } //------------------------------------------------------------------------- - void CopyTableWizard::impl_dialogToAttributes_nothrow() + void CopyTableWizard::impl_dialogToAttributes_nothrow( const OCopyTableWizard& _rDialog ) { - // TODO + m_aPrimaryKeyName.IsPresent = _rDialog.shouldCreatePrimaryKey(); + if ( m_aPrimaryKeyName.IsPresent ) + m_aPrimaryKeyName.Value = _rDialog.getPrimaryKeyName(); + else + m_aPrimaryKeyName.Value = ::rtl::OUString(); + + m_sDestinationTable = _rDialog.getName(); + + m_nOperation = _rDialog.getOperation(); } //------------------------------------------------------------------------- @@ -654,8 +661,7 @@ if ( !bIsValid ) { throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no data access descriptor found, or no data access descriptor able to provide all necessary information" ) ), - // TODO: resource: STR_CTW_INVALID_DATA_ACCESS_DESCRIPTOR + String( ModuleRes( STR_CTW_INVALID_DATA_ACCESS_DESCRIPTOR ) ), *const_cast< CopyTableWizard* >( this ), _nArgPos + 1 ); @@ -704,8 +710,7 @@ break; default: throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Only tables and queries are supported at the moment." ) ), - // TODO: resource: STR_CTW_ONLY_TABLES_AND_QUERIES_SUPPORT + String( ModuleRes( STR_CTW_ONLY_TABLES_AND_QUERIES_SUPPORT ) ), *const_cast< CopyTableWizard* >( this ), 1 ); @@ -1028,8 +1033,7 @@ if ( bSelectedRecordsOnly && m_bSourceSelectionBookmarks && !xRowLocate.is() ) { ::dbtools::throwGenericSQLException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The copy source's result set must support bookmarks." ) ), - // TODO: resource: STR_CTW_COPY_SOURCE_NEEDS_BOOKMARKS + String( ModuleRes( STR_CTW_COPY_SOURCE_NEEDS_BOOKMARKS ) ), *this ); } @@ -1185,8 +1189,7 @@ default: { - ::rtl::OUString aMessage( RTL_CONSTASCII_USTRINGPARAM( "Unsupported source column type ($type$) at column position $pos$." ) ); - // TODO: resource: STR_CTW_UNSUPPORTED_COLUMN_TYPE + ::rtl::OUString aMessage( String( ModuleRes( STR_CTW_UNSUPPORTED_COLUMN_TYPE ) ) ); aMessage.replaceAt( aMessage.indexOfAsciiL( "$type$", 6 ), 6, ::rtl::OUString::valueOf( aSourceColTypes[ nSourceColumn ] ) ); aMessage.replaceAt( aMessage.indexOfAsciiL( "$pos$", 5 ), 5, ::rtl::OUString::valueOf( nSourceColumn ) ); @@ -1304,8 +1307,7 @@ sal_Int32 nArgCount( _rArguments.getLength() ); if ( ( nArgCount != 2 ) && ( nArgCount != 3 ) ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Illegal number of initialization parameters." ) ), - // TODO: resource: STR_CTW_ILLEGAL_PARAMETER_COUNT + String( ModuleRes( STR_CTW_ILLEGAL_PARAMETER_COUNT ) ), *this, 1 ); @@ -1340,8 +1342,7 @@ catch( const Exception& ) { throw WrappedTargetException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "An error occured during initialization." ) ), - // TODO: resource: STR_CTW_ERROR_DURING_INITIALIZATION + String( ModuleRes( STR_CTW_ERROR_DURING_INITIALIZATION ) ), *this, ::cppu::getCaughtException() ); @@ -1393,7 +1394,7 @@ // do this after impl_doCopy_nothrow: The attributes may change during copying, for instance // if the user entered an unqualified table name - impl_dialogToAttributes_nothrow(); + impl_dialogToAttributes_nothrow( impl_getDialog_throw() ); } //........................................................................ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
