path: root/writerfilter/source/dmapper
diff options
authorJustin Luth <>2020-09-22 17:30:02 +0300
committerMiklos Vajna <>2020-11-04 08:16:39 +0100
commit0b8c7a94c6c4b1aa10c7ae0a614d0f1f6cba1002 (patch)
tree1ac1e1d47d215eaf3041d8092a5d99c1240002e5 /writerfilter/source/dmapper
parentfe531957e3dcd42927cf15ab31d04473433d81f9 (diff)
tdf#136952 writerfilter: PageBreakBefore - don't always overwrite
There can be a number of things that can set PROP_BREAK_TYPE, and thus an un-inheriting value of PageBreakBefore should not cancel a w:br for example. There are two ways to approach this. One would be to never overwrite, and that should be safe in practice, since I don't see anywhere else that would specify a NONE value. However, if PageBreakBefore is true, it ought to override a theoretical NONE, or potential COLUMN break I would assume, so in that case a "yes" page break should probably override, but a "no" page break should not. Basically, if anything specifically requests a page break, they should get it. (Actually, I'm not sure how, but column and textWrapping breaks seem not to be affected by this - which is good. Only the page break seemed to be lost when PageBreakBefore=false. I tested by changing the w:br type to column, textWrapping, and the invalid value of none.) NOTE: If there is both a w:br and a PageBreakBefore=true, then MSWord 2003 treats both as a valid page break, but neither Word 2010 nor 2016 add the empty page. See bug report for two proof unit tests. Change-Id: I279874c60cc4cc572e0d190dc2afad0ad3431c43 Reviewed-on: Tested-by: Jenkins Reviewed-by: Justin Luth <> Reviewed-by: Miklos Vajna <>
Diffstat (limited to 'writerfilter/source/dmapper')
1 files changed, 1 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index b489115d4980..cb46a925abab 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1296,7 +1296,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
rContext->Insert(PROP_PARA_KEEP_TOGETHER, uno::makeAny( nIntValue != 0 ) );
case NS_ooxml::LN_CT_PPrBase_pageBreakBefore:
- rContext->Insert(PROP_BREAK_TYPE, uno::makeAny(nIntValue ? style::BreakType_PAGE_BEFORE : style::BreakType_NONE));
+ rContext->Insert(PROP_BREAK_TYPE, uno::makeAny(nIntValue ? style::BreakType_PAGE_BEFORE : style::BreakType_NONE), /*bOverwrite=*/bool(nIntValue));
case NS_ooxml::LN_CT_NumPr_ilvl:
if (nIntValue < 0 || 10 <= nIntValue) // Writer can't do everything