Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce deleteRow() method for TemplateProcessor #1017

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Introduce deleteRow() method for TemplateProcessor #1017

wants to merge 6 commits into from

Conversation

simivar
Copy link
Contributor

@simivar simivar commented Mar 9, 2017

Introduce deleteRow() method for TemplateProcessor method that works fine with cell's spanning multiple rows.

@simivar simivar changed the title Introduce deleteRow() method for TemplateProcessor Add PHPDoc to test method Mar 9, 2017
@simivar simivar changed the title Add PHPDoc to test method Introduce deleteRow() method for TemplateProcessor Mar 9, 2017
@FBnil
Copy link

FBnil commented Oct 18, 2017

Checked the code and it is superseeded by #1147
Which also contains deleteRow() and a test.

@simivar We are rivals in code! :)

Your test document does not contain a cell containing multiple rows (double as high as the previous one containing the <w:vMerge w:val="restart"/>).

+----------+----------+
| ${cell1} | ${cell2} |
+          +----------+
|          | ${cell3} |
+----------+----------+

where you select to delete ${cell1} and ${cell2} and ${cell3} should be gone too, but are not.
I suspect that the CloneRow() never worked as intended. I am fixing it in my branch.

@FBnil
Copy link

FBnil commented Oct 18, 2017

Ok, in LibreOffice (5.4.1 and 5.4.2)
The Rowspan is <w:vMerge w:val="continue"/>, and does not match cloneRow()'s ('#<w:vMerge w:val="continue" />#', $tmpXmlRow)
So the easy fix is adding a question for the space:
('#<w:vMerge w:val="continue" ?/>#', $tmpXmlRow) // <w:vMerge w:val="continue"/>

Microsoft has spaces:
<w:vMerge /> <w:vMerge w:val="restart" />

LibreOffice (docx) does not:
<w:vMerge/> <w:vMerge w:val="restart"/>

Sources:
http:https://officeopenxml.com/WPtableGrid.php
https://msdn.microsoft.com/en-us/library/office/ff951689(v=office.14).aspx

@FBnil
Copy link

FBnil commented Oct 19, 2017

I also found another thing that should be tested:

+---+---+---+
| A |   |   |
|   |   +---+
|   | B |   |
|   +---+---+
|   |   |   |
+---+---+---+

edit: this works as expected.

@simivar: Why not join me? I'm building a new type of TemplateProcessor that allows sub classes to do lots of neat stuff, like making a table the normal way with addTable()->addRow()->addCell() and inject that into the template with replaceTable() or appendRow().

@manukieli
Copy link

I the code working with the version 0.16.0
It's a very good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants