зеркало из https://github.com/mozilla/gecko-dev.git
Get rid of the redundant command state saving methods.
This commit is contained in:
Родитель
58ed70653c
Коммит
a8340dd50e
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче