fix to #312039 - font toolbar update. Also implemented FE for Convert Text to Table and Convert Table to Text. reviewed by sarri.

This commit is contained in:
clu%netscape.com 1998-08-21 03:04:59 +00:00
Родитель 9fb842c9d6
Коммит 2657d220f0
1 изменённых файлов: 32 добавлений и 6 удалений

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

@ -1520,7 +1520,7 @@ void CEditView::FindCommandStatus( CommandT inCommand, Boolean& outEnabled,
{
outMark = 0;
better = EDT_GetCharacterData( *GetContext() );
if ( better && better->pFontFace
if ( better /*&& better->pFontFace*/
&& mFontToolbarPopup && mFontToolbarPopup->IsEnabled() )
{
outMark = checkMark;
@ -1541,7 +1541,10 @@ void CEditView::FindCommandStatus( CommandT inCommand, Boolean& outEnabled,
::GetMenuItemText ( menuh, menuItemNum, fontItemString );
p2cstr( fontItemString );
if ( XP_STRLEN((char *)fontItemString) > 0
&& XP_STRSTR( better->pFontFace, (char *)fontItemString ) != NULL )
&& ( XP_STRSTR( better->pFontFace, (char *)fontItemString ) != NULL // we found a matching font
|| ( ( better->values & TF_FIXED ) != 0 && XP_STRSTR( XP_GetString(XP_NSFONT_FIXED), (char *)fontItemString ) ) // or we want "Fixed Width"
|| ( ( !( better->values & TF_FIXED ) && !( better->values & TF_FONT_FACE ) )
&& XP_STRSTR( XP_GetString(XP_NSFONT_DEFAULT), (char*)fontItemString ) ) ) ) // or we want "Variable Width"
break;
}
@ -1748,6 +1751,20 @@ void CEditView::FindCommandStatus( CommandT inCommand, Boolean& outEnabled,
outEnabled = ( EDT_GetMergeTableCellsType (*GetContext() ) != ED_MERGE_NONE );
break;
case cmd_Convert_Table_To_Text:
if (!IsDoneLoading() )
return;
outEnabled = EDT_IsInsertPointInTableCell( *GetContext() );
break;
case cmd_Convert_Text_To_Table:
if (!IsDoneLoading() )
return;
outEnabled = EDT_CanConvertTextToTable( *GetContext() );
break;
#if 0
case cmd_DisplayTableBoundaries:
outEnabled = true;
@ -4880,6 +4897,15 @@ Boolean CEditView::ObeyCommand( CommandT inCommand, void *ioParam )
EDT_SplitTableCell( *GetContext() );
break;
case cmd_Convert_Table_To_Text:
FLUSH_JAPANESE_TEXT
EDT_ConvertTableToText( *GetContext() );
break;
case cmd_Convert_Text_To_Table:
FLUSH_JAPANESE_TEXT
EDT_ConvertTextToTable( *GetContext(), 1 /*passing in 1 for now, we haven't decided on how we want to do this*/ );
break;
#if 0
case cmd_DisplayTableBoundaries: