Ender reload and new toolbar code

This commit is contained in:
mjudge%netscape.com 1998-09-01 18:53:36 +00:00
parent 157a586f8c
commit 465c5b414a
3 changed files with 34 additions and 3 deletions

View File

@ -1809,6 +1809,21 @@ EDT_ClipboardResult EDT_SetDefaultText( MWContext *pContext, char *pText ) {
}
return EDT_COP_DOCUMENT_BUSY;
}
EDT_ClipboardResult EDT_SetDefaultHTML( MWContext *pContext, char *pHTML ) {
CEditBuffer* pEditBuffer = LO_GetEDBuffer( pContext );
if (pEditBuffer && pHTML)
{
if (!CEditBuffer::IsAlive(pEditBuffer) || !pEditBuffer->IsReady() || !pEditBuffer->IsWritable() )
{ //set up the default data for finishedload2
pEditBuffer->m_pImportedHTMLStream=XP_STRDUP(pHTML);
return EDT_COP_OK;
}
else
return EDT_PasteHTML(pContext,pHTML,ED_PASTE_NORMAL);
}
return EDT_COP_DOCUMENT_BUSY;
}
#endif //ENDER
EDT_ClipboardResult EDT_PasteQuoteBegin( MWContext *pContext, XP_Bool bHTML ) {

View File

@ -3059,6 +3059,7 @@ public:
char *m_pBodyExtra;
#ifdef ENDER
char *m_pImportedStream; //dont forget to XP_FREE this memory //ENDER
char *m_pImportedHTMLStream; //dont forget to XP_FREE this memory //ENDER
#endif //ENDER
CEditImageLoader *m_pLoadingImage;
CFileSaveObject *m_pSaveObject;

View File

@ -1526,6 +1526,7 @@ CEditBuffer::CEditBuffer(MWContext *pContext, XP_Bool bImportText):
m_pBodyExtra(0),
#ifdef ENDER
m_pImportedStream(0), //ENDER
m_pImportedHTMLStream(0), //ENDER
#endif //ENDER
m_pLoadingImage(0),
m_pSaveObject(0),
@ -10216,7 +10217,22 @@ void CEditBuffer::FinishedLoad2()
m_pCreationCursor = NULL;
// protect empty SOME empty lines! //i.e. list items with nothing in their containers
#ifdef ENDER
XP_Bool isEmbedded = FALSE;
if (m_pImportedHTMLStream && XP_STRLEN(m_pImportedHTMLStream))//ENDER
{
char *t_ptr=m_pImportedHTMLStream;
m_pImportedHTMLStream = NULL;
if (m_pImportedStream)
{
XP_FREE(m_pImportedStream);
m_pImportedStream=NULL;
}
ReadFromBuffer(t_ptr);
return;
}
#endif //ENDER
// protect empty SOME empty lines! //i.e. list items with nothing in their containers
Protect( m_pRoot );
// Get rid of empty items.
Reduce( m_pRoot );
@ -10276,8 +10292,7 @@ void CEditBuffer::FinishedLoad2()
&& !GetCommandLog()->InReload();
#if ENDER
XP_Bool isEmbedded = FALSE;
if (m_pImportedStream)//ENDER
if (m_pImportedStream && (!m_pImportedHTMLStream || !XP_STRLEN(m_pImportedHTMLStream)) )//ENDER
{
isEmbedded = TRUE;
PasteText( m_pImportedStream, FALSE, FALSE, TRUE ,TRUE);