summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/PropertyMap.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-10-26 17:52:42 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-10-26 20:30:50 +0100
commit32c322e9d037b29ded2297b400a2c596c042f1fa (patch)
treed2550fd9eee6781bac5dc0550d5af33007bbd0ad /writerfilter/source/dmapper/PropertyMap.cxx
parent5711858e00f542f1770d7ff3c035e8a2fdb72266 (diff)
DOCX import, altChunk: fix missing page break
Somewhat similar to copy&paste, the altChunk mechanism drops styles from the inner document by default. A surprising consequence of that is sections in the inner document have the default page size. This leads to a page break when the content of the outer document ends and the content of the inner document starts. Fix the importer to support this: 1) Ignore the page size and number in DomainMapper::lcl_attribute(). 2) Pass the start of the current section to the sub-importer, so that it can insert the starting page break at the right place. Change-Id: Id3955f2b35a139692254c4ac1233e96eef2620e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104821 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'writerfilter/source/dmapper/PropertyMap.cxx')
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 5877e676917b..c4dadd35dc74 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1828,7 +1828,11 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
evenOddStyle->setPropertyValue( getPropertyName( PROP_PAGE_STYLE_LAYOUT ), uno::makeAny( style::PageStyleLayout_RIGHT ) );
}
- if ( xRangeProperties.is() && rDM_Impl.IsNewDoc() )
+ if (rDM_Impl.m_xAltChunkStartingRange.is())
+ {
+ xRangeProperties.set(rDM_Impl.m_xAltChunkStartingRange, uno::UNO_QUERY);
+ }
+ if (xRangeProperties.is() && (rDM_Impl.IsNewDoc() || rDM_Impl.IsAltChunk()))
{
// Avoid setting page style in case of autotext: so inserting the autotext at the
// end of the document does not introduce an unwanted page break.