From f483fd582b5d5e628865d32342a297909ea0a958 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Wed, 7 Sep 2016 19:26:30 +0300 Subject: tdf#81345 docx import fix default page break regression "regression" from 4e653d15eff26aa5283d8ba20611893f4c573f57 If there are new style elements, then don't treat a default break in columns as a continuous break. This fixes both round-tripping, and initial import of columns and headers on this particular document. Since MS and LO treat sections so differently, it is a balancing act of what to change. Reviewed-on: https://gerrit.libreoffice.org/28728 Tested-by: Jenkins Reviewed-by: Justin Luth (cherry picked from commit 3870c0555aa461268a6d056543f4545d562769ce) Change-Id: I9c79bc1246108da6a5ebbf744acbcfcbb9d33d48 --- writerfilter/source/dmapper/PropertyMap.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index cc20bb45d713..180196e1a076 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1201,9 +1201,12 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) } // depending on the break type no page styles should be created - // If the section type is missing, but we have columns, then this should be + // If the section type is missing, but we have columns without new style info, then this should be // handled as a continuous section break. - if(m_nBreakType == static_cast(NS_ooxml::LN_Value_ST_SectionMark_continuous) || (m_nBreakType == -1 && m_nColumnCount > 0)) + const bool bTreatAsContinuous = m_nBreakType == -1 + && m_nColumnCount > 0 + && (m_bIsFirstSection || m_sFollowPageStyleName.isEmpty() || (m_sFirstPageStyleName.isEmpty() && m_bTitlePage)); + if(m_nBreakType == static_cast(NS_ooxml::LN_Value_ST_SectionMark_continuous) || bTreatAsContinuous) { //todo: insert a section or access the already inserted section uno::Reference< beans::XPropertySet > xSection = -- cgit v1.2.3