Tag: cws_src680_dba24
User: oj      
Date: 05/03/08 02:18:12

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

Log:
 RESYNC: (1.4-1.5); FILE MERGED

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.4.4&r2=1.4.4.5
Delta lines:  +54 -4
--------------------
--- ConnectionHelper.cxx        7 Mar 2005 13:59:36 -0000       1.4.4.4
+++ ConnectionHelper.cxx        8 Mar 2005 10:18:09 -0000       1.4.4.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;
 
@@ -427,8 +433,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);
@@ -456,7 +463,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