summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmltok/data/n750935.docxbin0 -> 57750 bytes
-rw-r--r--sw/qa/extras/ooxmltok/ooxmltok.cxx14
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx11
3 files changed, 23 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmltok/data/n750935.docx b/sw/qa/extras/ooxmltok/data/n750935.docx
new file mode 100644
index 000000000000..0dd01592dd65
--- /dev/null
+++ b/sw/qa/extras/ooxmltok/data/n750935.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 5beb57735f9d..5aff21cb3d8c 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 471f9b8cfa79..3f6b18cdd0ee 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;