diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-12-17 12:16:05 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-12-17 18:23:30 +0100 |
commit | 39108ddebe9abd229b9b215c7e78452687422b37 (patch) | |
tree | 80d29e0e53e1664ef95c29e93b9e4501f685481b /writerfilter | |
parent | 4d011333eb8fb1af7609a928212c8febcf50a4e3 (diff) |
tdf#112201 writerfilter: try to apply continuous section page style...
... on the last node of the previous section.
This works for this particular document, but it's quite dubious that it
will work in the general case; feel free to revert this if it causes
problems.
Change-Id: Ia03d41a1127df505c4e9da7131323b70d88a285f
Reviewed-on: https://gerrit.libreoffice.org/85294
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
(cherry picked from commit 3f680aef65a158cfbc98c8afd1c3628d7f4f7b83)
Reviewed-on: https://gerrit.libreoffice.org/85304
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index e60312d02bea..efe03cde337e 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1406,6 +1406,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) uno::UNO_QUERY_THROW); uno::Reference<container::XEnumeration> const xEnum( xCursor->createEnumeration()); + bool isFound = false; while (xEnum->hasMoreElements()) { uno::Reference<beans::XPropertySet> xElem; @@ -1419,10 +1420,24 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) // tdf#112201: do *not* use m_sFirstPageStyleName here! xElem->setPropertyValue(getPropertyName(PROP_PAGE_DESC_NAME), uno::makeAny(m_sFollowPageStyleName)); + isFound = true; break; } } } + if (!isFound) + { // HACK: try the last paragraph of the previous section + uno::Reference<text::XParagraphCursor> const xPCursor(xCursor, uno::UNO_QUERY_THROW); + xPCursor->gotoPreviousParagraph(false); + uno::Reference<beans::XPropertySet> const xPSCursor(xCursor, uno::UNO_QUERY_THROW); + style::BreakType bt; + if ((xPSCursor->getPropertyValue("BreakType") >>= bt) + && bt == style::BreakType_PAGE_BEFORE) + { + xPSCursor->setPropertyValue(getPropertyName(PROP_PAGE_DESC_NAME), + uno::makeAny(m_sFollowPageStyleName)); + } + } } } catch ( const uno::Exception& ) |