[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sw/qa writerfilter/source
Justin Luth
justin_luth at sil.org
Fri Nov 10 14:52:28 UTC 2017
sw/qa/extras/ooxmlexport/data/tdf112352_nextPageColumns.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 11 +++++++++++
writerfilter/source/dmapper/PropertyMap.cxx | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
New commits:
commit dab3722d7a09ad500f369146f132c38d464ab0dd
Author: Justin Luth <justin_luth at sil.org>
Date: Tue Nov 7 09:29:30 2017 +0300
tdf#112352 ooxmlimport: ALWAYS treat 1st nextpage w/cols as cont
fix 5.4 regression from 4605bd46984125a99b0e993b71efa6edb411699f.
When there are columns, if a nextpage section doesn't contain any
other "page style" details we treat it as a continuous break,
If we don't, the column info becomes part of the style itself,
and not just a section property.
However, the very first section is troublesome - by definition it DOES
contain page style details, and so if the document starts with columns,
the default style would gain the column attribute. Usually that
results in a mess, so lets make sure that we avoid that also in
the case where headers/footers are defined.
Change-Id: I7e08a9218e4304206579ed064bc92c9604d4470e
Reviewed-on: https://gerrit.libreoffice.org/44505
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Justin Luth <justin_luth at sil.org>
Tested-by: Justin Luth <justin_luth at sil.org>
Reviewed-on: https://gerrit.libreoffice.org/44520
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf112352_nextPageColumns.docx b/sw/qa/extras/ooxmlexport/data/tdf112352_nextPageColumns.docx
new file mode 100644
index 000000000000..f14681dd51c2
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf112352_nextPageColumns.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index c37439f9410d..b184c116232a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -323,6 +323,17 @@ DECLARE_OOXMLEXPORT_TEST(testRhbz988516, "rhbz988516.docx")
CPPUNIT_ASSERT_EQUAL( 2, getPages() );
}
+DECLARE_OOXMLEXPORT_TEST(testTdf112352_nextPageColumns, "tdf112352_nextPageColumns.docx")
+{
+ uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection");
+ uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns");
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount());
+
+ xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(3), "TextSection");
+ xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns");
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf103389, "tdf103389.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 26f481f2ad5b..41a023cffc45 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1172,7 +1172,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
// Continuous sections usually create only a section, and not a new page style
const bool bTreatAsContinuous = m_nBreakType == NS_ooxml::LN_Value_ST_SectionMark_nextPage
&& m_nColumnCount > 0
- && !HasHeader( m_bTitlePage ) && !HasFooter( m_bTitlePage )
+ && (m_bIsFirstSection || (!HasHeader( m_bTitlePage ) && !HasFooter( m_bTitlePage )) )
&& (m_bIsFirstSection || m_sFollowPageStyleName.isEmpty() || (m_sFirstPageStyleName.isEmpty() && m_bTitlePage));
if ( m_nBreakType == static_cast<sal_Int32>(NS_ooxml::LN_Value_ST_SectionMark_continuous) || bTreatAsContinuous )
{
More information about the Libreoffice-commits
mailing list