diff options
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakB.docx (renamed from sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakB.docx) | bin | 13971 -> 13971 bytes | |||
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakC.docx (renamed from sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakC.docx) | bin | 13955 -> 13955 bytes | |||
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakD.docx (renamed from sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakD.docx) | bin | 21482 -> 21482 bytes | |||
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakE.docx (renamed from sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakE.docx) | bin | 14047 -> 14047 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 71 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 70 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 12 |
7 files changed, 80 insertions, 73 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakB.docx b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakB.docx Binary files differindex a7b880d00e60..a7b880d00e60 100755 --- a/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakB.docx +++ b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakB.docx diff --git a/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakC.docx b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakC.docx Binary files differindex 52767abb8ce3..52767abb8ce3 100755 --- a/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakC.docx +++ b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakC.docx diff --git a/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakD.docx b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakD.docx Binary files differindex 37c752499f08..37c752499f08 100755 --- a/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakD.docx +++ b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakD.docx diff --git a/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakE.docx b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakE.docx Binary files differindex ac3eb9f7c7ff..ac3eb9f7c7ff 100755 --- a/sw/qa/extras/ooxmlimport/data/tdf103975_notPageBreakE.docx +++ b/sw/qa/extras/ooxmlexport/data/tdf103975_notPageBreakE.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 186f7a8d1eb9..d38a6ff46364 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -19,6 +19,7 @@ #include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> #include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/style/BreakType.hpp> #include <com/sun/star/style/PageStyleLayout.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp> @@ -259,6 +260,76 @@ DECLARE_OOXMLEXPORT_TEST(testRhbz988516, "rhbz988516.docx") CPPUNIT_ASSERT_EQUAL( 2, getPages() ); } +DECLARE_OOXMLEXPORT_TEST(testTdf103975_notPageBreakB, "tdf103975_notPageBreakB.docx") +{ + // turn on View Formatting Marks to see these documents. + uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(1), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(3), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(4), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); + + CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); + CPPUNIT_ASSERT_EQUAL( 4, getParagraphs() ); + CPPUNIT_ASSERT_EQUAL( 1, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103975_notPageBreakC, "tdf103975_notPageBreakC.docx") +{ + // turn on View Formatting Marks to see these documents. + uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(1), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(3), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); + + xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(4), "TextSection"); + CPPUNIT_ASSERT(xTextSection.is()); + xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); + + CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); + CPPUNIT_ASSERT_EQUAL( 4, getParagraphs() ); + CPPUNIT_ASSERT_EQUAL( 1, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103975_notPageBreakD, "tdf103975_notPageBreakD.docx") +{ + // The problem was that the column break was moving outside of the columns, making a page break. + CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); + CPPUNIT_ASSERT_EQUAL( 1, getPages() ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf103975_notPageBreakE, "tdf103975_notPageBreakE.docx") +{ + // The problem was that the column break was getting lost. + CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); +} + + DECLARE_OOXMLEXPORT_TEST(testTdf103389, "tdf103389.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 90e36f1ef593..dee3ad3d3596 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -26,7 +26,6 @@ #include <com/sun/star/drawing/PointSequenceSequence.hpp> #include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/style/BreakType.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp> @@ -142,75 +141,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf103931, "tdf103931.docx") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), xTextSections->getCount()); } -DECLARE_OOXMLIMPORT_TEST(testTdf103975_notPageBreakB, "tdf103975_notPageBreakB.docx") -{ - // turn on View Formatting Marks to see these documents. - uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(1), "TextSection"); - CPPUNIT_ASSERT(xTextSection.is()); - uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); - - xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection"); - CPPUNIT_ASSERT(xTextSection.is()); - xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); - - xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(3), "TextSection"); - CPPUNIT_ASSERT(xTextSection.is()); - xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); - - xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(4), "TextSection"); - CPPUNIT_ASSERT(xTextSection.is()); - xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); - - CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); - CPPUNIT_ASSERT_EQUAL( 4, getParagraphs() ); - CPPUNIT_ASSERT_EQUAL( 1, getPages() ); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf103975_notPageBreakC, "tdf103975_notPageBreakC.docx") -{ - // turn on View Formatting Marks to see these documents. - uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(1), "TextSection"); - CPPUNIT_ASSERT(xTextSection.is()); - uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); - - xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection"); - CPPUNIT_ASSERT(xTextSection.is()); - xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); - - xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(3), "TextSection"); - CPPUNIT_ASSERT(xTextSection.is()); - xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); - - xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(4), "TextSection"); - CPPUNIT_ASSERT(xTextSection.is()); - xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); - - CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); - CPPUNIT_ASSERT_EQUAL( 4, getParagraphs() ); - CPPUNIT_ASSERT_EQUAL( 1, getPages() ); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf103975_notPageBreakD, "tdf103975_notPageBreakD.docx") -{ - // The problem was that the column break was moving outside of the columns, making a page break. - CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); - CPPUNIT_ASSERT_EQUAL( 1, getPages() ); -} - -DECLARE_OOXMLIMPORT_TEST(testTdf103975_notPageBreakE, "tdf103975_notPageBreakE.docx") -{ - // The problem was that the column break was getting lost. - CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); -} - DECLARE_OOXMLIMPORT_TEST(testN751017, "n751017.docx") { uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 2f3df2fa01fc..95db1c41a893 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3306,10 +3306,16 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) const bool bSingleParagraph = m_pImpl->GetIsFirstParagraphInSection() && m_pImpl->GetIsLastParagraphInSection(); PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH); - if (pContext && (m_pImpl->GetSettingsTable()->GetSplitPgBreakAndParaMark() || bSingleParagraph)) + if (pContext && !pContext->GetFootnote().is()) { if (m_pImpl->isBreakDeferred(PAGE_BREAK)) - pContext->Insert(PROP_BREAK_TYPE, uno::makeAny(style::BreakType_PAGE_BEFORE)); + { + if (m_pImpl->GetSettingsTable()->GetSplitPgBreakAndParaMark()) + { + pContext->Insert(PROP_BREAK_TYPE, uno::makeAny(style::BreakType_PAGE_BEFORE)); + m_pImpl->clearDeferredBreaks(); + } + } else if (m_pImpl->isBreakDeferred(COLUMN_BREAK)) { if ( m_pImpl->GetIsFirstParagraphInSection() || !m_pImpl->IsFirstRun() ) @@ -3320,8 +3326,8 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) } pContext->Insert(PROP_BREAK_TYPE, uno::makeAny(style::BreakType_COLUMN_BEFORE)); + m_pImpl->clearDeferredBreaks(); } - m_pImpl->clearDeferredBreaks(); } // If the paragraph contains only the section properties and it has |