Skip to content

Commit

Permalink
Fixed #514 HTML service when importing an image after a table the ima…
Browse files Browse the repository at this point in the history
…ge in not inserted.
  • Loading branch information
ylussaud committed Nov 24, 2023
1 parent 5ff45d5 commit 9384f8e
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1040,17 +1040,19 @@ private XWPFParagraph insertMPagination(XWPFParagraph paragraph, XWPFRun run, MP
final XWPFParagraph res;
switch (mPagination) {
case newColumn:
insertFieldRunReplacement(paragraph, run, "").addBreak(BreakType.COLUMN);
res = paragraph;
final XWPFRun newColumnRun = insertFieldRunReplacement(paragraph, run, "");
newColumnRun.addBreak(BreakType.COLUMN);
res = (XWPFParagraph) newColumnRun.getParent();
break;

case newParagraph:
res = createNewParagraph(generatedDocument, (XWPFParagraph) run.getParent());
break;

case newPage:
insertFieldRunReplacement(paragraph, run, "").addBreak(BreakType.PAGE);
res = paragraph;
final XWPFRun newPageRun = insertFieldRunReplacement(paragraph, run, "");
newPageRun.addBreak(BreakType.PAGE);
res = (XWPFParagraph) newPageRun.getParent();
break;

case newTableOfContent:
Expand All @@ -1064,13 +1066,15 @@ private XWPFParagraph insertMPagination(XWPFParagraph paragraph, XWPFRun run, MP
break;

case newTextWrapping:
insertFieldRunReplacement(paragraph, run, "").addBreak(BreakType.TEXT_WRAPPING);
res = paragraph;
final XWPFRun newTextWrappingRun = insertFieldRunReplacement(paragraph, run, "");
newTextWrappingRun.addBreak(BreakType.TEXT_WRAPPING);
res = (XWPFParagraph) newTextWrappingRun.getParent();
break;

case ligneBreak:
insertFieldRunReplacement(paragraph, run, "").addBreak();
res = paragraph;
final XWPFRun ligneBreakRun = insertFieldRunReplacement(paragraph, run, "");
ligneBreakRun.addBreak();
res = (XWPFParagraph) ligneBreakRun.getParent();
break;

default:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

=== HEADER ===

=== BODY ===

A simple demonstration of a query :
[query: .fromHTMLURI('doc.html')]
End of demonstration.
=== FOOTER ===

=== TEMPLATES ===
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<genconf:Generation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:genconf="http://www.obeonetwork.org/m2doc/genconf/1.0" name="a" templateFileName="a-template.docx" resultFileName="a-actual-generation.docx" validationFileName="a-actual-validation.docx"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<html>
<head>
</head>
<body>
<table>
<tr>
<td>Titre colonne 1</td>
<td>Titre colonne 2</td>
<td>Titre colonne 3</td>
<td>Titre colonne 4</td>
<td>Titre colonne 5</td>
</tr>
<tr>
<td>cell 1.1</td>
<td>cell 1.2</td>
<td>cell 1.3</td>
<td>cell 1.4</td>
<td>cell 1.5</td>
</tr>
<tr>
<td>cell 2.1</td>
<td>cell 2.2</td>
<td>cell 2.3</td>
<td>cell 2.4</td>
<td>cell 2.5</td>
</tr>
<tr>
<td>cell 3.1</td>
<td>cell 3.2</td>
<td>cell 3.3</td>
<td>cell 3.4</td>
<td>cell 3.5</td>
</tr>
<tr>
<td>cell 4.1</td>
<td>cell 4.2</td>
<td>cell 4.3</td>
<td>cell 4.4</td>
<td>cell 4.5</td>
</tr>
</table>
<br/><img src="Mona_Lisa.jpg"><br/><br/>
</body>
</html>


0 comments on commit 9384f8e

Please sign in to comment.