diff options
author | Adam Co <rattles2013@gmail.com> | 2013-06-11 18:21:27 +0300 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-03-04 10:28:34 +0100 |
commit | d8a395033c7d0c924ce5898b2e9b301dbde80b44 (patch) | |
tree | 243be23b134e8e47a0a4c76e8357da11f4bd727b | |
parent | ff2704d22bab86d9e58df812bc01482cfb4bb262 (diff) |
fdo#65655 : fix for Different_Odd_And_Even_Pages flag ignored
Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
(cherry picked from commit db23f89b76cb61b215bcae5495eadba2b5ceace2)
Signed-off-by: Michael Stahl <mstahl@redhat.com>
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Change-Id: Icf9949bb00aa905d22aedfd8f2b297dfa89dfedb
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo65655.docx | bin | 0 -> 13760 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 16 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 |
3 files changed, 24 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo65655.docx b/sw/qa/extras/ooxmlexport/data/fdo65655.docx Binary files differnew file mode 100644 index 000000000000..5fe9451bb091 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo65655.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 1372151e1c93..21fa48233571 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 131559f4edd8..b0cde8d58f27 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; |