corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmke...@apache.org
Subject [58/92] [abbrv] incubator-corinthia git commit: dfutil: Remove -simplify command
Date Wed, 17 Dec 2014 13:29:08 GMT
dfutil: Remove -simplify command


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/f862f4d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/f862f4d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/f862f4d8

Branch: refs/heads/stable
Commit: f862f4d85e8354a7c47059233499273227968e19
Parents: ad3bfd8
Author: Peter Kelly <peter@uxproductivity.com>
Authored: Tue Dec 2 16:10:50 2014 +0700
Committer: Peter Kelly <peter@uxproductivity.com>
Committed: Tue Dec 2 16:10:56 2014 +0700

----------------------------------------------------------------------
 consumers/dfutil/src/Commands.c | 40 ------------------------------------
 consumers/dfutil/src/Commands.h |  1 -
 consumers/dfutil/src/main.c     |  3 ---
 3 files changed, 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/f862f4d8/consumers/dfutil/src/Commands.c
----------------------------------------------------------------------
diff --git a/consumers/dfutil/src/Commands.c b/consumers/dfutil/src/Commands.c
index 7c4d813..59ed80e 100644
--- a/consumers/dfutil/src/Commands.c
+++ b/consumers/dfutil/src/Commands.c
@@ -318,46 +318,6 @@ int parseHTMLFile(const char *filename, DFError **error)
     return 1;
 }
 
-int simplifyFields(const char *inFilename, const char *outFilename, DFError **error)
-{
-    char *outExtension = DFPathExtension(outFilename);
-    int isDocx = DFStringEqualsCI(outExtension,"docx");
-    free(outExtension);
-
-    if (!isDocx) {
-        DFErrorFormat(error,"%s: Simplify fields only applies to docx files",inFilename);
-        return 0;
-    }
-
-    DFPackage *rawPackage = DFPackageNewMemory();
-    if (!DFUnzip(inFilename,rawPackage,error)) {
-        DFErrorFormat(error,"%s: %s",inFilename,DFErrorMessage(error));
-        return 0;
-    }
-    WordPackage *wordPackage = WordPackageOpenFrom(rawPackage,error);
-    DFPackageRelease(rawPackage);
-    if (wordPackage == NULL) {
-        DFErrorFormat(error,"%s: %s",inFilename,DFErrorMessage(error));
-        return 0;
-    }
-
-    WordPackageSimplifyFields(wordPackage);
-
-    if (!WordPackageSave(wordPackage,error)) {
-        DFErrorFormat(error,"%s: %s",outFilename,DFErrorMessage(error));
-        WordPackageRelease(wordPackage);
-        return 0;
-    }
-    if (!DFZip(outFilename,rawPackage,error)) {
-        DFErrorFormat(error,"%s: %s",outFilename,DFErrorMessage(error));
-        WordPackageRelease(wordPackage);
-        return 0;
-    }
-
-    WordPackageRelease(wordPackage);
-    return 1;
-}
-
 static int textPackageListRecursive(const char *input, const char *filePath, DFError **error,
int indent)
 {
     TextPackage *package = TextPackageNewWithString(input,filePath,error);

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/f862f4d8/consumers/dfutil/src/Commands.h
----------------------------------------------------------------------
diff --git a/consumers/dfutil/src/Commands.h b/consumers/dfutil/src/Commands.h
index 5282cf2..88f75be 100644
--- a/consumers/dfutil/src/Commands.h
+++ b/consumers/dfutil/src/Commands.h
@@ -24,7 +24,6 @@ int normalizeFile(const char *filename, DFError **error);
 int convertFile(const char *inFilename, const char *outFilename, DFError **error);
 int testCSS(const char *filename, DFError **error);
 int parseHTMLFile(const char *filename, DFError **error);
-int simplifyFields(const char *inFilename, const char *outFilename, DFError **error);
 int textPackageList(const char *filename, DFError **error);
 int textPackageGet(const char *filename, const char *itemPath, DFError **error);
 int runTests(int argc, const char **argv, int diff, DFError **error);

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/f862f4d8/consumers/dfutil/src/main.c
----------------------------------------------------------------------
diff --git a/consumers/dfutil/src/main.c b/consumers/dfutil/src/main.c
index 8696820..18f1a74 100644
--- a/consumers/dfutil/src/main.c
+++ b/consumers/dfutil/src/main.c
@@ -50,9 +50,6 @@ static int runCommand(int argc, const char **argv, DFError **dferr)
     else if ((argc == 3) && !strcmp(argv[1],"-parsehtml")) {
         return parseHTMLFile(argv[2],dferr);
     }
-    else if ((argc == 4) && !strcmp(argv[1],"-simplify")) {
-        return simplifyFields(argv[2],argv[3],dferr);
-    }
     else if ((argc == 3) && !strcmp(argv[1],"-tplist")) {
         return textPackageList(argv[2],dferr);
     }


Mime
View raw message