Tag: cws_src680_hsqlcsv
User: fs      
Date: 2006/12/17 23:50:40

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

Log:
 RESYNC: (1.35-1.39); FILE MERGED

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.32.10.4&r2=1.32.10.5
Delta lines:  +31 -8
--------------------
--- AppController.cxx   11 Oct 2006 08:50:19 -0000      1.32.10.4
+++ AppController.cxx   18 Dec 2006 07:50:37 -0000      1.32.10.5
@@ -107,6 +107,7 @@
 #ifndef _COM_SUN_STAR_UTIL_XFLUSHABLE_HPP_
 #include <com/sun/star/util/XFlushable.hpp>
 #endif
+#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
 /** === end UNO includes === **/
 
 #ifndef _TOOLS_DEBUG_HXX
@@ -748,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:
@@ -780,8 +789,8 @@
                                }
                                break;
                        case SID_DB_APP_DSCONNECTION_TYPE:
-                aReturn.bEnabled = !isDataSourceReadOnly();
-                               if ( aReturn.bEnabled && m_xDataSource.is() )
+                aReturn.bEnabled = !isDataSourceReadOnly() && 
m_xDataSource.is();
+                               if ( aReturn.bEnabled )
                                {
                                        DATASOURCE_TYPE eType = 
m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
                                        aReturn.bEnabled = DST_EMBEDDED != 
eType;
@@ -1055,7 +1064,7 @@
                                if ( !sUrl.getLength() )
                         sUrl = SvtPathOptions().GetWorkPath();
 
-                                       ::sfx2::FileDialogHelper aFileDlg( 
::sfx2::FILESAVE_AUTOEXTENSION,static_cast<sal_uInt32>(nBits) ,getView());
+                                       ::sfx2::FileDialogHelper aFileDlg( 
com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION,static_cast<sal_uInt32>(nBits)
 ,getView());
                                        aFileDlg.SetDisplayDirectory( sUrl );
 
                                        const SfxFilter* pFilter = 
getStandardDatabaseFilter();
@@ -1187,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:
@@ -1332,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 );
@@ -1611,23 +1622,30 @@
        return sal_True;
 }
 // 
-----------------------------------------------------------------------------
-void OApplicationController::onEntryDoubleClick(SvTreeListBox* _pTree)
+bool OApplicationController::onEntryDoubleClick(SvTreeListBox* _pTree)
 {
        OSL_ENSURE(_pTree != NULL,"Who called me without a svtreelsiboc! ->GPF 
");
        if ( getContainer() && getContainer()->isLeaf(_pTree->GetHdlEntry()) )
        {
                try
                {
-                       openElement( getContainer()->getQualifiedName( 
_pTree->GetHdlEntry() ), getContainer()->getElementType() );
+                       openElement(
+                getContainer()->getQualifiedName( _pTree->GetHdlEntry() ),
+                getContainer()->getElementType(),
+                OLinkedDocumentsAccess::OPEN_NORMAL
+            );
+            return true;    // handled
                }
                catch(const Exception&)
                {
                        OSL_ENSURE(0,"Could not open element!");
                }
        }
+    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;
@@ -1664,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;
                                        }
@@ -1892,6 +1914,7 @@
                                                
xRename.set(xContainer->getByName(*aList.begin()),UNO_QUERY);
                         sal_Int32 nCommandType = eType == E_QUERY ? 
CommandType::QUERY : CommandType::TABLE;
 
+                        ensureConnection();
                         pNameChecker.reset( new DynamicTableOrQueryNameCheck( 
getConnection(), nCommandType ) );
                                            aDialog.reset( new OSaveAsDlg(
                             getView(), nCommandType, getORB(), getConnection(),




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

Reply via email to