From a8340dd50e96c45bf6d67f94fcdb229ed5dcee6c Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Fri, 5 May 2000 23:18:15 +0000 Subject: [PATCH] Get rid of the redundant command state saving methods. --- editor/base/nsInterfaceState.cpp | 24 ------------------------ editor/base/nsInterfaceState.h | 9 +-------- editor/composer/src/nsInterfaceState.cpp | 24 ------------------------ editor/composer/src/nsInterfaceState.h | 9 +-------- 4 files changed, 2 insertions(+), 64 deletions(-) diff --git a/editor/base/nsInterfaceState.cpp b/editor/base/nsInterfaceState.cpp index 7f57d6eb8dfe..8f125ed4e41f 100644 --- a/editor/base/nsInterfaceState.cpp +++ b/editor/base/nsInterfaceState.cpp @@ -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() { diff --git a/editor/base/nsInterfaceState.h b/editor/base/nsInterfaceState.h index 4e46146e3ff0..efc42688c3de 100644 --- a/editor/base/nsInterfaceState.h +++ b/editor/base/nsInterfaceState.h @@ -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 @@ -132,9 +127,7 @@ protected: PRPackedBool mUpdateBold; PRPackedBool mUpdateItalics; PRPackedBool mUpdateUnderline; - - nsHashtable mCommandStateTable; - + // current state PRInt8 mBoldState; PRInt8 mItalicState; diff --git a/editor/composer/src/nsInterfaceState.cpp b/editor/composer/src/nsInterfaceState.cpp index 7f57d6eb8dfe..8f125ed4e41f 100644 --- a/editor/composer/src/nsInterfaceState.cpp +++ b/editor/composer/src/nsInterfaceState.cpp @@ -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() { diff --git a/editor/composer/src/nsInterfaceState.h b/editor/composer/src/nsInterfaceState.h index 4e46146e3ff0..efc42688c3de 100644 --- a/editor/composer/src/nsInterfaceState.h +++ b/editor/composer/src/nsInterfaceState.h @@ -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 @@ -132,9 +127,7 @@ protected: PRPackedBool mUpdateBold; PRPackedBool mUpdateItalics; PRPackedBool mUpdateUnderline; - - nsHashtable mCommandStateTable; - + // current state PRInt8 mBoldState; PRInt8 mItalicState;