You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@corinthia.apache.org by pm...@apache.org on 2014/12/17 14:29:18 UTC
[68/92] [abbrv] incubator-corinthia git commit: Remove DFHTMLToWord
Remove DFHTMLToWord
This function was only used when in UX Write when the user selected the
option to convert a HTML file to .docx from within the file manager. Its
functionality is subsumed by DFCreateFile, which UX Write now uses
instead.
Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/3c0c430c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/3c0c430c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/3c0c430c
Branch: refs/heads/stable
Commit: 3c0c430caa84dab4b2620ede1a7a4f8bc7bfa0bb
Parents: 3dfc28d
Author: Peter Kelly <pe...@uxproductivity.com>
Authored: Sat Dec 6 14:28:28 2014 +0700
Committer: Peter Kelly <pe...@uxproductivity.com>
Committed: Sat Dec 6 14:28:28 2014 +0700
----------------------------------------------------------------------
DocFormats/filters/ooxml/src/word/Word.c | 55 ---------------------------
DocFormats/filters/ooxml/src/word/Word.h | 2 -
2 files changed, 57 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3c0c430c/DocFormats/filters/ooxml/src/word/Word.c
----------------------------------------------------------------------
diff --git a/DocFormats/filters/ooxml/src/word/Word.c b/DocFormats/filters/ooxml/src/word/Word.c
index 357b8d8..ea4315f 100644
--- a/DocFormats/filters/ooxml/src/word/Word.c
+++ b/DocFormats/filters/ooxml/src/word/Word.c
@@ -22,61 +22,6 @@
#include "DFZipFile.h"
#include <stdlib.h>
-int DFHTMLToWord(const char *sourcePath, const char *destPath, DFError **error)
-{
- int ok = 0;
- char *idPrefix = DFFormatString("bdt%u-",(unsigned int)rand());
- char *htmlPath = DFPathDirName(sourcePath);
- DFDocument *htmlDoc = NULL;
- DFBuffer *warnings = DFBufferNew();
- DFPackage *rawPackage = NULL;
- WordPackage *wordPackage = NULL;
- DFPackage *abstractPackage = NULL;
-
- htmlDoc = DFParseHTMLFile(sourcePath,0,error);
- if (htmlDoc == NULL) {
- char *sourceFilename = DFPathBaseName(sourcePath);
- DFErrorFormat(error,"%s: %s",sourceFilename,DFErrorMessage(error));
- free(sourceFilename);
- goto end;
- }
-
- if (DFFileExists(destPath) && !DFDeleteFile(destPath,error))
- goto end;
-
- rawPackage = DFPackageCreateZip(destPath,error);
- if (rawPackage == NULL)
- goto end;
-
- wordPackage = WordPackageOpenNew(rawPackage,error);
- if (wordPackage == NULL)
- goto end;
-
- abstractPackage = DFPackageNewFilesystem(htmlPath,DFFileFormatHTML);
- if (!WordPackageUpdateFromHTML(wordPackage,htmlDoc,abstractPackage,idPrefix,error,warnings))
- goto end;
-
- if (warnings->len > 0) {
- DFErrorFormat(error,"%s",warnings->data);
- goto end;
- }
-
- if (!WordPackageSave(wordPackage,error))
- goto end;
-
- ok = 1;
-
-end:
- free(idPrefix);
- free(htmlPath);
- DFDocumentRelease(htmlDoc);
- DFBufferRelease(warnings);
- DFPackageRelease(rawPackage);
- WordPackageRelease(wordPackage);
- DFPackageRelease(abstractPackage);
- return ok;
-}
-
DFDocument *WordGet(DFPackage *concretePackage, DFPackage *abstractPackage, DFError **error)
{
int ok = 0;
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3c0c430c/DocFormats/filters/ooxml/src/word/Word.h
----------------------------------------------------------------------
diff --git a/DocFormats/filters/ooxml/src/word/Word.h b/DocFormats/filters/ooxml/src/word/Word.h
index 2b8ac1b..43adb48 100644
--- a/DocFormats/filters/ooxml/src/word/Word.h
+++ b/DocFormats/filters/ooxml/src/word/Word.h
@@ -27,8 +27,6 @@
CSSStyle *WordSetupTableGridStyle(CSSSheet *styleSheet, int *changed);
-int DFHTMLToWord(const char *sourcePath, const char *destPath, DFError **error);
-
DFDocument *WordGet(DFPackage *concretePackage, DFPackage *abstractPackage, DFError **error);
int WordPut(DFPackage *concretePackage, DFPackage *abstractPackage, DFDocument *htmlDoc, DFError **error);
int WordCreate(DFPackage *concretePackage, DFPackage *abstractPackage, DFDocument *htmlDoc, DFError **error);