From cc66aa555d68eb33dfceb052e5dc37284e5080bd Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 24 Feb 2016 21:11:14 +0000 Subject: Use raw Strings instead of Warnings --- src/main/java/org/zwobble/mammoth/internal/DocumentToHtml.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/main/java/org/zwobble/mammoth/internal/DocumentToHtml.java') diff --git a/src/main/java/org/zwobble/mammoth/internal/DocumentToHtml.java b/src/main/java/org/zwobble/mammoth/internal/DocumentToHtml.java index 6c4961a..45ff92e 100644 --- a/src/main/java/org/zwobble/mammoth/internal/DocumentToHtml.java +++ b/src/main/java/org/zwobble/mammoth/internal/DocumentToHtml.java @@ -8,7 +8,6 @@ import org.zwobble.mammoth.internal.documents.*; import org.zwobble.mammoth.internal.html.Html; import org.zwobble.mammoth.internal.html.HtmlNode; import org.zwobble.mammoth.internal.results.InternalResult; -import org.zwobble.mammoth.internal.results.Warning; import org.zwobble.mammoth.internal.styles.HtmlPath; import org.zwobble.mammoth.internal.styles.StyleMap; import org.zwobble.mammoth.internal.util.MammothLists; @@ -19,7 +18,6 @@ import java.util.Base64; import java.util.List; import java.util.Map; -import static org.zwobble.mammoth.internal.results.Warning.warning; import static org.zwobble.mammoth.internal.util.MammothLists.*; import static org.zwobble.mammoth.internal.util.MammothMaps.map; @@ -49,7 +47,7 @@ public class DocumentToHtml { private final boolean preserveEmptyParagraphs; private final StyleMap styleMap; private final List noteReferences = new ArrayList<>(); - private final ImmutableList.Builder warnings = ImmutableList.builder(); + private final ImmutableList.Builder warnings = ImmutableList.builder(); private DocumentToHtml(DocumentToHtmlOptions options) { this.idPrefix = options.idPrefix(); @@ -103,7 +101,7 @@ public class DocumentToHtml { HtmlPath mapping = styleMap.getParagraphHtmlPath(paragraph) .orElseGet(() -> { if (paragraph.getStyle().isPresent()) { - warnings.add(warning("Unrecognised paragraph style: " + paragraph.getStyle().get().describe())); + warnings.add("Unrecognised paragraph style: " + paragraph.getStyle().get().describe()); } return HtmlPath.element("p"); }); @@ -134,7 +132,7 @@ public class DocumentToHtml { HtmlPath mapping = styleMap.getRunHtmlPath(run) .orElseGet(() -> { if (run.getStyle().isPresent()) { - warnings.add(warning("Unrecognised run style: " + run.getStyle().get().describe())); + warnings.add("Unrecognised run style: " + run.getStyle().get().describe()); } return HtmlPath.EMPTY; }); @@ -224,7 +222,7 @@ public class DocumentToHtml { return list(Html.selfClosingElement("img", attributes.build())); } catch (IOException exception) { - warnings.add(warning(exception.getMessage())); + warnings.add(exception.getMessage()); return MammothLists.list(); } }) -- cgit v1.2.3