diff options
author | Luke Deller <luke@deller.id.au> | 2014-07-09 22:39:41 +1000 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2014-08-19 17:57:14 +0200 |
commit | 2e7a33658983b6863d3847daca0265e43fbe18ba (patch) | |
tree | 2a027b6f9700f101abc31b947769256bda4b750b | |
parent | bcbeac44ca54f41fb80a027214b9eb2ec1eb14dd (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
(cherry picked from commit b5bb15013617c6b9f1cdd089acae0bfb7104fa3a)
Signed-off-by: Luboš Luňák <l.lunak@collabora.com>
Conflicts:
sw/qa/extras/ww8import/ww8import.cxx
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 81b0043d788e..2fca67c47203 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -496,6 +496,22 @@ DECLARE_WW8IMPORT_TEST(testBnc787942, "bnc787942.doc") parseDump("/root/page[1]/body/txt[4]/anchored"); } +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); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index ccdc07c643f6..d93354114648 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4320,15 +4320,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); |