Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
nsAutoSelectionReset Class Reference

#include <nsEditorUtils.h>

Collaboration diagram for nsAutoSelectionReset:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsAutoSelectionReset (nsISelection *aSel, nsEditor *aEd)
 constructor responsible for remembering all state needed to restore aSel
 ~nsAutoSelectionReset ()
 destructor restores mSel to its former state
void Abort ()
 Abort: cancel selection saver.

Private Attributes

nsCOMPtr< nsISelectionmSel
 ref-counted reference to the selection that we are supposed to restore
nsEditormEd

Detailed Description

Definition at line 85 of file nsEditorUtils.h.


Constructor & Destructor Documentation

constructor responsible for remembering all state needed to restore aSel

Definition at line 58 of file nsEditorUtils.cpp.

                                                                            : 
mSel(nsnull)
,mEd(nsnull)
{ 
  if (!aSel || !aEd) return;    // not much we can do, bail.
  if (aEd->ArePreservingSelection()) return;   // we already have initted mSavedSel, so this must be nested call.
  mSel = do_QueryInterface(aSel);
  mEd = aEd;
  if (mSel)
  {
    mEd->PreserveSelectionAcrossActions(mSel);
  }
}

Here is the call graph for this function:

destructor restores mSel to its former state

Definition at line 72 of file nsEditorUtils.cpp.

{
  if (mSel && mEd->ArePreservingSelection())   // mSel will be null if this was nested call
  {
    mEd->RestorePreservedSelection(mSel);
  }
}

Here is the call graph for this function:


Member Function Documentation

Abort: cancel selection saver.

Definition at line 81 of file nsEditorUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 90 of file nsEditorUtils.h.

ref-counted reference to the selection that we are supposed to restore

Definition at line 89 of file nsEditorUtils.h.


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