groundwork for 44684: adding a "GetAlignment" call to the editor so that ui can reflect alignment of selection

git-svn-id: svn://10.0.0.236/trunk@76274 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jfrancis%netscape.com
2000-08-14 12:07:10 +00:00
parent 3035e50272
commit 691e87aa2b
16 changed files with 163 additions and 50 deletions

View File

@@ -1233,6 +1233,34 @@ nsEditorShell::GetListItemState(PRBool *aMixed, PRUnichar **_retval)
return err;
}
NS_IMETHODIMP
nsEditorShell::GetAlignment(PRBool *aMixed, PRUnichar **_retval)
{
if (!aMixed || !_retval) return NS_ERROR_NULL_POINTER;
*_retval = nsnull;
*aMixed = PR_FALSE;
nsresult err = NS_NOINTERFACE;
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
if (htmlEditor)
{
nsIHTMLEditor::EAlignment firstAlign;
err = htmlEditor->GetAlignment(*aMixed, firstAlign);
if (NS_SUCCEEDED(err))
{
nsAutoString tagStr;
if (firstAlign == nsIHTMLEditor::eLeft)
tagStr.AssignWithConversion("left");
else if (firstAlign == nsIHTMLEditor::eCenter)
tagStr.AssignWithConversion("center");
else if (firstAlign == nsIHTMLEditor::eRight)
tagStr.AssignWithConversion("right");
*_retval = tagStr.ToNewUnicode();
}
}
return err;
}
NS_IMETHODIMP
nsEditorShell::ApplyStyleSheet(const PRUnichar *url)
{