[Libreoffice-commits] .: 2 commits - sw/qa writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 19 04:06:33 PDT 2012


 sw/qa/extras/ooxmlimport/data/n778828.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx    |   17 +++++++++++++++++
 writerfilter/source/dmapper/PropertyMap.cxx |    5 +++--
 3 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit e8a169c93d7e2443a2e56afe7e99cd0721a2c27b
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Sep 19 13:03:43 2012 +0200

    n#778828 testcase
    
    Change-Id: I38ba0fd4128acfa114eac0b6b6e28ea49c335f0c

diff --git a/sw/qa/extras/ooxmlimport/data/n778828.docx b/sw/qa/extras/ooxmlimport/data/n778828.docx
new file mode 100644
index 0000000..ad2e22d
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n778828.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 4d25c9b..e2ab2b0 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -91,6 +91,7 @@ public:
     void testN777337();
     void testN778836();
     void testN778140();
+    void testN778828();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -124,6 +125,7 @@ public:
     CPPUNIT_TEST(testN777337);
     CPPUNIT_TEST(testN778836);
     CPPUNIT_TEST(testN778140);
+    CPPUNIT_TEST(testN778828);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -830,6 +832,21 @@ void Test::testN778140()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(353), getProperty<sal_Int32>(getParagraph(0), "ParaBottomMargin"));
 }
 
+void Test::testN778828()
+{
+    /*
+     * The problem was that a page break after a continous section break caused
+     * double page break on title page.
+     */
+    load("n778828.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(2), xCursor->getPage());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 1a60519fcd7706b487ceb7c5e879a81a6109f839
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Sep 19 12:06:57 2012 +0100

    n#778828 fix docx import of continous section break on title page
    
    Change-Id: Ib9e9cce5abdcf00c2546f831c8af191da10e1b15

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index fcb7572..d271299 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -996,8 +996,9 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
                 uno::Reference<beans::XPropertySet> xRangeProperties(lcl_GetRangeProperties(m_bIsFirstSection, rDM_Impl, m_xStartingRange));
             /* break type
             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 ));
+                if ((m_bTitlePage && m_bIsFirstSection) || !m_bTitlePage)
+                    xRangeProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_PAGE_DESC_NAME ),
+                            uno::makeAny( m_bTitlePage ? m_sFirstPageStyleName : m_sFollowPageStyleName ));
                 // handle page breaks with odd/even page numbering
                 style::PageStyleLayout nPageStyleLayout(style::PageStyleLayout_ALL);
                 if (m_nBreakType == 3)


More information about the Libreoffice-commits mailing list