summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Co <rattles2013@gmail.com>2013-06-11 18:21:27 +0300
committerMiklos Vajna <vmiklos@suse.cz>2013-06-13 09:40:06 +0200
commitdb23f89b76cb61b215bcae5495eadba2b5ceace2 (patch)
tree9d80e086fb874afebbc6414d4329cc4f9cb00eb6
parentc688919620fb22e27471d222d99c0599ee0872e7 (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 Change-Id: Icf9949bb00aa905d22aedfd8f2b297dfa89dfedb
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo65655.docxbin0 -> 13760 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx16
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx10
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
new file mode 100644
index 000000000000..5fe9451bb091
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo65655.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index bcecf95c5ac8..8b4308e856c4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -73,6 +73,7 @@ public:
void testFdo64826();
void testPageBackground();
void testFdo65265();
+ void testFdo65655();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -123,6 +124,7 @@ void Test::run()
{"fdo64826.docx", &Test::testFdo64826},
{"page-background.docx", &Test::testPageBackground},
{"fdo65265.docx", &Test::testFdo65265},
+ {"fdo65655.docx", &Test::testFdo65655},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -700,6 +702,20 @@ void Test::testFdo65265()
CPPUNIT_ASSERT_EQUAL(OUString("Format"), getProperty<OUString>(getRun(xParagraph2, 2), "RedlineType"));
}
+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 fbc633d25877..c822739168d7 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1377,7 +1377,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
@@ -1419,7 +1422,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;