зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1318857 - Unhide nsTSubstring_CharT::StripChars in nsTString_CharT. r=froydnj
MozReview-Commit-ID: CyQhH2y9lbm --HG-- extra : rebase_source : d733decec808e7a74deefe149672ec4bdbc7f3f1
This commit is contained in:
Родитель
a0026097f0
Коммит
9c32f727eb
|
@ -240,11 +240,10 @@ NS_IMETHODIMP nsTextToSubURI::UnEscapeURIForUI(const nsACString & aCharset,
|
|||
nsresult rv = mozilla::Preferences::GetString("network.IDN.blacklist_chars",
|
||||
&blacklist);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsAString& chars = blacklist;
|
||||
// we allow SPACE and IDEOGRAPHIC SPACE in this method
|
||||
chars.StripChars(u" \u3000");
|
||||
mUnsafeChars.AppendElements(static_cast<const char16_t*>(chars.Data()),
|
||||
chars.Length());
|
||||
blacklist.StripChars(u" \u3000");
|
||||
mUnsafeChars.AppendElements(static_cast<const char16_t*>(blacklist.Data()),
|
||||
blacklist.Length());
|
||||
} else {
|
||||
NS_WARNING("Failed to get the 'network.IDN.blacklist_chars' preference");
|
||||
}
|
||||
|
|
|
@ -368,6 +368,9 @@ public:
|
|||
*
|
||||
* @param aSet -- characters to be cut from this
|
||||
*/
|
||||
#ifdef CharT_is_PRUnichar
|
||||
using nsTSubstring_CharT::StripChars;
|
||||
#endif
|
||||
void StripChars(const char* aSet);
|
||||
|
||||
|
||||
|
|
|
@ -816,8 +816,7 @@ TEST(String, parse_string)
|
|||
|
||||
static void test_strip_chars_helper(const char16_t* str, const char16_t* strip, const nsAString& result, uint32_t offset=0)
|
||||
{
|
||||
nsAutoString tmp(str);
|
||||
nsAString& data = tmp;
|
||||
nsAutoString data(str);
|
||||
data.StripChars(strip, offset);
|
||||
EXPECT_TRUE(data.Equals(result));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче