diff options
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.hxx | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 3ff8519ce029..df6317baa4e0 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2455,9 +2455,17 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); if(pSectionContext) { - // Ignore continous section break at the end of the document + // Ignore continous section break at the end of the document, if the previous section had the same type as well // It makes the importer loose margin settings with no benefit - if (m_pImpl->GetParaSectpr() || nIntValue != 0) + SectionPropertyMap* pLastContext = m_pImpl->GetLastSectionContext(); + int nPrevBreakType = 0; + bool bHasPrevSection = false; + if (pLastContext) + { + bHasPrevSection = true; + nPrevBreakType = pLastContext->GetBreakType(); + } + if (m_pImpl->GetParaSectpr() || nIntValue != 0 || (bHasPrevSection && nPrevBreakType != nIntValue)) pSectionContext->SetBreakType( nIntValue ); } break; diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx index 824a1d08e534..77c6680ba156 100644 --- a/writerfilter/source/dmapper/PropertyMap.hxx +++ b/writerfilter/source/dmapper/PropertyMap.hxx @@ -245,6 +245,7 @@ public: void SetPageNoRestart( bool bSet ) { m_bPageNoRestart = bSet; } void SetPageNumber( sal_Int32 nSet ) { m_nPageNumber = nSet; } void SetBreakType( sal_Int32 nSet ) { m_nBreakType = nSet; } + sal_Int32 GetBreakType( ) { return m_nBreakType; } void SetPaperBin( sal_Int32 nSet ); void SetFirstPaperBin( sal_Int32 nSet ); |