User: kz      
Date: 2006/12/13 08:46:21

Modified:
   dba/dbaccess/source/ui/app/AppController.cxx

Log:
 INTEGRATION: CWS dba22ui (1.34.12); FILE MERGED
 2006/12/13 13:46:02 fs 1.34.12.5: RESYNC: (1.37-1.38); FILE MERGED
 2006/12/03 20:49:53 fs 1.34.12.4: RESYNC: (1.35-1.37); FILE MERGED
 2006/10/11 19:51:12 fs 1.34.12.3: #i10000#
 2006/10/11 11:01:54 fs 1.34.12.2: RESYNC: (1.34-1.35); FILE MERGED
 2006/10/10 07:18:57 fs 1.34.12.1: #i64651# add 'Edit in SQL View' command

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.38&r2=1.39
Delta lines:  +23 -4
--------------------
--- AppController.cxx   1 Dec 2006 17:29:30 -0000       1.38
+++ AppController.cxx   13 Dec 2006 16:46:18 -0000      1.39
@@ -749,6 +749,14 @@
                                aReturn.bEnabled = !isDataSourceReadOnly() && 
getContainer()->getSelectionCount() > 0
                                                                        && 
getContainer()->isALeafSelected();
                                break;
+                       case SID_DB_APP_EDIT_SQL_VIEW:
+                               aReturn.bEnabled =
+                    (   ( !isDataSourceReadOnly() )
+                    &&  ( getContainer()->getElementType() == E_QUERY )
+                    &&  ( getContainer()->getSelectionCount() > 0 )
+                    &&  ( getContainer()->isALeafSelected() )
+                    );
+                break;
                        case SID_DB_APP_OPEN:
                        case SID_DB_APP_TABLE_OPEN:
                        case SID_DB_APP_QUERY_OPEN:
@@ -1188,6 +1196,7 @@
                                renameEntry();
                                break;
                        case SID_DB_APP_EDIT:
+                       case SID_DB_APP_EDIT_SQL_VIEW:
                        case SID_DB_APP_TABLE_EDIT:
                        case SID_DB_APP_QUERY_EDIT:
                        case SID_DB_APP_FORM_EDIT:
@@ -1333,6 +1342,7 @@
        implDescribeSupportedFeature( ".uno:Delete",                     
SID_DB_APP_DELETE,         CommandGroup::EDIT );
     implDescribeSupportedFeature( ".uno:DBRename",           
SID_DB_APP_RENAME,         CommandGroup::EDIT );
     implDescribeSupportedFeature( ".uno:DBEdit",             SID_DB_APP_EDIT,  
         CommandGroup::EDIT );
+    implDescribeSupportedFeature( ".uno:DBEditSqlView",      
SID_DB_APP_EDIT_SQL_VIEW,  CommandGroup::EDIT );
     implDescribeSupportedFeature( ".uno:DBOpen",             SID_DB_APP_OPEN,  
         CommandGroup::EDIT );
 
     implDescribeSupportedFeature( ".uno:DBTableDelete",      
SID_DB_APP_TABLE_DELETE,   CommandGroup::EDIT );
@@ -1619,7 +1629,11 @@
        {
                try
                {
-                       openElement( getContainer()->getQualifiedName( 
_pTree->GetHdlEntry() ), getContainer()->getElementType() );
+                       openElement(
+                getContainer()->getQualifiedName( _pTree->GetHdlEntry() ),
+                getContainer()->getElementType(),
+                OLinkedDocumentsAccess::OPEN_NORMAL
+            );
             return true;    // handled
                }
                catch(const Exception&)
@@ -1630,7 +1644,8 @@
     return false;   // not handled
 }
 // 
-----------------------------------------------------------------------------
-Reference< XComponent > OApplicationController::openElement(const 
::rtl::OUString& _sName,ElementType _eType,OLinkedDocumentsAccess::EOpenMode 
_eOpenMode)
+Reference< XComponent > OApplicationController::openElement(const 
::rtl::OUString& _sName, ElementType _eType,
+    OLinkedDocumentsAccess::EOpenMode _eOpenMode, sal_uInt16 
_nInstigatorCommand )
 {
        OSL_ENSURE(getContainer(),"View is NULL! -> GPF");
        Reference< XComponent > xRet;
@@ -1667,7 +1682,11 @@
                                                }
                                                else
                                                {
-                                                       pDesigner.reset( new 
QueryDesigner( getORB(), this, sal_False, sal_False ) );
+                            sal_Bool bQuerySQLMode =
+                                (   ( _nInstigatorCommand == 
SID_DB_APP_EDIT_SQL_VIEW )
+                                &&  ( _eType == E_QUERY )
+                                );
+                            pDesigner.reset( new QueryDesigner( getORB(), 
this, sal_False, bQuerySQLMode ) );
                                                }
                                                aDataSource <<= m_xDataSource;
                                        }




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

Reply via email to