fixing bugs with paste; making paste not inherit local inline stlyes

git-svn-id: svn://10.0.0.236/trunk@68414 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jfrancis%netscape.com
2000-05-05 20:42:36 +00:00
parent 0023f64678
commit ce54ba7bc9
8 changed files with 120 additions and 18 deletions

View File

@@ -397,6 +397,28 @@ nsHTMLEditRules::GetIndentState(PRBool &aCanIndent, PRBool &aCanOutdent)
* Protected rules methods
********************************************************/
nsresult
nsHTMLEditRules::WillInsert(nsIDOMSelection *aSelection, PRBool *aCancel)
{
nsresult res = nsTextEditRules::WillInsert(aSelection, aCancel);
if (NS_FAILED(res)) return res;
// we need to get the doc
nsCOMPtr<nsIDOMDocument>doc;
res = mEditor->GetDocument(getter_AddRefs(doc));
if (NS_FAILED(res)) return res;
if (!doc) return NS_ERROR_NULL_POINTER;
// for every property that is set, insert a new inline style node
res = CreateStyleForInsertText(aSelection, doc);
return res;
}
nsresult
nsHTMLEditRules::DidInsert(nsIDOMSelection *aSelection, nsresult aResult)
{
return nsTextEditRules::DidInsert(aSelection, aResult);
}
nsresult
nsHTMLEditRules::WillInsertText(PRInt32 aAction,
@@ -459,13 +481,6 @@ nsHTMLEditRules::WillInsertText(PRInt32 aAction,
if (NS_FAILED(res)) return res;
if (!doc) return NS_ERROR_NULL_POINTER;
// for every property that is set, insert a new inline style node
res = CreateStyleForInsertText(aSelection, doc);
if (NS_FAILED(res)) return res;
// refresh the (collapsed) selection location
res = mEditor->GetStartNodeAndOffset(aSelection, &selNode, &selOffset);
if (NS_FAILED(res)) return res;
if (aAction == kInsertTextIME)
{
res = mEditor->InsertTextImpl(*inString, &selNode, &selOffset, doc);