summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/browser/dsbrowserDnD.cxx
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2002-07-11 05:53:41 +0000
committerOcke Janssen <oj@openoffice.org>2002-07-11 05:53:41 +0000
commit98a85621f4667fe5a063fd188c318d9746c73346 (patch)
tree877a16826e20b61652ec3c9dd2f56138301c88c4 /dbaccess/source/ui/browser/dsbrowserDnD.cxx
parent4b4c49079996ce7b2901e5398c17a6bcce47c45a (diff)
#95978# check if name for table is valid
Diffstat (limited to 'dbaccess/source/ui/browser/dsbrowserDnD.cxx')
-rw-r--r--dbaccess/source/ui/browser/dsbrowserDnD.cxx29
1 files changed, 26 insertions, 3 deletions
diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
index b1ab4157eded..4eb18f725644 100644
--- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx
+++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dsbrowserDnD.cxx,v $
*
- * $Revision: 1.51 $
+ * $Revision: 1.52 $
*
- * last change: $Author: oj $ $Date: 2002-07-09 12:46:11 $
+ * last change: $Author: oj $ $Date: 2002-07-11 06:53:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1173,7 +1173,27 @@ namespace dbaui
else
::dbaui::composeTableName(xMeta,xProp,sOldName,sal_False);
- if((etQuery == eType || (xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers())) ? sName != sNewName : !sNewName.equalsIgnoreAsciiCase(sName))
+ // check if the new name is allowed
+ if ( etQuery != eType && isSQL92CheckEnabled(xConnection) && xMeta.is() )
+ {
+ ::rtl::OUString sAlias = ::dbtools::convertName2SQLName(sNewName,xMeta->getExtraNameCharacters());
+ if ( (xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers())
+ ?
+ sAlias != sNewName
+ :
+ !sNewName.equalsIgnoreAsciiCase(sAlias))
+ {
+ String sError = ErrorBox(getView(), ModuleRes(ERROR_INVALID_TABLE_NAME)).GetMessText();
+ dbtools::throwGenericSQLException(sError, NULL);
+ }
+ }
+
+ if ( (etQuery == eType || (xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers()))
+ ?
+ sName != sNewName
+ :
+ !sNewName.equalsIgnoreAsciiCase(sName)
+ )
{
Reference<XRename> xRename(pData->xObject,UNO_QUERY);
OSL_ENSURE(xRename.is(),"No Xrename interface!");
@@ -1368,6 +1388,9 @@ namespace dbaui
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.51 2002/07/09 12:46:11 oj
+ * #99921# check if datasource allows to check names
+ *
* Revision 1.50 2002/07/08 09:47:23 oj
* #98087# check d&d entries
*