diff options
-rw-r--r-- | sw/qa/extras/ww8export/data/gutter-top.doc | bin | 0 -> 22528 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export3.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 5 |
7 files changed, 30 insertions, 5 deletions
diff --git a/sw/qa/extras/ww8export/data/gutter-top.doc b/sw/qa/extras/ww8export/data/gutter-top.doc Binary files differnew file mode 100644 index 000000000000..07ffa3945ac5 --- /dev/null +++ b/sw/qa/extras/ww8export/data/gutter-top.doc diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index eca50addbe46..df108531118d 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -70,6 +70,20 @@ DECLARE_WW8EXPORT_TEST(testGutterLeft, "gutter-left.doc") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin); } +CPPUNIT_TEST_FIXTURE(Test, testGutterTop) +{ + load(mpTestDocumentPath, "gutter-top.doc"); + reload(mpFilter, "gutter-top.doc"); + uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xSettings( + xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); + bool bGutterAtTop{}; + xSettings->getPropertyValue("GutterAtTop") >>= bGutterAtTop; + // Without the accompanying fix in place, this test would have failed, becase the gutter was + // at the left. + CPPUNIT_ASSERT(bGutterAtTop); +} + DECLARE_WW8EXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.doc") { auto xNumberingRules diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 107c8e2e1edb..361bb213a57c 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -528,6 +528,11 @@ static void WriteDop( WW8Export& rWrt ) rDop.fProtEnabled = false; } + if (rWrt.m_pDoc->getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP)) + { + rDop.iGutterPos = true; + } + if (!xDocProps.is()) { rDop.dttmCreated = rDop.dttmRevised = rDop.dttmLastPrint = 0x45FBAC69; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 7fc65b6598e5..39b75dc8c4a4 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1949,6 +1949,11 @@ void SwWW8ImplReader::ImportDop() const SvtFilterOptions& rOpt = SvtFilterOptions::Get(); if (rOpt.IsUseEnhancedFields()) m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::PROTECT_FORM, m_xWDop->fProtEnabled ); + + if (m_xWDop->iGutterPos) + { + m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::GUTTER_AT_TOP, true); + } } void SwWW8ImplReader::ImportDopTypography(const WW8DopTypography &rTypo) diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index b2f4a12db1b9..7759951e6805 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -866,7 +866,7 @@ private: static bool SetCols(SwFrameFormat &rFormat, const wwSection &rSection, sal_uInt32 nNetWidth); bool SectionIsProtected(const wwSection &rSection) const; - void SetLeftRight(wwSection &rSection); + static void SetLeftRight(wwSection &rSection); /* The segment we're inserting, the start of the segments container, and the nodeindex of where we want the page break to (normally the segments start diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 4a8821f678f8..be0c2145763a 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -481,10 +481,6 @@ void wwSectionManager::SetLeftRight(wwSection &rSection) nWWRi += nWWGu; nWWGu = 0; } - else if (mrReader.m_xWDop->iGutterPos) - { - nWWGu = 0; - } // Left / Right if ((rSection.nPgWidth - nWWLe - nWWRi) < MINLAY) diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index f64859171dc6..35fa751c37f0 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -8187,6 +8187,11 @@ void WW8Dop::Write(SvStream& rStrm, WW8Fib& rFib) const a16Bit |= 0x0007; a16Bit |= (0x0ff8 & (wScaleSaved << 3)); a16Bit |= (0x3000 & (zkSaved << 12)); + if (iGutterPos) + { + // Last bit: gutter at top. + a16Bit |= 0x8000; + } Set_UInt16( pData, a16Bit ); if( 8 == rFib.m_nVersion ) |