summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-10-15 12:53:05 +0200
committerPetr Mladek <pmladek@suse.cz>2012-11-05 17:46:00 +0100
commitc58a547bce19ba432b0f5fbace6b936e5beafac5 (patch)
treee28d85165c295c61619600e286be9efbfaa321f3 /writerfilter/source/dmapper/DomainMapper.cxx
parent5e5008433ce59fb71fa80733c978472fb5342223 (diff)
fdo#52208 DOCX import: don't always ignore cont sect break at the doc end
Regression from commit 1fdd61db155cf63d5dd55cc2bfb45af33796e131, continuous section break does make sense at the end of the doc, if the previous type was a non-continuous. (cherry picked from commit abd4ffadf30e02284290ea35e8f45d9ffd8eb5ee) Change-Id: I6d82c67e068d8dc3ce1edb1a5fe6ad293afd805d Reviewed-on: https://gerrit.libreoffice.org/877 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx12
1 files changed, 10 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;