summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-12-14 12:20:49 +0300
committerJustin Luth <justin_luth@sil.org>2018-12-25 05:32:31 +0100
commitd351d6badc97a6f63366fabb6568459b2cdb3819 (patch)
treead351f187b3a0175a5f9a961dba0683f609f4b0d /writerfilter
parent1a4a314132acb2d2980d1bebd4238960b747c99e (diff)
sw ooxmlimport: landscape <-> portrait ? not a continuous section
If one section has a portrait page layout, and the next section has a landscape orientation, then LO cannot consider them to be continuous sections, but a page-break must occur. Change-Id: I4e2229f36919cce4f15ad727378c76480117d7c5 Reviewed-on: https://gerrit.libreoffice.org/65156 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 7c1c29b1ebd2..9d236a7ce5c1 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1304,6 +1304,26 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
// The default section type is nextPage.
if ( m_nBreakType == -1 )
m_nBreakType = NS_ooxml::LN_Value_ST_SectionMark_nextPage;
+ // if page orientation differs from previous section, it can't be treated as continuous
+ else if ( m_nBreakType == NS_ooxml::LN_Value_ST_SectionMark_continuous )
+ {
+ SectionPropertyMap* pLastContext = rDM_Impl.GetLastSectionContext();
+ if ( pLastContext )
+ {
+ bool bIsLandscape = false;
+ boost::optional< PropertyMap::Property > pProp = getProperty( PROP_IS_LANDSCAPE );
+ if ( pProp )
+ pProp->second >>= bIsLandscape;
+
+ bool bPrevIsLandscape = false;
+ pProp = pLastContext->getProperty( PROP_IS_LANDSCAPE );
+ if ( pProp )
+ pProp->second >>= bPrevIsLandscape;
+
+ if ( bIsLandscape != bPrevIsLandscape )
+ m_nBreakType = NS_ooxml::LN_Value_ST_SectionMark_nextPage;
+ }
+ }
// Text area width is known at the end of a section: decide if tables should be converted or not.
std::vector<FloatingTableInfo>& rPendingFloatingTables = rDM_Impl.m_aPendingFloatingTables;