Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Member Functions
nsStyleContentData Struct Reference

#include <nsStyleStruct.h>

List of all members.

Public Member Functions

 nsStyleContentData ()
 ~nsStyleContentData ()
nsStyleContentDataoperator= (const nsStyleContentData &aOther)
PRBool operator== (const nsStyleContentData &aOther)
PRBool operator!= (const nsStyleContentData &aOther)

Public Attributes

nsStyleContentType mType
union nsStyleContentData.mContent mContent

Private Member Functions

 nsStyleContentData (const nsStyleContentData &)

Detailed Description

Definition at line 919 of file nsStyleStruct.h.


Constructor & Destructor Documentation

Definition at line 927 of file nsStyleStruct.h.

: mType(nsStyleContentType(0)) { mContent.mString = nsnull; }

Definition at line 1298 of file nsStyleStruct.cpp.

{
  if (mType == eStyleContentType_Image) {
    NS_IF_RELEASE(mContent.mImage);
  } else if (mType == eStyleContentType_Counter ||
             mType == eStyleContentType_Counters) {
    mContent.mCounters->Release();
  } else if (mContent.mString) {
    nsCRT::free(mContent.mString);
  }
}

Here is the caller graph for this function:


Member Function Documentation

PRBool nsStyleContentData::operator!= ( const nsStyleContentData aOther) [inline]

Definition at line 932 of file nsStyleStruct.h.

                                                      {
    return !(*this == aOther);
  }
nsStyleContentData & nsStyleContentData::operator= ( const nsStyleContentData aOther)

Definition at line 1310 of file nsStyleStruct.cpp.

{
  if (this == &aOther)
    return *this;
  this->~nsStyleContentData();
  mType = aOther.mType;
  if (mType == eStyleContentType_Image) {
    mContent.mImage = aOther.mContent.mImage;
    NS_IF_ADDREF(mContent.mImage);
  } else if (mType == eStyleContentType_Counter ||
             mType == eStyleContentType_Counters) {
    mContent.mCounters = aOther.mContent.mCounters;
    mContent.mCounters->AddRef();
  } else if (aOther.mContent.mString) {
    mContent.mString = nsCRT::strdup(aOther.mContent.mString);
  } else {
    mContent.mString = nsnull;
  }
  return *this;
}

Here is the call graph for this function:

PRBool nsStyleContentData::operator== ( const nsStyleContentData aOther)

Definition at line 1331 of file nsStyleStruct.cpp.

{
  if (mType != aOther.mType)
    return PR_FALSE;
  if (mType == eStyleContentType_Image) {
    if (!mContent.mImage || !aOther.mContent.mImage)
      return mContent.mImage == aOther.mContent.mImage;
    PRBool eq;
    nsCOMPtr<nsIURI> thisURI, otherURI;
    mContent.mImage->GetURI(getter_AddRefs(thisURI));
    aOther.mContent.mImage->GetURI(getter_AddRefs(otherURI));
    return thisURI == otherURI ||  // handles null==null
           (thisURI && otherURI &&
            NS_SUCCEEDED(thisURI->Equals(otherURI, &eq)) &&
            eq);
  }
  if (mType == eStyleContentType_Counter ||
      mType == eStyleContentType_Counters)
    return *mContent.mCounters == *aOther.mContent.mCounters;
  return nsCRT::strcmp(mContent.mString, aOther.mContent.mString) == 0;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 920 of file nsStyleStruct.h.


The documentation for this struct was generated from the following files: