sw/qa/extras/ooxmltok/data/n750935.docx |binary sw/qa/extras/ooxmltok/ooxmltok.cxx | 14 ++++++++++++++ writerfilter/source/dmapper/PropertyMap.cxx | 11 +++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-)
New commits: commit 0ef7dbcb365534c4203760c86d089d50f7eb9562 Author: Miklos Vajna <vmik...@suse.cz> Date: Sat Apr 14 16:11:46 2012 +0200 dmapper: fix import of odd/even page breaks diff --git a/sw/qa/extras/ooxmltok/data/n750935.docx b/sw/qa/extras/ooxmltok/data/n750935.docx new file mode 100644 index 0000000..0dd0159 Binary files /dev/null and b/sw/qa/extras/ooxmltok/data/n750935.docx differ diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx index 5beb577..5aff21c 100644 --- a/sw/qa/extras/ooxmltok/ooxmltok.cxx +++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx @@ -31,7 +31,9 @@ #include <com/sun/star/text/SetVariableType.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> #include <com/sun/star/text/XDependentTextField.hpp> +#include <com/sun/star/text/XPageCursor.hpp> #include <com/sun/star/text/XTextFieldsSupplier.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> #include <test/bootstrapfixture.hxx> #include <unotest/macros_test.hxx> @@ -50,12 +52,14 @@ public: void testN751054(); void testN751117(); void testN751017(); + void testN750935(); CPPUNIT_TEST_SUITE(OoxmlModelTest); #if !defined(MACOSX) && !defined(WNT) CPPUNIT_TEST(testN751054); CPPUNIT_TEST(testN751117); CPPUNIT_TEST(testN751017); + CPPUNIT_TEST(testN750935); #endif CPPUNIT_TEST_SUITE_END(); @@ -171,6 +175,16 @@ void OoxmlModelTest::testN751017() CPPUNIT_ASSERT(bFoundGet); } +void OoxmlModelTest::testN750935() +{ + load("n750935.docx"); + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + CPPUNIT_ASSERT_EQUAL(sal_Int16(5), xCursor->getPage()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(OoxmlModelTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 471f9b8..3f6b18c 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/style/BreakType.hpp> +#include <com/sun/star/style/PageStyleLayout.hpp> #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/WritingMode.hpp> #include <com/sun/star/text/XTextColumns.hpp> @@ -974,8 +975,14 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) 0 - No break 1 - New Colunn 2 - New page 3 - Even page 4 - odd page */ xRangeProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_PAGE_DESC_NAME ), uno::makeAny( m_bTitlePage ? m_sFirstPageStyleName : m_sFollowPageStyleName )); - // todo: page breaks with odd/even page numbering are not available - find out current page number to check how to change the number - // or add even/odd page break types + // handle page breaks with odd/even page numbering + style::PageStyleLayout nPageStyleLayout; + if (m_nBreakType == 3) + nPageStyleLayout = style::PageStyleLayout_LEFT; + else if (m_nBreakType == 4) + nPageStyleLayout = style::PageStyleLayout_RIGHT; + if (nPageStyleLayout) + xFollowPageStyle->setPropertyValue("PageStyleLayout", uno::makeAny(nPageStyleLayout)); if(m_bPageNoRestart || m_nPageNumber >= 0) { sal_Int16 nPageNumber = m_nPageNumber >= 0 ? static_cast< sal_Int16 >(m_nPageNumber) : 1; _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits