Tag: cws_src680_qiq
User: fs      
Date: 06/05/18 02:16:14

Modified:
 /dba/dbaccess/source/ui/app/
  AppController.cxx, AppControllerDnD.cxx, AppControllerGen.cxx

Log:
 #i51143# when creating/pasting/saving a table/query, care for name collisions 
with both tables and queries (usign a DynamicTableOrQueryNameCheck), if the 
database supports queries in queries

File Changes:

Directory: /dba/dbaccess/source/ui/app/
=======================================

File [changed]: AppController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.29.12.1&r2=1.29.12.2
Delta lines:  +3 -3
-------------------
--- AppController.cxx   17 May 2006 11:43:31 -0000      1.29.12.1
+++ AppController.cxx   18 May 2006 09:16:11 -0000      1.29.12.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: AppController.cxx,v $
  *
- *  $Revision: 1.29.12.1 $
+ *  $Revision: 1.29.12.2 $
  *
- *  last change: $Author: fs $ $Date: 2006/05/17 11:43:31 $
+ *  last change: $Author: fs $ $Date: 2006/05/18 09:16:11 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1888,7 +1888,7 @@
                                                
xRename.set(xContainer->getByName(*aList.begin()),UNO_QUERY);
                         sal_Int32 nCommandType = eType == E_QUERY ? 
CommandType::QUERY : CommandType::TABLE;
 
-                        pNameChecker.reset( new PlainNameCheck( xContainer ) );
+                        pNameChecker.reset( new DynamicTableOrQueryNameCheck( 
getConnection(), nCommandType ) );
                                            aDialog.reset( new OSaveAsDlg(
                             getView(), nCommandType, getORB(), getConnection(),
                                 *aList.begin(), *pNameChecker, 
SAD_TITLE_RENAME ) );

File [changed]: AppControllerDnD.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerDnD.cxx?r1=1.14.76.5&r2=1.14.76.6
Delta lines:  +24 -24
---------------------
--- AppControllerDnD.cxx        17 May 2006 11:43:31 -0000      1.14.76.5
+++ AppControllerDnD.cxx        18 May 2006 09:16:11 -0000      1.14.76.6
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: AppControllerDnD.cxx,v $
  *
- *  $Revision: 1.14.76.5 $
+ *  $Revision: 1.14.76.6 $
  *
- *  last change: $Author: fs $ $Date: 2006/05/17 11:43:31 $
+ *  last change: $Author: fs $ $Date: 2006/05/18 09:16:11 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -111,6 +111,9 @@
 #ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
 #include <cppuhelper/typeprovider.hxx>
 #endif
+#ifndef _CPPUHELPER_EXC_HLP_HXX_
+#include <cppuhelper/exc_hlp.hxx>
+#endif
 #ifndef _DBHELPER_DBEXCEPTION_HXX_
 #include <connectivity/dbexception.hxx>
 #endif
@@ -399,15 +402,15 @@
                         aObsolete = aNextObsolete;
                     }
                                }
-                               catch(SQLException& e)
+                               catch(const SQLException&)
                                {
-                    showError( SQLExceptionInfo(e) );
+                    showError( SQLExceptionInfo( ::cppu::getCaughtException() 
) );
                                }
                                catch(WrappedTargetException& e)
                                {
                                        SQLException aSql;
-                                       if(e.TargetException >>= aSql)
-                                               showError( SQLExceptionInfo( 
aSql ) );
+                                       if ( e.TargetException >>= aSql )
+                                               showError( SQLExceptionInfo( 
e.TargetException ) );
                                        else
                                                OSL_ENSURE( sal_False, 
"OApplicationController::deleteObjects: something strange happended!" );
                                }
@@ -639,9 +642,8 @@
     {
            xConnection = ensureConnection();
     }
-       catch(SQLContext& e) { showError(SQLExceptionInfo(e)); }
-       catch(SQLWarning& e) { showError(SQLExceptionInfo(e)); }
-       catch(SQLException& e) { showError(SQLExceptionInfo(e)); }
+    catch(const SQLException&) { showError( SQLExceptionInfo( 
::cppu::getCaughtException() ) ); }
+
        OSL_ENSURE(xNameAccess.is(),"Data source doesn't return a name access 
-> GPF");
        return ::std::auto_ptr<OLinkedDocumentsAccess>(
         new OLinkedDocumentsAccess( getView(), getORB(), xNameAccess, 
xConnection, getDatabaseName() ) );
@@ -699,9 +701,9 @@
                // the owner ship goes to ODataClipboards
                return pData;
        }
-       catch(SQLException& e)
+    catch(const SQLException&)
        {
-               showError(SQLExceptionInfo(e));
+        showError( SQLExceptionInfo( ::cppu::getCaughtException() ) );
        }
        catch(Exception&)
        {
@@ -740,7 +742,7 @@
                                        bValidDescriptor = (0 != 
sCommand.getLength());
                                if (!bValidDescriptor)
                                {
-                                       
DBG_ERROR("OApplicationController::pasteQuery: invalid descriptor!");
+                                       
DBG_ERROR("OApplicationController::paste: invalid descriptor!");
                                        return sal_False;
                                }
 
@@ -800,7 +802,7 @@
 
                                        if (!bSuccess)
                                        {
-                                               
DBG_ERROR("OApplicationController::pasteQuery: could not extract the source 
query object!");
+                                               
DBG_ERROR("OApplicationController::paste: could not extract the source query 
object!");
                                                // TODO: maybe this is worth an 
error message to be displayed to the user ....
                                                return sal_False;
                                        }
@@ -811,17 +813,17 @@
                                Reference< XSingleServiceFactory > 
xQueryFactory(xDestQueries, UNO_QUERY);
                                if (!xQueryFactory.is())
                                {
-                                       
DBG_ERROR("OApplicationController::pasteQuery: invalid destination query 
container!");
+                                       
DBG_ERROR("OApplicationController::paste: invalid destination query 
container!");
                                        return sal_False;
                                }
 
                                // here we have everything needed to create a 
new query object ...
                                // ... ehm, except a new name
-                PlainNameCheck aNameChecker( xDestQueries.get() );
+                DynamicTableOrQueryNameCheck aNameChecker( getConnection(), 
CommandType::QUERY );
                                OSaveAsDlg aAskForName( getView(),
                                                                                
CommandType::QUERY,
                                         getORB(),
-                                                                               
NULL,
+                                                                               
getConnection(),
                                                                                
sTargetName,
                                         aNameChecker,
                                                                                
SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS);
@@ -833,7 +835,7 @@
 
                                // create a new object
                                Reference< XPropertySet > 
xNewQuery(xQueryFactory->createInstance(), UNO_QUERY);
-                               DBG_ASSERT(xNewQuery.is(), 
"OApplicationController::pasteQuery: invalid object created by factory!");
+                               DBG_ASSERT(xNewQuery.is(), 
"OApplicationController::paste: invalid object created by factory!");
                                if (xNewQuery.is())
                                {
                                        // initialize
@@ -857,10 +859,8 @@
                        return 
insertHierachyElement(_eType,_sParentFolder,Reference<XNameAccess>(xContent,UNO_QUERY).is(),xContent,_bMove);
                }
        }
-       catch(SQLContext& e) { showError(SQLExceptionInfo(e)); }
-       catch(SQLWarning& e) { showError(SQLExceptionInfo(e)); }
-       catch(SQLException& e) { showError(SQLExceptionInfo(e)); }
-       catch(Exception& )
+    catch(const SQLException&) { showError( SQLExceptionInfo( 
::cppu::getCaughtException() ) ); }
+       catch(const Exception& )
        {
                DBG_ERROR("OApplicationController::paste: caught a strange 
exception!");
        }

File [changed]: AppControllerGen.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerGen.cxx?r1=1.17.24.2&r2=1.17.24.3
Delta lines:  +3 -3
-------------------
--- AppControllerGen.cxx        17 May 2006 11:43:31 -0000      1.17.24.2
+++ AppControllerGen.cxx        18 May 2006 09:16:12 -0000      1.17.24.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: AppControllerGen.cxx,v $
  *
- *  $Revision: 1.17.24.2 $
+ *  $Revision: 1.17.24.3 $
  *
- *  last change: $Author: fs $ $Date: 2006/05/17 11:43:31 $
+ *  last change: $Author: fs $ $Date: 2006/05/18 09:16:12 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -169,7 +169,7 @@
                aName = aName.GetToken(0,' ');
                String aDefaultName = 
::dbaui::createDefaultName(xMeta,xTables,aName);
 
-        PlainNameCheck aNameChecker( xTables.get() );
+        DynamicTableOrQueryNameCheck aNameChecker( xConnection, 
CommandType::TABLE );
                OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), 
xConnection, aDefaultName, aNameChecker );
                if ( aDlg.Execute() == RET_OK )
                {




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

Reply via email to