version 1.1272, 2007/06/08 09:53:28
|
version 1.1273, 2007/06/08 13:16:24
|
Line 3720 Document LoadDocument (Document doc, cha
|
Line 3720 Document LoadDocument (Document doc, cha
|
s = tempfile; |
s = tempfile; |
else |
else |
s = pathname; |
s = pathname; |
|
|
CheckDocHeader (s, &xmlDec, &withDoctype, &isXML, &useMath, &isknown, |
CheckDocHeader (s, &xmlDec, &withDoctype, &isXML, &useMath, &isknown, |
&docProfile, &charset, charsetname, &thotType); |
&docProfile, &charset, charsetname, &thotType); |
docType = thotType; |
docType = thotType; |
Line 4064 Document LoadDocument (Document doc, cha
|
Line 4063 Document LoadDocument (Document doc, cha
|
strcpy (SavingFile, tempfile); |
strcpy (SavingFile, tempfile); |
SavingDocument = 0; |
SavingDocument = 0; |
SavingObject = 0; |
SavingObject = 0; |
|
TtaFreeMemory (localdoc); |
|
// generate the saving path |
localdoc = (char *)TtaGetMemory (MAX_LENGTH); |
localdoc = (char *)TtaGetMemory (MAX_LENGTH); |
TtaExtractName (pathname, tempfile, localdoc); |
TtaExtractName (pathname, tempfile, localdoc); |
/* reinitialize directories and document lists */ |
/* reinitialize directories and document lists */ |
Line 4115 Document LoadDocument (Document doc, cha
|
Line 4116 Document LoadDocument (Document doc, cha
|
documentname, docType, 0, FALSE, |
documentname, docType, 0, FALSE, |
docProfile, method); |
docProfile, method); |
} |
} |
else if (method == CE_ABSOLUTE || method == CE_HELP || |
else if (method == CE_ABSOLUTE || method == CE_HELP || method == CE_INSTANCE || |
method == CE_FORM_POST || method == CE_FORM_GET) |
method == CE_FORM_POST || method == CE_FORM_GET) |
/* replace the current document by a new one */ |
/* replace the current document by a new one */ |
newdoc = InitDocAndView (doc, |
newdoc = InitDocAndView (doc, |
Line 4180 Document LoadDocument (Document doc, cha
|
Line 4181 Document LoadDocument (Document doc, cha
|
} |
} |
} |
} |
|
|
|
localdoc = GetLocalPath (newdoc, pathname); |
/* what we have to do if doc and targetDocument are different */ |
/* what we have to do if doc and targetDocument are different */ |
if (tempfile[0] != EOS) |
if (method == CE_INSTANCE) |
|
// only the temporary file exists |
|
CheckDocHeader (localdoc, &xmlDec, &withDoctype, &isXML, &useMath, &isknown, |
|
&docProfile, &charset, charsetname, &thotType); |
|
else if (tempfile[0] != EOS) |
{ |
{ |
/* It is a document loaded from the Web */ |
/* It is a document loaded from the Web */ |
if (!TtaFileExist (tempfile)) |
if (!TtaFileExist (tempfile)) |
{ |
{ |
/* Nothing is loaded */ |
/* Nothing is loaded */ |
ResetStop (doc); |
ResetStop (doc); |
|
TtaFreeMemory (localdoc); |
TtaFreeMemory (content_type); |
TtaFreeMemory (content_type); |
return (0); |
return (0); |
} |
} |
/* we have to rename the temporary file */ |
/* we have to rename the temporary file */ |
/* allocate and initialize a teporary document */ |
// the loaded file is different |
localdoc = GetLocalPath (newdoc, pathname); |
TtaFileUnlink (localdoc); |
if (strcmp (tempfile, localdoc)) |
if (doc != newdoc) |
{ |
{ |
// the loaded file is different |
|
TtaFileUnlink (localdoc); |
|
if (doc != newdoc) |
|
{ |
|
/* now we can rename the local name of a remote document */ |
|
TtaFileCopy (tempfile, localdoc); |
|
TtaFileUnlink (tempfile); |
|
/* if it's an IMAGEfile, we copy it too to the new directory */ |
|
if (DocumentTypes[newdoc] == docImage) |
|
MoveImageFile (doc, newdoc, documentname); |
|
} |
|
else if (DocumentTypes[newdoc] == docCSS) |
|
TtaFileCopy (tempfile, localdoc); |
|
/* now we can rename the local name of a remote document */ |
/* now we can rename the local name of a remote document */ |
else |
TtaFileCopy (tempfile, localdoc); |
/* now we can rename the local name of a remote document */ |
TtaFileUnlink (tempfile); |
TtaFileRename (tempfile, localdoc); |
/* if it's an IMAGEfile, we copy it too to the new directory */ |
} |
if (DocumentTypes[newdoc] == docImage) |
|
MoveImageFile (doc, newdoc, documentname); |
|
} |
|
else if (DocumentTypes[newdoc] == docCSS) |
|
TtaFileCopy (tempfile, localdoc); |
|
/* now we can rename the local name of a remote document */ |
|
else |
|
/* now we can rename the local name of a remote document */ |
|
TtaFileRename (tempfile, localdoc); |
} |
} |
else |
else |
{ |
{ |
/* store a copy of the local document */ |
/* store a copy of the local document */ |
/* allocate and initialize a teporary document */ |
/* allocate and initialize a teporary document */ |
localdoc = GetLocalPath (newdoc, pathname); |
if (method != CE_INSTANCE) |
|
TtaFileCopy (pathname, localdoc); |
TtaFileCopy (pathname, localdoc); |
|
} |
} |
|
|
#ifdef BOOKMARKS |
#ifdef BOOKMARKS |
Line 5381 void GetAmayaDoc_callback (int newdoc, i
|
Line 5382 void GetAmayaDoc_callback (int newdoc, i
|
s = ""; |
s = ""; |
sprintf (tempdocument, TtaGetMessage (AMAYA, AM_CANNOT_LOAD), pathname); |
sprintf (tempdocument, TtaGetMessage (AMAYA, AM_CANNOT_LOAD), pathname); |
if (proxyName != NULL) |
if (proxyName != NULL) |
{ |
{ |
strcpy (proxymsg, "Used proxy: "); |
strcpy (proxymsg, "Used proxy: "); |
strcat (proxymsg, proxyName); |
strcat (proxymsg, proxyName); |
InitConfirm3L (newdoc, 1, tempdocument, s, proxymsg, FALSE); |
InitConfirm3L (newdoc, 1, tempdocument, s, proxymsg, FALSE); |
} |
} |
else |
else |
InitConfirm3L (newdoc, 1, tempdocument, s, NULL, FALSE); |
InitConfirm3L (newdoc, 1, tempdocument, s, NULL, FALSE); |
} |
} |
} |
} |
|
|
Line 5742 Document GetAmayaDoc (char *urlname, cha
|
Line 5743 Document GetAmayaDoc (char *urlname, cha
|
else if (method == CE_MAKEBOOK || method == CE_TEMPLATE) |
else if (method == CE_MAKEBOOK || method == CE_TEMPLATE) |
mode = AMAYA_ASYNC; |
mode = AMAYA_ASYNC; |
|
|
if (IsW3Path (initial_url)) |
// for new created template instances, the temporary file is parsed |
|
if (method != CE_INSTANCE && IsW3Path (initial_url)) |
{ |
{ |
css = SearchCSS (0, initial_url, NULL, &pInfo); |
css = SearchCSS (0, initial_url, NULL, &pInfo); |
if (method == CE_MAKEBOOK || method == CE_RELATIVE || method == CE_TEMPLATE) |
if (method == CE_MAKEBOOK || method == CE_RELATIVE || method == CE_TEMPLATE) |
Line 6106 void CallbackDialogue (int ref, int type
|
Line 6108 void CallbackDialogue (int ref, int type
|
} |
} |
else |
else |
{ |
{ |
#ifdef IV |
|
if (IsMathMLName (tempfile)) |
|
NewDocType = docMath; |
|
else if (IsSVGName (tempfile)) |
|
NewDocType = docSVG; |
|
else if (IsCSSName (tempfile)) |
|
NewDocType = docCSS; |
|
#ifdef XML_GENERIC |
|
else if (IsXMLName (tempfile)) |
|
NewDocType = docXml; |
|
#endif /* XML_GENERIC */ |
|
#ifdef _SVG |
|
else if (IsLibraryName (tempfile)) |
|
NewDocType = docLibrary; |
|
#endif /* _SVG */ |
|
else |
|
NewDocType = docHTML; |
|
InitializeNewDoc (tempfile, NewDocType, CurrentDocument, |
|
NewDocProfile, NewXML); |
|
#endif /* IV */ |
|
NotFoundDoc (tempfile, CurrentDocument); |
NotFoundDoc (tempfile, CurrentDocument); |
} |
} |
} |
} |