User: vg      
Date: 05/02/21 04:41:10

Modified:
 /dba/dbaccess/source/ui/dlg/
  ConnectionHelper.cxx

Log:
 INTEGRATION: CWS mozab05 (1.2.30); FILE MERGED
 2005/01/31 08:14:46 windly 1.2.30.3: RESYNC: (1.3-1.4); FILE MERGED
 2005/01/17 07:54:04 windly 1.2.30.2: RESYNC: (1.2-1.3); FILE MERGED
 2005/01/14 10:39:03 windly 1.2.30.1: #i20088# add browse support

File Changes:

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

File [changed]: ConnectionHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/ConnectionHelper.cxx?r1=1.4&r2=1.5
Delta lines:  +51 -1
--------------------
--- ConnectionHelper.cxx        21 Jan 2005 17:11:18 -0000      1.4
+++ ConnectionHelper.cxx        21 Feb 2005 12:41:07 -0000      1.5
@@ -193,6 +193,11 @@
 #endif
 #endif //_ADO_DATALINK_BROWSE_
 
+#ifndef _COM_SUN_STAR_MOZILLA_XMOZILLABOOTSTRAP_HPP_
+#include <com/sun/star/mozilla/XMozillaBootstrap.hpp>
+#endif
+#include <unotools/processfactory.hxx>
+
 
 
 //.........................................................................
@@ -206,6 +211,7 @@
        using namespace ::com::sun::star::beans;
        using namespace ::com::sun::star::lang;
        using namespace ::com::sun::star::container;
+       using namespace ::com::sun::star::mozilla;
        using namespace ::dbtools;
        using namespace ::svt;
 
@@ -430,8 +436,9 @@
                        case DST_ODBC:
                        {
                                // collect all ODBC data source names
+                ::rtl::OUString sCurrDatasource=getURLNoPrefix();
                                ::rtl::OUString sDataSource;
-                               if ( getSelectedDataSource(m_eType,sDataSource) 
&& sDataSource.getLength() )
+                               if ( 
getSelectedDataSource(m_eType,sDataSource,sCurrDatasource) && 
sDataSource.getLength() )
                                {
                                        setURLNoPrefix(sDataSource);
                     SetRoadmapStateValue(sal_True);
@@ -459,7 +466,50 @@
                        }
                        break;
 #endif
+            case DST_MOZILLA:
+            case DST_THUNDERBIRD:
+            {
+                               MozillaProductType profileType = 
MozillaProductType_Mozilla;
+                               if (m_eType == DST_THUNDERBIRD)
+                                       profileType = 
MozillaProductType_Thunderbird;
+
+                               Reference<XMultiServiceFactory> xFactory = 
::comphelper::getProcessServiceFactory();
+                               OSL_ENSURE( xFactory.is(), "can't get service 
factory" );
+ 
+                               Reference<XInterface> xInstance = 
xFactory->createInstance(::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")) );
+                               OSL_ENSURE( xInstance.is(), "failed to create 
instance" );
+                               Reference<XMozillaBootstrap> xMozillaBootstrap 
=  Reference<XMozillaBootstrap>(xInstance,UNO_QUERY);
+                               OSL_ENSURE( xMozillaBootstrap.is(), "failed to 
create instance" );
+                               
+                               if (xMozillaBootstrap.is())
+                               {
+                                       // collect all Mozilla Profiles
+                                       ::com::sun::star::uno::Sequence< 
::rtl::OUString > list;
+
+                                       sal_Int32 length = 
xMozillaBootstrap->getProfileList(profileType,list);
+                                       const ::rtl::OUString * pArray = 
list.getConstArray();
+ 
+                                       sal_Int32 count = list.getLength();
 
+                                       StringBag aProfiles;
+                                       for (sal_Int32 index=0; index < count; 
index++)
+                                               aProfiles.insert(pArray[index]);
+
+
+                                       // excute the select dialog
+                                       ODatasourceSelectDialog 
aSelector(GetParent(), aProfiles, m_eType);
+                       ::rtl::OUString sOldProfile=getURLNoPrefix();
+
+                                       if (sOldProfile.getLength())
+                                               aSelector.Select(sOldProfile);
+                                       else
+                                               
aSelector.Select(xMozillaBootstrap->getDefaultProfile(profileType));
+
+                                       if ( RET_OK == aSelector.Execute() )
+                                               
setURLNoPrefix(aSelector.GetSelected());
+                                       break;
+                               }
+                       }
                }
 
                checkTestConnection();




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

Reply via email to