diff options
author | Justin Luth <justin_luth@sil.org> | 2017-03-09 18:13:50 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-17 10:48:01 +0200 |
commit | 1299dc274864038bd2961b685430e522456c0f1a (patch) | |
tree | 387bfde4b7b6a02399c72f2c49e93d7578001fdf /writerfilter | |
parent | a47b4e92e82b65a810e1ce92d6c3e47d2ec11c37 (diff) |
tdf#103931 writerfilter breaktype: same for implicit and explicit
MSWord normally does NOT specify "nextPage" for the sectionBreak,
since that is the default type. That is imported as BreakType == -1.
However, Writer ALWAYS exports the section type name, which of
course is imported explicitly.
**There is an import hack that treats the very first -1 section as
continuous IF there are columns**. Since Writer explicitly defines
the section type, these documents import differently.
When Writer round-trips these types of files, they get totally
messed up in Writer, although they look fine in Word. So, treat
both implicit and explicit nextPage identically for
bTreatAsContinuous during import.
Another unit test demonstrated that headers/footers are lost when
treating as continuous, so preventing that situation now also.
This fix allows several import-only unit tests to round-trip.
Reviewed-on: https://gerrit.libreoffice.org/35013
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 4605bd46984125a99b0e993b71efa6edb411699f)
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
Change-Id: I37fa861d82e8da564d28d8e9089fe0f2777650fb
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index ec79cb1ba653..9272079687c0 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1195,8 +1195,9 @@ 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 without new style info, then this should be // handled as a continuous section break. - const bool bTreatAsContinuous = m_nBreakType == -1 + const bool bTreatAsContinuous = (m_nBreakType == -1 || m_nBreakType == NS_ooxml::LN_Value_ST_SectionMark_nextPage) && m_nColumnCount > 0 + && !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) { |