version 1.21, 2008/03/12 14:18:42
|
version 1.22, 2008/03/13 09:13:20
|
Line 504 ThotBool SaveDocumentToNewDoc(Document d
|
Line 504 ThotBool SaveDocumentToNewDoc(Document d
|
ThotBool res = FALSE; |
ThotBool res = FALSE; |
|
|
localFile = GetLocalPath (newdoc, newpath); |
localFile = GetLocalPath (newdoc, newpath); |
if (!TtaHasUndoSequence (doc)) |
|
{ |
|
TtaOpenUndoSequence (doc, NULL, NULL, 0, 0); |
|
|
|
// update all links |
// update all links |
SetRelativeURLs (doc, newpath, "", FALSE, FALSE, FALSE); |
SetRelativeURLs (doc, newpath, "", FALSE, FALSE, FALSE); |
// prepare the new document view |
// prepare the new document view |
TtaExtractName (newpath, DirectoryName, DocumentName); |
TtaExtractName (newpath, DirectoryName, DocumentName); |
|
|
root = TtaGetRootElement(doc); |
root = TtaGetRootElement(doc); |
elType = TtaGetElementType (root); |
elType = TtaGetElementType (root); |
// get the target document type |
// get the target document type |
s = TtaGetSSchemaName (elType.ElSSchema); |
s = TtaGetSSchemaName (elType.ElSSchema); |
if (strcmp (s, "HTML") == 0) |
if (strcmp (s, "HTML") == 0) |
{ |
{ |
/* docType = docHTML; */ |
/* docType = docHTML; */ |
if (TtaGetDocumentProfile(doc) == L_Xhtml11 || |
if (TtaGetDocumentProfile(doc) == L_Xhtml11 || |
TtaGetDocumentProfile(doc) == L_Basic) |
TtaGetDocumentProfile(doc) == L_Basic) |
res = TtaExportDocumentWithNewLineNumbers (doc, localFile, "HTMLT11", FALSE); |
res = TtaExportDocumentWithNewLineNumbers (doc, localFile, "HTMLT11", FALSE); |
else |
|
res = TtaExportDocumentWithNewLineNumbers (doc, localFile, "HTMLTX", FALSE); |
|
} |
|
else if (strcmp (s, "SVG") == 0) |
|
/* docType = docSVG; */ |
|
res = TtaExportDocumentWithNewLineNumbers (doc, localFile, "SVGT", FALSE); |
|
else if (strcmp (s, "MathML") == 0) |
|
/* docType = docMath; */ |
|
res = TtaExportDocumentWithNewLineNumbers (doc, localFile, "MathMLT", FALSE); |
|
else |
else |
/* docType = docXml; */ |
res = TtaExportDocumentWithNewLineNumbers (doc, localFile, "HTMLTX", FALSE); |
res = TtaExportDocumentWithNewLineNumbers (doc, localFile, NULL, FALSE); |
|
|
|
TtaCloseUndoSequence (doc); |
|
TtaUndoNoRedo (doc); |
|
} |
} |
|
else if (strcmp (s, "SVG") == 0) |
|
/* docType = docSVG; */ |
|
res = TtaExportDocumentWithNewLineNumbers (doc, localFile, "SVGT", FALSE); |
|
else if (strcmp (s, "MathML") == 0) |
|
/* docType = docMath; */ |
|
res = TtaExportDocumentWithNewLineNumbers (doc, localFile, "MathMLT", FALSE); |
|
else |
|
/* docType = docXml; */ |
|
res = TtaExportDocumentWithNewLineNumbers (doc, localFile, NULL, FALSE); |
|
|
if(temppath) |
if(temppath) |
*temppath = localFile; |
*temppath = localFile; |
else |
else |