[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/qa sw/source
Justin Luth (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jan 16 14:55:56 UTC 2020
sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 1 +
sw/source/filter/ww8/docxattributeoutput.cxx | 2 +-
sw/source/filter/ww8/wrtw8nds.cxx | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
New commits:
commit dce673e12456d6c09c8ef9407e658ceca17a8787
Author: Justin Luth <justin_luth at sil.org>
AuthorDate: Fri Dec 14 11:28:45 2018 +0300
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Jan 16 15:55:23 2020 +0100
sw ooxmlexport: export non-continuous section breaks
I'm amazed at how poorly DOCX section breaks were exported. This
is really hard code to understand - jumping around all over, and
shared between totally different doc/rtf/docx implementations.
This change only affects docx, since .doc SectionBreaks is empty
and RTF does nothing in the case of .IsSectionNode().
I THINK that sectionbreaksandframes does this job for DOC
(which is empty for DOCX) and RTF does things very
differently, so no possibility to piggy-back on existing code.
In any case, after a section node, there was NOTHING that
looked at the first text node to see if there was a
RES_PAGEDESC or a RES_BREAK, so these page breaks
were being completely ignored. It took a few days to
figure out this very simple solution.
A followup commit will fix the import when the follow
page is a different orientation.
Change-Id: I774e3e64cac9e2d26fdbeb1484266ebb44fac114
Reviewed-on: https://gerrit.libreoffice.org/65155
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
(cherry picked from commit 4ce06f8d162a282025cefe14e5684f82e439e01c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86926
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index a90130c7118c..b6216a699d9f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -49,6 +49,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121374_sectionHF, "tdf121374_sectionHF.odt")
CPPUNIT_ASSERT_EQUAL( OUString("footer"), xFooterText->getString() );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Paragraphs", 6, getParagraphs() );
+ CPPUNIT_ASSERT_MESSAGE("Number of pages", getPages() > 2);
//CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 6, getPages() );
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 2b3096b68948..78854596ad1b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1005,7 +1005,7 @@ void DocxAttributeOutput::SectionBreaks(const SwNode& rNode)
// paragraph, and detect the section breaks there.
SwNodeIndex aNextIndex( rNode, 1 );
- if (rNode.IsTextNode())
+ if (rNode.IsTextNode() || rNode.IsSectionNode())
{
if (aNextIndex.GetNode().IsTextNode())
{
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 8dfbc01423a4..ad33fa4b1824 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3090,6 +3090,8 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode )
if ( pSet && NoPageBreakSection( pSet ) )
pSet = nullptr;
+ else
+ AttrOutput().SectionBreaks( rSectionNode );
if ( !pSet )
{
More information about the Libreoffice-commits
mailing list