diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/page-break-before.docx | bin | 0 -> 12943 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 5 |
3 files changed, 9 insertions, 5 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/page-break-before.docx b/sw/qa/extras/ooxmlexport/data/page-break-before.docx Binary files differnew file mode 100644 index 000000000000..99d8c3a5d4eb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/page-break-before.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index b35f97b4bc8a..3d7628720eab 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -11,9 +11,10 @@ #include <com/sun/star/awt/XBitmap.hpp> #include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/style/BreakType.hpp> +#include <com/sun/star/text/FontEmphasis.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/XTextRangeCompare.hpp> -#include <com/sun/star/text/FontEmphasis.hpp> #include <string> @@ -493,6 +494,12 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphMark, "paragraph-mark.docx") CPPUNIT_ASSERT_EQUAL(OUString("Emphasis"), getProperty<OUString>(getRun(getParagraph(1), 1), "CharStyleName")); } +DECLARE_OOXMLEXPORT_TEST(testPageBreakBefore, "page-break-before.docx") +{ + // This was style::BreakType_PAGE_BEFORE, i.e. page break wasn't ignored, as it should have been. + CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 45fb28f41468..12763b9bd91f 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1135,10 +1135,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) rContext->Insert(PROP_PARA_KEEP_TOGETHER, uno::makeAny( nIntValue ? true : false) ); break; case NS_ooxml::LN_CT_PPrBase_pageBreakBefore: - if ( nIntValue == 1 ) - { - rContext->Insert(PROP_BREAK_TYPE, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE ) ); - } + rContext->Insert(PROP_BREAK_TYPE, uno::makeAny(nIntValue ? style::BreakType_PAGE_BEFORE : style::BreakType_NONE)); break; case NS_ooxml::LN_CT_NumPr_ilvl: if (nIntValue < 0 || 10 <= nIntValue) // Writer can't do everything |