Get rid of the redundant command state saving methods.

This commit is contained in:
sfraser%netscape.com 2000-05-05 23:18:15 +00:00
Родитель 58ed70653c
Коммит a8340dd50e
4 изменённых файлов: 2 добавлений и 64 удалений

Просмотреть файл

@ -376,30 +376,6 @@ nsInterfaceState::ForceUpdate(const PRUnichar *tagToUpdate)
return NS_OK;
}
NS_IMETHODIMP
nsInterfaceState::SetCommandStateData(const nsString& commandName, void* stateData)
{
nsStringKey commandKey(commandName);
mCommandStateTable.Put(&commandKey, stateData);
return NS_OK;
}
NS_IMETHODIMP
nsInterfaceState::GetCommandStateData(const nsString& commandName, void* *outStateData)
{
nsStringKey commandKey(commandName);
// sucks that we have to do two hash lookups
if (!mCommandStateTable.Exists(&commandKey))
return NS_ERROR_UNEXPECTED;
*outStateData = mCommandStateTable.Get(&commandKey);
return NS_OK;
}
PRBool
nsInterfaceState::SelectionIsCollapsed()
{

Просмотреть файл

@ -32,8 +32,6 @@
#include "nsITimer.h"
#include "nsITimerCallback.h"
#include "nsHashtable.h"
class nsIHTMLEditor;
class nsIDOMXULDocument;
@ -61,9 +59,6 @@ public:
// nsIDOMSelectionListener interface
NS_IMETHOD NotifySelectionChanged(nsIDOMDocument *aDoc, nsIDOMSelection *aSel, short aReason);
NS_IMETHOD SetCommandStateData(const nsString& commandName, void* stateData);
NS_IMETHOD GetCommandStateData(const nsString& commandName, void* *outStateData);
NS_DECL_NSIDOCUMENTSTATELISTENER
// nsITimerCallback interfaces
@ -133,8 +128,6 @@ protected:
PRPackedBool mUpdateItalics;
PRPackedBool mUpdateUnderline;
nsHashtable mCommandStateTable;
// current state
PRInt8 mBoldState;
PRInt8 mItalicState;

Просмотреть файл

@ -376,30 +376,6 @@ nsInterfaceState::ForceUpdate(const PRUnichar *tagToUpdate)
return NS_OK;
}
NS_IMETHODIMP
nsInterfaceState::SetCommandStateData(const nsString& commandName, void* stateData)
{
nsStringKey commandKey(commandName);
mCommandStateTable.Put(&commandKey, stateData);
return NS_OK;
}
NS_IMETHODIMP
nsInterfaceState::GetCommandStateData(const nsString& commandName, void* *outStateData)
{
nsStringKey commandKey(commandName);
// sucks that we have to do two hash lookups
if (!mCommandStateTable.Exists(&commandKey))
return NS_ERROR_UNEXPECTED;
*outStateData = mCommandStateTable.Get(&commandKey);
return NS_OK;
}
PRBool
nsInterfaceState::SelectionIsCollapsed()
{

Просмотреть файл

@ -32,8 +32,6 @@
#include "nsITimer.h"
#include "nsITimerCallback.h"
#include "nsHashtable.h"
class nsIHTMLEditor;
class nsIDOMXULDocument;
@ -61,9 +59,6 @@ public:
// nsIDOMSelectionListener interface
NS_IMETHOD NotifySelectionChanged(nsIDOMDocument *aDoc, nsIDOMSelection *aSel, short aReason);
NS_IMETHOD SetCommandStateData(const nsString& commandName, void* stateData);
NS_IMETHOD GetCommandStateData(const nsString& commandName, void* *outStateData);
NS_DECL_NSIDOCUMENTSTATELISTENER
// nsITimerCallback interfaces
@ -133,8 +128,6 @@ protected:
PRPackedBool mUpdateItalics;
PRPackedBool mUpdateUnderline;
nsHashtable mCommandStateTable;
// current state
PRInt8 mBoldState;
PRInt8 mItalicState;