From 15e788662347f7b01ede57d9eb26a7c6ea19df7b Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Mon, 5 Apr 1999 08:06:54 +0000 Subject: [PATCH] API cleanup for nsString git-svn-id: svn://10.0.0.236/trunk@26288 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/base/src/nsFileSpec.cpp | 2 +- mozilla/base/src/nsProperties.cpp | 4 ++-- mozilla/xpcom/ds/nsProperties.cpp | 4 ++-- mozilla/xpcom/io/nsFileSpec.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mozilla/base/src/nsFileSpec.cpp b/mozilla/base/src/nsFileSpec.cpp index 78db36cb85c..f2708f172cc 100644 --- a/mozilla/base/src/nsFileSpec.cpp +++ b/mozilla/base/src/nsFileSpec.cpp @@ -466,7 +466,7 @@ nsFileURL::nsFileURL(const nsString& inString, PRBool inCreateDirs) { const nsAutoCString aString(inString); const char* aCString = (const char*) aString; - if (!inString) + if (!inString.Length()) return; NS_ASSERTION(strstr(aCString, kFileURLPrefix) == aCString, "Not a URL!"); // Make canonical and absolute. diff --git a/mozilla/base/src/nsProperties.cpp b/mozilla/base/src/nsProperties.cpp index 395d15cb878..3d08838d892 100644 --- a/mozilla/base/src/nsProperties.cpp +++ b/mozilla/base/src/nsProperties.cpp @@ -177,7 +177,7 @@ nsProperties::SetProperty(const nsString& aKey, nsString& aNewValue, PRUint32 hashValue = nsCRT::HashValue(key, &len); PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key); PLHashEntry *he = *hep; - if (he && aOldValue) { + if (he && aOldValue.Length()) { // XXX fix me } PL_HashTableRawAdd(mTable, hep, hashValue, aKey.ToNewUnicode(), @@ -205,7 +205,7 @@ nsProperties::Subclass(nsIProperties* aSubclass) NS_IMETHODIMP nsProperties::GetProperty(const nsString& aKey, nsString& aValue) { - const PRUnichar *key = aKey; + const PRUnichar *key = aKey.GetUnicode(); PRUint32 len; PRUint32 hashValue = nsCRT::HashValue(key, &len); PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key); diff --git a/mozilla/xpcom/ds/nsProperties.cpp b/mozilla/xpcom/ds/nsProperties.cpp index 395d15cb878..3d08838d892 100644 --- a/mozilla/xpcom/ds/nsProperties.cpp +++ b/mozilla/xpcom/ds/nsProperties.cpp @@ -177,7 +177,7 @@ nsProperties::SetProperty(const nsString& aKey, nsString& aNewValue, PRUint32 hashValue = nsCRT::HashValue(key, &len); PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key); PLHashEntry *he = *hep; - if (he && aOldValue) { + if (he && aOldValue.Length()) { // XXX fix me } PL_HashTableRawAdd(mTable, hep, hashValue, aKey.ToNewUnicode(), @@ -205,7 +205,7 @@ nsProperties::Subclass(nsIProperties* aSubclass) NS_IMETHODIMP nsProperties::GetProperty(const nsString& aKey, nsString& aValue) { - const PRUnichar *key = aKey; + const PRUnichar *key = aKey.GetUnicode(); PRUint32 len; PRUint32 hashValue = nsCRT::HashValue(key, &len); PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key); diff --git a/mozilla/xpcom/io/nsFileSpec.cpp b/mozilla/xpcom/io/nsFileSpec.cpp index 78db36cb85c..f2708f172cc 100644 --- a/mozilla/xpcom/io/nsFileSpec.cpp +++ b/mozilla/xpcom/io/nsFileSpec.cpp @@ -466,7 +466,7 @@ nsFileURL::nsFileURL(const nsString& inString, PRBool inCreateDirs) { const nsAutoCString aString(inString); const char* aCString = (const char*) aString; - if (!inString) + if (!inString.Length()) return; NS_ASSERTION(strstr(aCString, kFileURLPrefix) == aCString, "Not a URL!"); // Make canonical and absolute.