diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf98700_keepWithNext.odt | bin | 0 -> 12680 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 6 |
3 files changed, 13 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf98700_keepWithNext.odt b/sw/qa/extras/ooxmlexport/data/tdf98700_keepWithNext.odt Binary files differnew file mode 100644 index 000000000000..4ed96da554a5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf98700_keepWithNext.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 73392c03cea2..1925600de5e9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -95,6 +95,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf46940_dontEquallyDistributeColumns, "tdf46940_do CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTextSections->getByIndex(3), "DontBalanceTextColumns")); } +DECLARE_OOXMLEXPORT_TEST(testTdf98700_keepWithNext, "tdf98700_keepWithNext.odt") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading style keeps with next", true, getProperty<bool>(getParagraph(1), "ParaKeepTogether")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default style doesn't keep with next", false, getProperty<bool>(getParagraph(2), "ParaKeepTogether")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading 1 style inherits keeps with next", true, getProperty<bool>(getParagraph(3), "ParaKeepTogether")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading 2 style disabled keep with next", false, getProperty<bool>(getParagraph(4), "ParaKeepTogether")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Text Body style toggled off keep with next", false, getProperty<bool>(getParagraph(5), "ParaKeepTogether")); +} + DECLARE_OOXMLEXPORT_TEST(testRhbz988516, "rhbz988516.docx") { // The problem was that the list properties of the footer leaked into body diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 9a6d0d05218f..86200257f6d6 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -8011,9 +8011,11 @@ void DocxAttributeOutput::FormatColumns_Impl( sal_uInt16 nCols, const SwFormatCo m_pSerializer->endElementNS( XML_w, XML_cols ); } -void DocxAttributeOutput::FormatKeep( const SvxFormatKeepItem& ) +void DocxAttributeOutput::FormatKeep( const SvxFormatKeepItem& rItem ) { - m_pSerializer->singleElementNS( XML_w, XML_keepNext, FSEND ); + m_pSerializer->singleElementNS( XML_w, XML_keepNext, + FSNS( XML_w, XML_val ), OString::boolean( rItem.GetValue() ), + FSEND ); } void DocxAttributeOutput::FormatTextGrid( const SwTextGridItem& rGrid ) |