Fix nsDependentString users not to pass null buffers. b=104651 r=jag rs=scc

This commit is contained in:
dbaron%fas.harvard.edu 2001-11-07 05:11:46 +00:00
Родитель 9603a028fa
Коммит 9ab72b8bb6
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -1176,12 +1176,15 @@ nsEditorShell::SetTextProperty(const PRUnichar *prop, const PRUnichar *attr, con
nsCOMPtr<nsIAtom> styleAtom = getter_AddRefs(NS_NewAtom(prop)); /// XXX Hack alert! Look in nsIEditProperty.h for this
if (! styleAtom) return NS_ERROR_OUT_OF_MEMORY;
static const PRUnichar sEmptyStr = PRUnichar('\0');
switch (mEditorType)
{
case ePlainTextEditorType:
// should we allow this?
case eHTMLTextEditorType:
err = mEditor->SetInlineProperty(styleAtom, nsDependentString(attr), nsDependentString(value));
err = mEditor->SetInlineProperty(styleAtom,
nsDependentString(attr?attr:&sEmptyStr),
nsDependentString(value?value:&sEmptyStr));
break;
default:
err = NS_ERROR_NOT_IMPLEMENTED;