mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Implemented new function to check if in Preformt text
This commit is contained in:
parent
39691ea998
commit
94d9781c29
@ -2435,21 +2435,23 @@ XP_Bool EDT_CanSetCharacterAttribute(MWContext * pMWContext)
|
||||
if( !pMWContext || pMWContext->waitingMode || EDT_IsBlocked(pMWContext) ){
|
||||
return FALSE;
|
||||
}
|
||||
GET_WRITABLE_EDIT_BUF_OR_RETURN(pMWContext, pEditBuffer) FALSE;
|
||||
|
||||
ED_ElementType type = EDT_GetCurrentElementType(pMWContext);
|
||||
if( (type == ED_ELEMENT_TEXT || type == ED_ELEMENT_SELECTION ||
|
||||
type >= ED_ELEMENT_TABLE) && !EDT_IsJavaScript(pMWContext) )
|
||||
return ( (type == ED_ELEMENT_TEXT || type == ED_ELEMENT_SELECTION ||
|
||||
type >= ED_ELEMENT_TABLE) && !EDT_IsJavaScript(pMWContext) );
|
||||
}
|
||||
|
||||
// TODO: Should probably go through all containers in a selection
|
||||
XP_Bool EDT_IsPreformat(MWContext *pMWContext)
|
||||
{
|
||||
GET_EDIT_BUF_OR_RETURN(pMWContext, pEditBuffer) FALSE;
|
||||
CEditInsertPoint ip;
|
||||
pEditBuffer->GetInsertPoint(ip);
|
||||
if( ip.m_pElement )
|
||||
{
|
||||
CEditContainerElement *pContainer;
|
||||
CEditInsertPoint ip;
|
||||
pEditBuffer->GetInsertPoint(ip);
|
||||
if( ip.m_pElement )
|
||||
{
|
||||
pContainer = ip.m_pElement->FindContainer();
|
||||
if( pContainer )
|
||||
return pContainer->GetType() != P_PREFORMAT;
|
||||
}
|
||||
CEditContainerElement *pContainer = ip.m_pElement->FindContainer();
|
||||
if( pContainer )
|
||||
return pContainer->GetType() == P_PREFORMAT;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user