ObeoNetwork / M2Doc

The M2Doc technology enables the generation of Office Open XML documents from models.
http://obeonetwork.github.io/M2Doc/
Eclipse Public License 2.0
38 stars 22 forks source link

Incorrect management of multi-level rowspan attribute #523

Closed MSaguer closed 1 week ago

MSaguer commented 3 months ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please have a look to the support pages of our website : http://m2doc.org/support/

Current behavior

During table generation, rowspan attribute is correctly managed when defined in first columns

<table>
    <tr>
      <th>Col1</th><th>Col2</th>
      <th>Col3</th><th>Col4</th>
    </tr>
    <tr>
      <td rowspan="3">1-3</td>
      <td rowspan="3">1-3</td>
      <td>1</td>
      <td>1</td>
    </tr>
    <tr>
      <td>2</td>
      <td>2</td>
    </tr>
    <tr>
      <td>3</td>
      <td>3</td>
    </tr>
</table>

Is correctly rendered by image in generated doc.

But for more complex rowspan use case, cells are not correctly merged anymore

<table>
    <tr>
      <th></th><th>Jeff</th>
      <th>Elon</th><th>Bill</th>
      <th>Warren</th>
    </tr>
    <tr>
      <td>1</td>
      <td rowspan="5">1-5</td>
      <td rowspan="3">1-3</td>
      <td>1</td>
      <td>1</td>
    </tr>
    <tr>
      <td>2</td>
      <td rowspan="3">2-4</td>
      <td>2</td>
    </tr>
    <tr>
      <td>3</td>
      <td rowspan="3">3-5</td>
    </tr>
    <tr>
      <td>4</td><td>4</td>
    </tr>
    <tr>
      <td>5</td><td>5</td><td>5</td>
    </tr>
</table>

is transformed into image

Expected behavior

In second test case, expected matrix should be image

Minimal reproduction of the problem with instructions

See current behaviour

What is the motivation / use case for changing the behavior?

Environment


M2Doc version:   3.3.2.202312041107
Eclipse version:  2023-09 (4.29.0)
Platform version:   Windows

Others:

MSaguer commented 3 months ago

Here is a simple eclipse project with input emf file based on reqif format: myDoc.zip

We can see the two generated arrays in template.generated.docx image

ylussaud commented 3 months ago

Thank you for your inputs. I'll try to fix this issue before the next release.

ylussaud commented 1 week ago

Note: there is a rendering issue in LibreOffice see this issue for more details.