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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user