diff options
author | Pallavi Jadhav <pallavi.jadhav@synerzip.com> | 2014-02-06 13:58:03 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-26 10:50:08 +0100 |
commit | a31fbb53dba76736b37213b98b64937f05929a67 (patch) | |
tree | 40c56bf856289c50415fa2c469946e5c72fef974 /sw/qa | |
parent | c4399bcd13cbe1cfa89c782e6667906c0b8bbb89 (diff) |
fdo#74566:DOCX: Preservation <w:br> tag for Break to Next Page
Issue :
'Break to Next Page' gets converted to 'Page Break Before'
in RT.
XML diffrenece :
- LO exports <w:br> as <w:pageBreakBefore /> in document.xml
- The page break is written into wrong paragraph.
Implementation :
1] Removed implementation to export <w:pageBreakBefore />.
2] Added a check to write <w:br> in correct paragraph.
3] Modified code to handle SectionBreak() even if Text node
has no string.
It is required when DOCX contains a PageBreak with footer.
4] Written Export Unit Test case.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/7891
Change-Id: I237b9c5fdd3083b441f6e81cd8442f458eccf1a0
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo74566.docx | bin | 0 -> 12675 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 20 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo74566.docx b/sw/qa/extras/ooxmlexport/data/fdo74566.docx Binary files differnew file mode 100644 index 000000000000..b197b946a4a8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo74566.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 194b7c6d582b..73d3393d8f2d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3641,6 +3641,26 @@ DECLARE_OOXMLEXPORT_TEST(testFooterContainHyperlink,"footer-contain-hyperlink.do // Check the value of Target which is http://www.google.com/. assertXPath(pXmlRels,"/rels:Relationships/rels:Relationship","Target","http://www.google.com/"); } + +DECLARE_OOXMLEXPORT_TEST(testPageBreak,"fdo74566.docx") +{ + /* Break to next page was written into wrong paragraph as <w:pageBreakBefore />. + * LO was not preserving Page Break as <w:br w:type="page" />. + * Now after fix , LO writes Page Break as the new paragraph and also + * preserves the xml tag <w:br>. + */ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + + uno::Reference<text::XTextRange> xParagraph2 = getParagraph(2); + uno::Reference<text::XTextRange> xParagraph4 = getParagraph(4); + + getRun(xParagraph2, 1, "First Page Second Line"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:br","type","page"); + getRun(xParagraph4, 1, "Second Page First line after Page Break"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); |