зеркало из https://github.com/mozilla/pjs.git
Bug 157546 - "[CTL-Thai] IM: <delete> key should delete WHOLE Thai "display cell"" [p=thep@linux.thai.net (Theppitak Karoonboonyanan) r+sr=roc a1.9=beltzner]
This commit is contained in:
Родитель
c02d84268f
Коммит
02e9e7d405
|
@ -51,7 +51,7 @@ interface nsIDOMNode;
|
|||
interface nsISelection;
|
||||
interface nsISelectionDisplay;
|
||||
|
||||
[scriptable, uuid(39429306-4c81-4d8b-9421-eb7d9f43bfd0)]
|
||||
[scriptable, uuid(80d2e85a-4ad2-45be-88e7-8c1fe943ac4d)]
|
||||
interface nsISelectionController : nsISelectionDisplay
|
||||
{
|
||||
const short SELECTION_NONE=0;
|
||||
|
@ -154,6 +154,12 @@ interface nsISelectionController : nsISelectionDisplay
|
|||
*/
|
||||
void characterMove(in boolean forward, in boolean extend);
|
||||
|
||||
/** CharacterExtendForDelete will extend the selection one character cell
|
||||
* forward in the document.
|
||||
* this method is used internally for handling del key.
|
||||
*/
|
||||
[noscript] void characterExtendForDelete();
|
||||
|
||||
/** WordMove will move the selection one word forward/backward in the document.
|
||||
* this will also have the effect of collapsing the selection if the aExtend = PR_FALSE
|
||||
* the "point" of selection that is extended is considered the "focus" point.
|
||||
|
|
|
@ -662,6 +662,7 @@ NS_IMETHODIMP nsPlaintextEditor::DeleteSelection(nsIEditor::EDirection aAction)
|
|||
if (NS_FAILED(result)) return result;
|
||||
if (!bCollapsed &&
|
||||
(aAction == eNextWord || aAction == ePreviousWord ||
|
||||
aAction == eNext ||
|
||||
aAction == eToBeginningOfLine || aAction == eToEndOfLine))
|
||||
if (mCaretStyle == 1)
|
||||
{
|
||||
|
@ -678,6 +679,7 @@ NS_IMETHODIMP nsPlaintextEditor::DeleteSelection(nsIEditor::EDirection aAction)
|
|||
// This needs to happen inside selection batching,
|
||||
// otherwise the deleted text is autocopied to the clipboard.
|
||||
if (aAction == eNextWord || aAction == ePreviousWord
|
||||
|| aAction == eNext
|
||||
|| aAction == eToBeginningOfLine || aAction == eToEndOfLine)
|
||||
{
|
||||
nsCOMPtr<nsISelectionController> selCont (do_QueryReferent(mSelConWeak));
|
||||
|
@ -696,6 +698,10 @@ NS_IMETHODIMP nsPlaintextEditor::DeleteSelection(nsIEditor::EDirection aAction)
|
|||
result = selCont->WordExtendForDelete(PR_FALSE);
|
||||
aAction = eNone;
|
||||
break;
|
||||
case eNext:
|
||||
result = selCont->CharacterExtendForDelete();
|
||||
aAction = eNone;
|
||||
break;
|
||||
case eToBeginningOfLine:
|
||||
selCont->IntraLineMove(PR_TRUE, PR_FALSE); // try to move to end
|
||||
result = selCont->IntraLineMove(PR_FALSE, PR_TRUE); // select to beginning
|
||||
|
|
|
@ -927,6 +927,7 @@ public:
|
|||
// nsISelectionController
|
||||
|
||||
NS_IMETHOD CharacterMove(PRBool aForward, PRBool aExtend);
|
||||
NS_IMETHOD CharacterExtendForDelete();
|
||||
NS_IMETHOD WordMove(PRBool aForward, PRBool aExtend);
|
||||
NS_IMETHOD WordExtendForDelete(PRBool aForward);
|
||||
NS_IMETHOD LineMove(PRBool aForward, PRBool aExtend);
|
||||
|
@ -2716,6 +2717,12 @@ PresShell::CharacterMove(PRBool aForward, PRBool aExtend)
|
|||
return mSelection->CharacterMove(aForward, aExtend);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::CharacterExtendForDelete()
|
||||
{
|
||||
return mSelection->CharacterExtendForDelete();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::WordMove(PRBool aForward, PRBool aExtend)
|
||||
{
|
||||
|
|
|
@ -581,6 +581,7 @@ public:
|
|||
NS_IMETHOD GetCaretEnabled(PRBool *_retval);
|
||||
NS_IMETHOD SetCaretVisibilityDuringSelection(PRBool aVisibility);
|
||||
NS_IMETHOD CharacterMove(PRBool aForward, PRBool aExtend);
|
||||
NS_IMETHOD CharacterExtendForDelete();
|
||||
NS_IMETHOD WordMove(PRBool aForward, PRBool aExtend);
|
||||
NS_IMETHOD WordExtendForDelete(PRBool aForward);
|
||||
NS_IMETHOD LineMove(PRBool aForward, PRBool aExtend);
|
||||
|
@ -794,6 +795,13 @@ nsTextInputSelectionImpl::CharacterMove(PRBool aForward, PRBool aExtend)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTextInputSelectionImpl::CharacterExtendForDelete()
|
||||
{
|
||||
if (mFrameSelection)
|
||||
return mFrameSelection->CharacterExtendForDelete();
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTextInputSelectionImpl::WordMove(PRBool aForward, PRBool aExtend)
|
||||
|
|
|
@ -409,6 +409,12 @@ public:
|
|||
/*unsafe*/
|
||||
nsresult CharacterMove(PRBool aForward, PRBool aExtend);
|
||||
|
||||
/** CharacterExtendForDelete extends the selection forward (logically) to
|
||||
* the next character cell, so that the selected cell can be deleted.
|
||||
*/
|
||||
/*unsafe*/
|
||||
nsresult CharacterExtendForDelete();
|
||||
|
||||
/** WordMove will generally be called from the nsiselectioncontroller implementations.
|
||||
* the effect being the selection will move one word left or right.
|
||||
* @param aForward move forward in document.
|
||||
|
|
|
@ -2772,6 +2772,12 @@ nsFrameSelection::CharacterMove(PRBool aForward, PRBool aExtend)
|
|||
return MoveCaret(nsIDOMKeyEvent::DOM_VK_LEFT,aExtend,eSelectCharacter);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFrameSelection::CharacterExtendForDelete()
|
||||
{
|
||||
return MoveCaret(nsIDOMKeyEvent::DOM_VK_DELETE, PR_TRUE, eSelectCharacter);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFrameSelection::WordMove(PRBool aForward, PRBool aExtend)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче