diff options
author | Luke Deller <luke@deller.id.au> | 2014-07-09 22:39:41 +1000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-13 21:50:36 +0200 |
commit | b5bb15013617c6b9f1cdd089acae0bfb7104fa3a (patch) | |
tree | f684d757c238457bb3b3d1b0649621d9f889a1e7 | |
parent | 455404320614f56c2e840ab0c9baf70596bde559 (diff) |
fdo#81102: fix .doc import of blank even page header
Honour the "different odd & even pages" header/footer setting from the
doc file even if there is no content for an even page header or footer.
Conflicts:
sw/qa/extras/ww8import/ww8import.cxx
Reviewed on:
https://gerrit.libreoffice.org/10191
Change-Id: I963f7f7189e399b1d859db0788fbfd291e868c54
-rwxr-xr-x | sw/qa/extras/ww8import/data/fdo81102.doc | bin | 0 -> 22528 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8import/ww8import.cxx | 16 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 5 |
3 files changed, 17 insertions, 4 deletions
diff --git a/sw/qa/extras/ww8import/data/fdo81102.doc b/sw/qa/extras/ww8import/data/fdo81102.doc Binary files differnew file mode 100755 index 000000000000..e8a550768f01 --- /dev/null +++ b/sw/qa/extras/ww8import/data/fdo81102.doc diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 58a3bc19a141..354e5552a1cb 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -469,6 +469,22 @@ DECLARE_WW8IMPORT_TEST(testFdp80333, "fdo80333.doc") CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_NONE, aShadow.Location); } +DECLARE_WW8IMPORT_TEST(testFdo81102, "fdo81102.doc") +{ + // get page style at beginning of document + uno::Reference<text::XTextDocument> textDocument( + mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> start( + textDocument->getText()->getStart(), uno::UNO_QUERY); + OUString pageStyleName = getProperty<OUString>(start, "PageStyleName"); + uno::Reference<style::XStyle> pageStyle( + getStyles("PageStyles")->getByName(pageStyleName), uno::UNO_QUERY); + + // check that left and right pages do not share the same header + bool headerIsShared = getProperty<bool>(pageStyle, "HeaderIsShared"); + CPPUNIT_ASSERT(!headerIsShared); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 885cf12071ab..029cce82150a 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4318,15 +4318,12 @@ void wwSectionManager::SetSegmentToPageDesc(const wwSection &rSection, void wwSectionManager::SetUseOn(wwSection &rSection) { - bool bEven = (rSection.maSep.grpfIhdt & (WW8_HEADER_EVEN|WW8_FOOTER_EVEN)) ? - true : false; - bool bMirror = mrReader.pWDop->fMirrorMargins || mrReader.pWDop->doptypography.f2on1; UseOnPage eUseBase = bMirror ? nsUseOnPage::PD_MIRROR : nsUseOnPage::PD_ALL; UseOnPage eUse = eUseBase; - if (!bEven) + if (!mrReader.pWDop->fFacingPages) eUse = (UseOnPage)(eUse | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE); if (!rSection.HasTitlePage()) eUse = (UseOnPage)(eUse | nsUseOnPage::PD_FIRSTSHARE); |