X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=supported%2FBasicSupport_Deprecated.java;h=ad030c0ced64825def174a7bfed5d81b4f00c7d9;hp=bc3738a211bc22b92ac8811e85a549dd17777618;hb=75a6a3eadc87e42bb0c9808e359d23d03801a9a2;hpb=bff19b54d345ceb9e14aef616b53c013e93a0417 diff --git a/supported/BasicSupport_Deprecated.java b/supported/BasicSupport_Deprecated.java index bc3738a..ad030c0 100644 --- a/supported/BasicSupport_Deprecated.java +++ b/supported/BasicSupport_Deprecated.java @@ -332,8 +332,22 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { pg.setProgress(80); } - return story; + // Check for "no chapters" stories + if (story.getChapters().isEmpty() + && story.getMeta().getResume() != null + && !story.getMeta().getResume().getParagraphs().isEmpty()) { + Chapter resume = story.getMeta().getResume(); + resume.setName(""); + resume.setNumber(1); + story.getChapters().add(resume); + + String descChapterName = Instance.getInstance().getTrans() + .getString(StringId.DESCRIPTION); + resume = new Chapter(0, descChapterName); + story.getMeta().setResume(resume); + } + return story; } finally { close(); @@ -373,7 +387,7 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { * @param pg * the optional progress reporter * - * @return the {@link Chapter} + * @return the {@link Chapter}, never NULL * * @throws IOException * in case of I/O error @@ -429,7 +443,7 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { * @param pg * the optional progress reporter * - * @return the {@link Paragraph}s + * @return the {@link Paragraph}s (can be empty, but never NULL) * * @throws IOException * in case of I/O error @@ -447,7 +461,6 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { } List paras = new ArrayList(); - if (content != null && !content.trim().isEmpty()) { if (isHtml()) { String[] tab = content.split("(

|

|
|
)"); @@ -512,7 +525,7 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { * @param line * the textual content of the paragraph * - * @return the {@link Paragraph} + * @return the {@link Paragraph}, never NULL */ private Paragraph makeParagraph(URL source, String line) { Image image = null; @@ -862,7 +875,7 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { * @param line * the raw line * - * @return the processed {@link Paragraph} + * @return the processed {@link Paragraph}, never NULL */ protected Paragraph processPara(String line) { line = ifUnhtml(line).trim();