Kaydet (Commit) b5bb1501 authored tarafından Luke Deller's avatar Luke Deller Kaydeden (comit) Miklos Vajna

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
üst 45540432
This diff was suppressed by a .gitattributes entry.
......@@ -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: */
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment