diff options
-rw-r--r-- | sw/qa/extras/ww8export/data/tdf37778_readonlySection.doc | bin | 0 -> 29696 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export3.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf37778_readonlySection.doc b/sw/qa/extras/ww8export/data/tdf37778_readonlySection.doc Binary files differnew file mode 100644 index 000000000000..5e4fcdd760f4 --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf37778_readonlySection.doc diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index 41d4ddcfe84f..8d0475975eb4 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -32,6 +32,18 @@ public: } }; +DECLARE_WW8EXPORT_TEST(testTdf37778_readonlySection, "tdf37778_readonlySection.doc") +{ + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + CPPUNIT_ASSERT( xStorable->isReadonly() ); + + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + // The problem was that section protection was being enabled in addition to being read-only. + // This created an explicit section with protection. There should be just the default, non-explicit section. + CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of Sections", sal_Int32(0), xSections->getCount()); + } + DECLARE_WW8EXPORT_TEST(testTdf120225_textControlCrossRef, "tdf120225_textControlCrossRef.doc") { uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index d44c84ad14bd..2cd0cd918c59 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2361,7 +2361,7 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, bool wwSectionManager::SectionIsProtected(const wwSection &rSection) const { - return (mrReader.m_xWwFib->m_fReadOnlyRecommended && !rSection.IsNotProtected()); + return ( mrReader.m_xWDop->fProtEnabled && !rSection.IsNotProtected() ); } void wwSectionManager::SetHdFt(wwSection const &rSection, int nSect, |