Return-Path: X-Original-To: apmail-corinthia-commits-archive@minotaur.apache.org Delivered-To: apmail-corinthia-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 92099CD93 for ; Sun, 11 Jan 2015 06:15:13 +0000 (UTC) Received: (qmail 90440 invoked by uid 500); 11 Jan 2015 06:15:05 -0000 Delivered-To: apmail-corinthia-commits-archive@corinthia.apache.org Received: (qmail 90421 invoked by uid 500); 11 Jan 2015 06:15:05 -0000 Mailing-List: contact commits-help@corinthia.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@corinthia.incubator.apache.org Delivered-To: mailing list commits@corinthia.incubator.apache.org Received: (qmail 90412 invoked by uid 99); 11 Jan 2015 06:15:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Jan 2015 06:15:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 11 Jan 2015 06:14:42 +0000 Received: (qmail 90327 invoked by uid 99); 11 Jan 2015 06:14:40 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Jan 2015 06:14:40 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E0CB79A8E5D; Sun, 11 Jan 2015 06:14:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pmkelly@apache.org To: commits@corinthia.incubator.apache.org Date: Sun, 11 Jan 2015 06:14:39 -0000 Message-Id: <131d31ae152f4484ac08fcbf8e6e94bc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] incubator-corinthia git commit: Word: Remove warnings parameters for conversion X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-corinthia Updated Branches: refs/heads/master 5c9a2c08e -> 1706df12c Word: Remove warnings parameters for conversion We've always treated warnings as errors, so we might as well disperse with the idea of exposing a separate data structure to code that uses WordConverter to record these. The warnings buffer still exists for now; it's just internal to WordConverter. Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/bc6827f6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/bc6827f6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/bc6827f6 Branch: refs/heads/master Commit: bc6827f6130a8b04b3c97598c31d4cc7289a2ddb Parents: 5c9a2c0 Author: Peter Kelly Authored: Sun Jan 11 12:39:56 2015 +0700 Committer: Peter Kelly Committed: Sun Jan 11 12:39:56 2015 +0700 ---------------------------------------------------------------------- DocFormats/filters/ooxml/src/word/Word.c | 12 +++--------- DocFormats/filters/ooxml/src/word/WordConverter.c | 13 ++++++------- DocFormats/filters/ooxml/src/word/WordConverter.h | 4 ++-- 3 files changed, 11 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/bc6827f6/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 a94deaa..1e06448 100644 --- a/DocFormats/filters/ooxml/src/word/Word.c +++ b/DocFormats/filters/ooxml/src/word/Word.c @@ -27,7 +27,6 @@ DFDocument *WordGet(DFStorage *concreteStorage, DFStorage *abstractStorage, DFEr { int ok = 0; WordPackage *wordPackage = NULL; - DFBuffer *warnings = DFBufferNew(); DFDocument *htmlDoc = NULL; wordPackage = WordPackageOpenFrom(concreteStorage,error); @@ -35,13 +34,12 @@ DFDocument *WordGet(DFStorage *concreteStorage, DFStorage *abstractStorage, DFEr goto end; htmlDoc = DFDocumentNew(); - if (!WordConverterGet(htmlDoc,abstractStorage,"word",wordPackage,warnings,error)) + if (!WordConverterGet(htmlDoc,abstractStorage,"word",wordPackage,error)) goto end; ok = 1; end: - DFBufferRelease(warnings); WordPackageRelease(wordPackage); if (ok) { return htmlDoc; @@ -56,7 +54,6 @@ int WordPut(DFStorage *concreteStorage, DFStorage *abstractStorage, DFDocument * { int ok = 0; WordPackage *wordPackage = NULL; - DFBuffer *warnings = DFBufferNew(); const char *idPrefix = "word"; @@ -64,7 +61,7 @@ int WordPut(DFStorage *concreteStorage, DFStorage *abstractStorage, DFDocument * if (wordPackage == NULL) goto end; - if (!WordConverterPut(htmlDoc,abstractStorage,idPrefix,wordPackage,warnings,error)) + if (!WordConverterPut(htmlDoc,abstractStorage,idPrefix,wordPackage,error)) goto end; if (!WordPackageSave(wordPackage,error)) @@ -74,7 +71,6 @@ int WordPut(DFStorage *concreteStorage, DFStorage *abstractStorage, DFDocument * end: WordPackageRelease(wordPackage); - DFBufferRelease(warnings); return ok; } @@ -82,7 +78,6 @@ int WordCreate(DFStorage *concreteStorage, DFStorage *abstractStorage, DFDocumen { int ok = 0; WordPackage *wordPackage = NULL; - DFBuffer *warnings = DFBufferNew(); const char *idPrefix = "word"; @@ -96,7 +91,7 @@ int WordCreate(DFStorage *concreteStorage, DFStorage *abstractStorage, DFDocumen // a new word or odf file from it. HTMLBreakBDTRefs(htmlDoc->docNode,idPrefix); - if (!WordConverterPut(htmlDoc,abstractStorage,idPrefix,wordPackage,warnings,error)) + if (!WordConverterPut(htmlDoc,abstractStorage,idPrefix,wordPackage,error)) goto end; if (!WordPackageSave(wordPackage,error)) @@ -106,7 +101,6 @@ int WordCreate(DFStorage *concreteStorage, DFStorage *abstractStorage, DFDocumen end: WordPackageRelease(wordPackage); - DFBufferRelease(warnings); return ok; } http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/bc6827f6/DocFormats/filters/ooxml/src/word/WordConverter.c ---------------------------------------------------------------------- diff --git a/DocFormats/filters/ooxml/src/word/WordConverter.c b/DocFormats/filters/ooxml/src/word/WordConverter.c index ee00253..f649d26 100644 --- a/DocFormats/filters/ooxml/src/word/WordConverter.c +++ b/DocFormats/filters/ooxml/src/word/WordConverter.c @@ -558,8 +558,7 @@ static void Word_postProcessHTMLDoc(WordConverter *conv) //////////////////////////////////////////////////////////////////////////////////////////////////// static WordConverter *WordConverterNew(DFDocument *html, DFStorage *abstractStorage, - const char *idPrefix, WordPackage *package, - DFBuffer *warnings) + const char *idPrefix, WordPackage *package) { WordConverter *converter = (WordConverter *)calloc(1,sizeof(WordConverter)); converter->html = DFDocumentRetain(html); @@ -582,7 +581,7 @@ static WordConverter *WordConverterNew(DFDocument *html, DFStorage *abstractStor DFHashTableAdd(converter->supportedContentTypes,"gif","image/gif"); DFHashTableAdd(converter->supportedContentTypes,"bmp","image/bmp"); DFHashTableAdd(converter->supportedContentTypes,"png","image/png"); - converter->warnings = DFBufferRetain(warnings); + converter->warnings = DFBufferNew(); return converter; } @@ -722,9 +721,9 @@ static int WordConverterGet2(WordConverter *converter, DFError **error) int WordConverterGet(DFDocument *html, DFStorage *abstractStorage, const char *idPrefix, WordPackage *package, - DFBuffer *warnings, DFError **error) + DFError **error) { - WordConverter *converter = WordConverterNew(html,abstractStorage,idPrefix,package,warnings); + WordConverter *converter = WordConverterNew(html,abstractStorage,idPrefix,package); int ok = WordConverterGet2(converter,error); WordConverterFree(converter); return ok; @@ -917,9 +916,9 @@ static int WordConverterPut2(WordConverter *converter, DFError **error) int WordConverterPut(DFDocument *html, DFStorage *abstractStorage, const char *idPrefix, WordPackage *package, - DFBuffer *warnings, DFError **error) + DFError **error) { - WordConverter *converter = WordConverterNew(html,abstractStorage,idPrefix,package,warnings); + WordConverter *converter = WordConverterNew(html,abstractStorage,idPrefix,package); int ok = WordConverterPut2(converter,error); WordConverterFree(converter); return ok; http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/bc6827f6/DocFormats/filters/ooxml/src/word/WordConverter.h ---------------------------------------------------------------------- diff --git a/DocFormats/filters/ooxml/src/word/WordConverter.h b/DocFormats/filters/ooxml/src/word/WordConverter.h index eeed849..c0565f2 100644 --- a/DocFormats/filters/ooxml/src/word/WordConverter.h +++ b/DocFormats/filters/ooxml/src/word/WordConverter.h @@ -100,10 +100,10 @@ struct WordConverter { int WordConverterGet(DFDocument *html, DFStorage *abstractStorage, const char *idPrefix, WordPackage *package, - DFBuffer *warnings, DFError **error); + DFError **error); int WordConverterPut(DFDocument *html, DFStorage *abstractStorage, const char *idPrefix, WordPackage *package, - DFBuffer *warnings, DFError **error); + DFError **error); void WordConverterWarning(WordConverter *converter, const char *format, ...) ATTRIBUTE_FORMAT(printf,2,3); char *WordStyleIdForStyle(CSSStyle *style);