fix gcc bustage (bug 324170). r=brettw.

This commit is contained in:
bryner%brianryner.com 2006-01-27 19:21:19 +00:00
Родитель 05b95bb3df
Коммит 7147b98495
2 изменённых файлов: 22 добавлений и 20 удалений

Просмотреть файл

@ -133,13 +133,7 @@ nsFormHistoryResult::RemoveValueAt(PRInt32 aRowIndex, PRBool aRemoveFromDB)
NS_INTERFACE_MAP_BEGIN(nsFormHistory) NS_INTERFACE_MAP_BEGIN(nsFormHistory)
NS_INTERFACE_MAP_ENTRY(nsIFormHistory) NS_INTERFACE_MAP_ENTRY(nsIFormHistory)
// Have to do this one by hand because it's an ambiguous conversion NS_INTERFACE_MAP_ENTRY(nsIFormHistoryPrivate)
// to nsISupports.
if (aIID.Equals(NS_GET_IID(nsFormHistory))) {
NS_ADDREF_THIS();
*aInstancePtr = this;
return NS_OK;
} else
NS_INTERFACE_MAP_ENTRY(nsIObserver) NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsIFormSubmitObserver) NS_INTERFACE_MAP_ENTRY(nsIFormSubmitObserver)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
@ -604,10 +598,10 @@ nsFormHistoryImporter::ImportFormHistory(nsIFile *aFile,
reader.EnumerateColumns(EnumerateColumnsCB, &data); reader.EnumerateColumns(EnumerateColumnsCB, &data);
// Add the rows to form history // Add the rows to form history
nsCOMPtr<nsFormHistory> formHistory = do_QueryInterface(aFormHistory); nsCOMPtr<nsIFormHistoryPrivate> fhPrivate = do_QueryInterface(aFormHistory);
NS_ENSURE_TRUE(formHistory, NS_ERROR_FAILURE); NS_ENSURE_TRUE(fhPrivate, NS_ERROR_FAILURE);
mozIStorageConnection *conn = formHistory->GetStorageConnection(); mozIStorageConnection *conn = fhPrivate->GetStorageConnection();
NS_ENSURE_TRUE(conn, NS_ERROR_NOT_INITIALIZED); NS_ENSURE_TRUE(conn, NS_ERROR_NOT_INITIALIZED);
mozStorageTransaction transaction(conn, PR_FALSE); mozStorageTransaction transaction(conn, PR_FALSE);

Просмотреть файл

@ -59,22 +59,33 @@
class nsIAutoCompleteSimpleResult; class nsIAutoCompleteSimpleResult;
class nsIAutoCompleteResult; class nsIAutoCompleteResult;
class nsFormHistory;
#define NS_FORMHISTORY_IID \ #define NS_IFORMHISTORYPRIVATE_IID \
{0xc4a47315, 0xaeb5, 0x4039, {0x9f, 0x34, 0x45, 0x11, 0xb3, 0xa7, 0x58, 0xdd}} {0xc4a47315, 0xaeb5, 0x4039, {0x9f, 0x34, 0x45, 0x11, 0xb3, 0xa7, 0x58, 0xdd}}
class nsIFormHistoryPrivate : public nsISupports
{
public:
#ifdef MOZILLA_1_8_BRANCH
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFORMHISTORYPRIVATE_IID)
#else
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFORMHISTORYPRIVATE_IID)
#endif
mozIStorageConnection* GetStorageConnection() { return mDBConn; }
protected:
nsCOMPtr<mozIStorageConnection> mDBConn;
};
class nsFormHistory : public nsIFormHistory, class nsFormHistory : public nsIFormHistory,
public nsIFormHistoryPrivate,
public nsIObserver, public nsIObserver,
public nsIFormSubmitObserver, public nsIFormSubmitObserver,
public nsSupportsWeakReference public nsSupportsWeakReference
{ {
public: public:
#ifdef MOZILLA_1_8_BRANCH
NS_DEFINE_STATIC_IID_ACCESSOR(NS_FORMHISTORY_IID)
#else
NS_DECLARE_STATIC_IID_ACCESSOR(NS_FORMHISTORY_IID)
#endif
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
NS_DECL_NSIFORMHISTORY NS_DECL_NSIFORMHISTORY
NS_DECL_NSIOBSERVER NS_DECL_NSIOBSERVER
@ -93,8 +104,6 @@ public:
return gFormHistory; return gFormHistory;
} }
mozIStorageConnection* GetStorageConnection() { return mDBConn; }
nsresult AutoCompleteSearch(const nsAString &aInputName, nsresult AutoCompleteSearch(const nsAString &aInputName,
const nsAString &aInputValue, const nsAString &aInputValue,
nsIAutoCompleteSimpleResult *aPrevResult, nsIAutoCompleteSimpleResult *aPrevResult,
@ -115,7 +124,6 @@ public:
nsCOMPtr<nsIPrefBranch> mPrefBranch; nsCOMPtr<nsIPrefBranch> mPrefBranch;
nsCOMPtr<mozIStorageService> mStorageService; nsCOMPtr<mozIStorageService> mStorageService;
nsCOMPtr<mozIStorageConnection> mDBConn;
nsCOMPtr<mozIStorageStatement> mDBGetMatchingField; nsCOMPtr<mozIStorageStatement> mDBGetMatchingField;
nsCOMPtr<mozIStorageStatement> mDBFindEntry; nsCOMPtr<mozIStorageStatement> mDBFindEntry;
nsCOMPtr<mozIStorageStatement> mDBFindEntryByName; nsCOMPtr<mozIStorageStatement> mDBFindEntryByName;