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

This commit is contained in:
bryner%brianryner.com 2006-01-27 19:21:19 +00:00
parent 05b95bb3df
commit 7147b98495
2 changed files with 22 additions and 20 deletions

View File

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

View File

@ -59,22 +59,33 @@
class nsIAutoCompleteSimpleResult;
class nsIAutoCompleteResult;
class nsFormHistory;
#define NS_FORMHISTORY_IID \
#define NS_IFORMHISTORYPRIVATE_IID \
{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,
public nsIFormHistoryPrivate,
public nsIObserver,
public nsIFormSubmitObserver,
public nsSupportsWeakReference
{
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_NSIFORMHISTORY
NS_DECL_NSIOBSERVER
@ -93,8 +104,6 @@ public:
return gFormHistory;
}
mozIStorageConnection* GetStorageConnection() { return mDBConn; }
nsresult AutoCompleteSearch(const nsAString &aInputName,
const nsAString &aInputValue,
nsIAutoCompleteSimpleResult *aPrevResult,
@ -115,7 +124,6 @@ public:
nsCOMPtr<nsIPrefBranch> mPrefBranch;
nsCOMPtr<mozIStorageService> mStorageService;
nsCOMPtr<mozIStorageConnection> mDBConn;
nsCOMPtr<mozIStorageStatement> mDBGetMatchingField;
nsCOMPtr<mozIStorageStatement> mDBFindEntry;
nsCOMPtr<mozIStorageStatement> mDBFindEntryByName;