diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /dom/base/nsTextFragment.h | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/nsTextFragment.h')
-rw-r--r-- | dom/base/nsTextFragment.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/dom/base/nsTextFragment.h b/dom/base/nsTextFragment.h index 5330815683..91efa49254 100644 --- a/dom/base/nsTextFragment.h +++ b/dom/base/nsTextFragment.h @@ -113,8 +113,7 @@ class nsTextFragment final { } ReleaseText(); if (aForce2b && !aUpdateBidi) { - nsStringBuffer* buffer = nsStringBuffer::FromString(aString); - if (buffer) { + if (nsStringBuffer* buffer = aString.GetStringBuffer()) { NS_ADDREF(m2b = buffer); mState.mInHeap = true; mState.mIs2b = true; @@ -154,19 +153,13 @@ class nsTextFragment final { const mozilla::fallible_t& aFallible) const { if (mState.mIs2b) { if (aString.IsEmpty()) { - m2b->ToString(mState.mLength, aString); + aString.Assign(m2b, mState.mLength); return true; } - bool ok = aString.Append(Get2b(), mState.mLength, aFallible); - if (!ok) { - return false; - } - - return true; - } else { - return AppendASCIItoUTF16(Substring(m1b, mState.mLength), aString, - aFallible); + return aString.Append(Get2b(), mState.mLength, aFallible); } + return AppendASCIItoUTF16(Substring(m1b, mState.mLength), aString, + aFallible); } /** |