Tag: cws_src680_qiq User: fs Date: 06/05/18 02:18:03 Modified: /dba/dbaccess/source/ui/misc/ WCPage.cxx, WizardPages.src, dbumiscres.src
Log: #i51143# dbumiscres.src File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: WCPage.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/WCPage.cxx?r1=1.24&r2=1.24.124.1 Delta lines: +38 -33 --------------------- --- WCPage.cxx 8 Sep 2005 16:09:17 -0000 1.24 +++ WCPage.cxx 18 May 2006 09:18:00 -0000 1.24.124.1 @@ -4,9 +4,9 @@ * * $RCSfile: WCPage.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.24.124.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 16:09:17 $ + * last change: $Author: fs $ $Date: 2006/05/18 09:18:00 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -36,6 +36,9 @@ #ifndef DBAUI_WIZARD_CPAGE_HXX #include "WCPage.hxx" #endif +#ifndef DBACCESS_SOURCE_UI_MISC_DEFAULTOBJECTNAMECHECK_HXX +#include "defaultobjectnamecheck.hxx" +#endif #ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> #endif @@ -54,6 +57,9 @@ #ifndef _COM_SUN_STAR_SDBC_XRESULTSET_HPP_ #include <com/sun/star/sdbc/XResultSet.hpp> #endif +#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_ +#include <com/sun/star/sdb/CommandType.hpp> +#endif #ifndef _COM_SUN_STAR_SDBC_XROW_HPP_ #include <com/sun/star/sdbc/XRow.hpp> #endif @@ -75,6 +81,9 @@ #ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" #endif +#ifndef _CPPUHELPER_EXC_HLP_HXX_ +#include <cppuhelper/exc_hlp.hxx> +#endif using namespace ::dbaui; using namespace ::dbtools; @@ -82,6 +91,7 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::util; +using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; //======================================================================== @@ -134,9 +144,9 @@ } } } - catch(const SQLException& e) + catch(const SQLException&) { - ::dbaui::showError(SQLExceptionInfo(e),pParent->GetParent(),m_pParent->m_xFactory); + ::dbaui::showError( SQLExceptionInfo( ::cppu::getCaughtException() ), m_pParent, m_pParent->m_xFactory ); } } @@ -264,20 +274,16 @@ // first check if the table already exists in the database if( m_pParent->getCreateStyle() != OCopyTableWizard::WIZARD_APPEND_DATA ) { - Reference<XTablesSupplier > xSup(m_pParent->m_xConnection,UNO_QUERY); - Reference<XNameAccess> xTables; - if ( xSup.is() ) - xTables = xSup->getTables(); - if ( xTables.is() && xTables->hasByName(m_edTableName.GetText()) ) - { - String aInfoString( ModuleRes(STR_ERR_DUPL_TABLENAME) ); - aInfoString.SearchAndReplaceAscii("$name$",m_edTableName.GetText()); - InfoBox aNameInfoBox( this, aInfoString ); - aNameInfoBox.Execute(); + DynamicTableOrQueryNameCheck aNameCheck( m_pParent->m_xConnection, CommandType::TABLE ); + SQLExceptionInfo aErrorInfo; + if ( !aNameCheck.isNameValid( m_edTableName.GetText(), aErrorInfo ) ) + { + aErrorInfo.append( SQLExceptionInfo::SQL_CONTEXT, String( ModuleRes( STR_SUGGEST_APPEND_TABLE_DATA ) ) ); + ::dbaui::showError( aErrorInfo, m_pParent, m_pParent->m_xFactory ); return sal_False; } - else // we have to check the length of the table name - { + + // have to check the length of the table name Reference<XDatabaseMetaData> xMeta = m_pParent->m_xConnection->getMetaData(); ::rtl::OUString sCatalog; ::rtl::OUString sSchema; @@ -293,7 +299,6 @@ { ErrorBox(this, ModuleRes(ERROR_INVALID_TABLE_NAME_LENGTH)).Execute(); return sal_False; - } } // now we have to check if the name of the primary key already exists File [changed]: WizardPages.src Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/WizardPages.src?r1=1.45&r2=1.45.18.1 Delta lines: +6 -6 ------------------- --- WizardPages.src 31 Mar 2006 12:15:47 -0000 1.45 +++ WizardPages.src 18 May 2006 09:18:00 -0000 1.45.18.1 @@ -4,9 +4,9 @@ * * $RCSfile: WizardPages.src,v $ * - * $Revision: 1.45 $ + * $Revision: 1.45.18.1 $ * - * last change: $Author: vg $ $Date: 2006/03/31 12:15:47 $ + * last change: $Author: fs $ $Date: 2006/05/18 09:18:00 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -603,10 +603,10 @@ Buttons = WB_OK; Message [ en-US ] = "This table name is not valid in the current database."; }; -String STR_ERR_DUPL_TABLENAME +String STR_SUGGEST_APPEND_TABLE_DATA { - Text [ de ] = "Der Tabellenname \'$name$\' existiert bereits.\nSie können einen neuen Namen angeben\noder die Daten an die existierende Tabelle anhängen." ; - Text [ en-US ] = "The table name \'$name$\' already exists.\nYou may enter a new name\nor append the data to the existing table." ; + Text [ de ] = "Wählen Sie die Option 'Daten anhängen' auf der ersten Seite, um Daten an eine existierende Tabellen anzuhängen."; + Text [ en-US ] = "Choose the option 'Append data' on the first page to append data to an existing table."; }; ErrorBox ERROR_INVALID_TABLE_NAME_LENGTH File [changed]: dbumiscres.src Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/dbumiscres.src?r1=1.71.42.3&r2=1.71.42.4 Delta lines: +14 -2 -------------------- --- dbumiscres.src 17 May 2006 11:48:04 -0000 1.71.42.3 +++ dbumiscres.src 18 May 2006 09:18:00 -0000 1.71.42.4 @@ -4,9 +4,9 @@ * * $RCSfile: dbumiscres.src,v $ * - * $Revision: 1.71.42.3 $ + * $Revision: 1.71.42.4 $ * - * last change: $Author: fs $ $Date: 2006/05/17 11:48:04 $ + * last change: $Author: fs $ $Date: 2006/05/18 09:18:00 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -313,4 +313,16 @@ { Text [ de ] = "Der Name '$#$' existiert bereits.\nBitte geben Sie einen neuen Namen an." ; Text [ en-US ] = "The name '$#$' already exists.\nPlease enter another name." ; +}; + +String STR_NAME_ALREADY_USED_IN_DB +{ + Text [ de ] = "Der Name '$name$' wird bereits in der Datenbank benutzt."; + Text [ en-US ] = "The name '$name$' is already in use in the database."; +}; + +String STR_QUERY_AND_TABLE_DISTINCT_NAMES +{ + Text [ de ] = "Es ist nicht möglich, einer Tabelle und einer Abfrage den selben Namen zu geben. Bitte wählen Sie einen Namen, der noch nicht für eine Abfrage oder Tabelle benutzt wird."; + Text [ en-US ] = "You cannot give a table and a query the same name. Please use a name which is not yet used by a query or table."; }; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
