summaryrefslogtreecommitdiff
path: root/editors/openoffice.org-1.0/files/patch-connectivity::source::drivers::mozab::mozillasrc::MDatabaseMetaDataHelper.cxx
blob: 4b92670204e77407b06b0c0e96fbb9c97677c1b8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--- ../connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx.orig	Sat May 18 01:46:08 2002
+++ ../connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx	Sat May 18 01:56:23 2002
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: MDatabaseMetaDataHelper.cxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.6 $
  *
- *  last change: $Author: dkenny $ $Date: 2001/12/13 09:34:19 $
+ *  last change: $Author: fs $ $Date: 2002/05/17 12:08:41 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -213,11 +213,15 @@
 
 	retCode = dirFactoryService->GetDirFactory(aFactory.getStr(), getter_AddRefs(dirFactory)) ;
 	NS_ENSURE_SUCCESS (retCode, retCode) ;
-	OUString value = OStringToOUString(aFactory, RTL_TEXTENCODING_ASCII_US) ;
-	const PRUnichar *valueChars = value.getStr() ;
-	nsCOMPtr<nsISimpleEnumerator> subDirs ;
+	nsCOMPtr <nsIAbDirectoryProperties> properties;
+	properties = do_CreateInstance(NS_ABDIRECTORYPROPERTIES_CONTRACTID, &retCode);
+	NS_ENSURE_SUCCESS(retCode, retCode) ;
 
-	retCode = dirFactory->CreateDirectory(1, &kPropertyName, &valueChars, getter_AddRefs(subDirs)) ;
+	retCode = properties->SetURI(aFactory.getStr());
+	NS_ENSURE_SUCCESS(retCode,retCode);
+
+	nsCOMPtr<nsISimpleEnumerator> subDirs ;
+	retCode = dirFactory->CreateDirectory(properties, getter_AddRefs(subDirs));
 	NS_ENSURE_SUCCESS(retCode, retCode) ;
 	PRBool hasMore = PR_TRUE ;
 	nsCOMPtr<nsISupportsArray> array ;
@@ -635,12 +639,12 @@
     if ( NS_FAILED(rv) )
         return sal_False;
 
-    rv = url->SetSpec( sAbURI.getStr() );
+    rv = url->SetSpec( nsDependentCString(sAbURI.getStr()) );
     if ( NS_FAILED(rv) )
         return sal_False;
 
-    nsXPIDLCString host;
-    rv = url->GetHost(getter_Copies (host));
+    nsCAutoString host;
+    rv = url->GetAsciiHost(host);
     if ( NS_FAILED(rv) )
         return sal_False;
 
@@ -654,6 +658,11 @@
     if ( NS_FAILED(rv) )
         return sal_False;
 
+    PRUint32 options;
+    rv = url->GetOptions(&options);
+    if ( NS_FAILED(rv) )
+        return sal_False;
+
     // Get the ldap connection
     nsCOMPtr<nsILDAPConnection> ldapConnection;
     ldapConnection = do_CreateInstance(NS_LDAPCONNECTION_CONTRACTID, &rv);
@@ -671,7 +680,7 @@
 
     // Now lets initialize the LDAP connection properly. We'll kick
     // off the bind operation in the callback function, |OnLDAPInit()|.
-    rv = ldapConnection->Init(host, port, NS_ConvertASCIItoUCS2(dn).get(),
+    rv = ldapConnection->Init(host.get(), port, options, nsnull,
                               messageListener);
     if ( NS_FAILED(rv) )
         return sal_False;