[Libreoffice-commits] core.git: sw/qa sw/source
Luke Deller
luke at deller.id.au
Sun Jul 13 12:51:10 PDT 2014
sw/qa/extras/ww8import/data/fdo81102.doc |binary
sw/qa/extras/ww8import/ww8import.cxx | 16 ++++++++++++++++
sw/source/filter/ww8/ww8par.cxx | 5 +----
3 files changed, 17 insertions(+), 4 deletions(-)
New commits:
commit b5bb15013617c6b9f1cdd089acae0bfb7104fa3a
Author: Luke Deller <luke at deller.id.au>
Date: Wed Jul 9 22:39:41 2014 +1000
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
diff --git a/sw/qa/extras/ww8import/data/fdo81102.doc b/sw/qa/extras/ww8import/data/fdo81102.doc
new file mode 100755
index 0000000..e8a5507
Binary files /dev/null and b/sw/qa/extras/ww8import/data/fdo81102.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 58a3bc1..354e555 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 885cf12..029cce8 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);
More information about the Libreoffice-commits
mailing list