[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/qa writerfilter/source

Adam Co rattles2013 at gmail.com
Tue Mar 4 03:53:22 PST 2014


 sw/qa/extras/ooxmlexport/data/fdo65655.docx       |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx          |   16 ++++++++++++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   10 ++++++++--
 3 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit d8a395033c7d0c924ce5898b2e9b301dbde80b44
Author: Adam Co <rattles2013 at gmail.com>
Date:   Tue Jun 11 18:21:27 2013 +0300

    fdo#65655 : fix for Different_Odd_And_Even_Pages flag ignored
    
    Signed-off-by: Miklos Vajna <vmiklos at suse.cz>
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    
    (cherry picked from commit db23f89b76cb61b215bcae5495eadba2b5ceace2)
    Signed-off-by: Michael Stahl <mstahl at redhat.com>
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    
    Change-Id: Icf9949bb00aa905d22aedfd8f2b297dfa89dfedb

diff --git a/sw/qa/extras/ooxmlexport/data/fdo65655.docx b/sw/qa/extras/ooxmlexport/data/fdo65655.docx
new file mode 100644
index 0000000..5fe9451
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo65655.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 1372151..21fa482 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -78,6 +78,7 @@ public:
     void testCp1000015();
     void testFdo70812();
     void testBnc837302();
+    void testFdo65655();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -140,6 +141,7 @@ void Test::run()
         {"cp1000015.odt", &Test::testCp1000015},
         {"fdo70812.docx", &Test::testFdo70812},
         {"bnc837302.docx", &Test::testBnc837302},
+        {"fdo65655.docx", &Test::testFdo65655},
     };
     // Don't test the first import of these, for some reason those tests fail
     const char* aBlacklist[] = {
@@ -813,6 +815,20 @@ void Test::testBnc837302()
     CPPUNIT_ASSERT_EQUAL(OUString(), aProperty);
 }
 
+void Test::testFdo65655()
+{
+    // The problem was that the DOCX had a non-blank odd footer and a blank even footer
+    // The 'Different Odd & Even Pages' was turned on
+    // However - LO assumed that because the 'even' footer is blank - it should ignore the 'Different Odd & Even Pages' flag
+    // So it did not import it and did not export it
+    uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
+    sal_Bool bValue = false;
+    xPropertySet->getPropertyValue("HeaderIsShared") >>= bValue;
+    CPPUNIT_ASSERT_EQUAL(false, bool(bValue));
+    xPropertySet->getPropertyValue("FooterIsShared") >>= bValue;
+    CPPUNIT_ASSERT_EQUAL(false, bool(bValue));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 131559f..b0cde8d 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1404,7 +1404,10 @@ void DomainMapper_Impl::PushPageHeader(SectionPropertyMap::PageType eType)
                     uno::makeAny(sal_True) );
             // if a left header is available then header are not shared
             bool bLeft = eType == SectionPropertyMap::PAGE_LEFT;
-            if( bLeft && m_pSettingsTable->GetEvenAndOddHeaders())
+
+            // If the 'Different Even & Odd Pages' flag is turned on - do not ignore it
+            // Even if the 'Even' header is blank - the flag should be imported (so it would look in LO like in Word)
+            if( m_pSettingsTable->GetEvenAndOddHeaders())
                 xPageStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_HEADER_IS_SHARED), uno::makeAny( false ));
 
             //set the interface
@@ -1446,7 +1449,10 @@ void DomainMapper_Impl::PushPageFooter(SectionPropertyMap::PageType eType)
                     uno::makeAny(sal_True) );
             // if a left header is available then footer is not shared
             bool bLeft = eType == SectionPropertyMap::PAGE_LEFT;
-            if( bLeft && m_pSettingsTable->GetEvenAndOddHeaders())
+
+            // If the 'Different Even & Odd Pages' flag is turned on - do not ignore it
+            // Even if the 'Even' footer is blank - the flag should be imported (so it would look in LO like in Word)
+            if( m_pSettingsTable->GetEvenAndOddHeaders())
                 xPageStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_FOOTER_IS_SHARED), uno::makeAny( false ));
             //set the interface
             uno::Reference< text::XText > xFooterText;


More information about the Libreoffice-commits mailing list