Make the history entry to store UTF8 text. We will graduately change FE code also to deal with UTF8 in history database. We need this to make the RDF history access correctly handle Multilingual text

This commit is contained in:
ftang%netscape.com 1998-09-19 00:33:04 +00:00
Родитель 209615ff73
Коммит 6ac4d83b71
3 изменённых файлов: 25 добавлений и 6 удалений

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

@ -923,16 +923,29 @@ CEditSaveObject::~CEditSaveObject(){
// Note: hist_ent->title should always = m_pContext->title?
// Change "file:///Untitled" into URL
// Use the new address if old title == old address
if( 0 != XP_STRCMP(hist_ent->title, XP_GetString(XP_EDIT_NEW_DOC_NAME) ) &&
char* utf8_edit_new_doc_name = (char*)
INTL_ConvertLineWithoutAutoDetect(
INTL_CharSetNameToID(INTL_ResourceCharSet()),
CS_UTF8,
(unsigned char*) XP_GetString(XP_EDIT_NEW_DOC_NAME),
XP_STRLEN(XP_GetString(XP_EDIT_NEW_DOC_NAME))
);
if( 0 != XP_STRCMP(hist_ent->title, utf8_edit_new_doc_name ) &&
0 != XP_STRCMP(hist_ent->title, hist_ent->address) )
{
pTitle = XP_STRDUP(hist_ent->title);
// pTitle = XP_STRDUP(hist_ent->title);
pTitle = (char*)INTL_ConvertLineWithoutAutoDetect(
CS_UTF8,
m_pBuffer->GetRAMCharSetID(),
(unsigned char*) hist_ent->title,
XP_STRLEN(hist_ent->title)
);
} else {
pTitle = XP_STRDUP(pDestFileURL);
XP_FREE(hist_ent->title);
hist_ent->title = XP_STRDUP(pDestFileURL);
}
XP_FREEIF(utf8_edit_new_doc_name);
} else {
// Use the URL if no Document title
pTitle = XP_STRDUP(pDestFileURL);

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

@ -795,8 +795,14 @@ SHIST_SetTitleOfCurrentDoc( MWContext *context )
if( he )
{
StrAllocCopy( he->title, context->title );
/* StrAllocCopy( he->title, context->title ); */
/* Let's save the History as UTF8 */
he->title = (char*)INTL_ConvertLineWithoutAutoDetect(
INTL_DefaultWinCharSetID(context),
CS_UTF8,
(unsigned char*) context->title,
XP_STRLEN(context->title)
);
/*
* This is the place where we set the title for *global* history hash records
* In addition to not making grid cells normal history entries we've added two

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

@ -327,7 +327,7 @@ doc_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
/* XXX BUGBUG Need a story for some of these for a layer's document */
case DOC_TITLE:
he = SHIST_GetCurrent(&context->hist);
str = lm_LocalEncodingToStr(context, he ? he->title : "");
str = lm_EncodingToStr(context->mocha_context, CS_UTF8, he ? he->title : "");
LO_UnlockLayout();
break;