Logo Search packages:      
Sourcecode: xulrunner version File versions  Download package

nsTextFragment & nsTextFragment::operator= ( const nsTextFragment aOther  ) 

Change the contents of this fragment to be a copy of the the argument fragment.

Definition at line 124 of file nsTextFragment.cpp.

References m1b, m2b, mAllBits, and mState.

{
  ReleaseText();

  if (aOther.mState.mLength) {
    if (!aOther.mState.mInHeap) {
      m1b = aOther.m1b; // This will work even if aOther is using m2b
    }
    else {
      m2b = static_cast<PRUnichar*>
                       (nsMemory::Clone(aOther.m2b, aOther.mState.mLength *
                                    (aOther.mState.mIs2b ? sizeof(PRUnichar) : sizeof(char))));
    }

    if (m1b) {
      mAllBits = aOther.mAllBits;
    }
  }

  return *this;
}


Generated by  Doxygen 1.6.0   Back to index