dev/null |binary sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 24 ------------------------ sw/source/core/crsr/pam.cxx | 12 +----------- 3 files changed, 1 insertion(+), 35 deletions(-)
New commits: commit a7fd527ece87a1c25fe0d8a9811fe2b230eeea88 Author: Thorsten Behrens <thorsten.behr...@cib.de> AuthorDate: Mon Jan 21 12:32:00 2019 +0100 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Mon Jan 21 15:27:07 2019 +0100 Revert "tdf#122201 sw: DOCX: allow editing of unprotected areas in protected doc" Dependent patches were abandoned, this one does not work in isolation. This reverts commit 46c6c414a6df79575517f5df67510d6f4e3d0128. Change-Id: I28edb844242a1e31df0be2e57ad8591055db330c Reviewed-on: https://gerrit.libreoffice.org/66677 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/sw/qa/extras/ooxmlexport/data/tdf122201_editUnprotectedText.odt b/sw/qa/extras/ooxmlexport/data/tdf122201_editUnprotectedText.odt deleted file mode 100644 index 217c8c38a409..000000000000 Binary files a/sw/qa/extras/ooxmlexport/data/tdf122201_editUnprotectedText.odt and /dev/null differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 4b443c7ff67c..54bb46946354 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -52,8 +52,6 @@ #include <string> #include <config_features.h> -#include <unocrsr.hxx> -#include <ndtxt.hxx> class Test : public SwModelTestBase { @@ -998,28 +996,6 @@ DECLARE_OOXMLEXPORT_TEST(tdf66398_permissions, "tdf66398_permissions.docx") CPPUNIT_ASSERT(xBookmarksByName->hasByName("permission-for-group:267014232:everyone")); } -DECLARE_OOXMLEXPORT_TEST(tdf122201_editUnprotectedText, "tdf122201_editUnprotectedText.odt") -{ - // get the document - SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); - CPPUNIT_ASSERT(pTextDoc); - - SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); - CPPUNIT_ASSERT(pDoc); - - // get two different nodes - SwNodeIndex aDocEnd(pDoc->GetNodes().GetEndOfContent()); - SwNodeIndex aDocStart(*aDocEnd.GetNode().StartOfSectionNode(), 3); - - // check protected area - SwPaM aPaMPortected(aDocStart); - CPPUNIT_ASSERT(aPaMPortected.HasReadonlySel(false)); - - // check unprotected area - SwPaM aPaMUnprotected(aDocEnd); - CPPUNIT_ASSERT(!aPaMUnprotected.HasReadonlySel(false)); -} - DECLARE_OOXMLEXPORT_TEST(testSectionHeader, "sectionprot.odt") { if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 3eaf288f7b30..4e762bfcf218 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -597,16 +597,6 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const { bRet = true; } - else - { - const SwSectionNode* pParentSectionNd = pNd->FindSectionNode(); - if ( pParentSectionNd != nullptr - && ( pParentSectionNd->GetSection().IsProtectFlag() - || ( bFormView && !pParentSectionNd->GetSection().IsEditInReadonlyFlag()) ) ) - { - bRet = true; - } - } } if ( !bRet @@ -711,7 +701,7 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const // touches fields, or fully encloses it), then don't disable editing bRet = !( ( !pA || bAtStartA ) && ( !pB || bAtStartB ) ); } - if( !bRet && pDoc->GetDocumentSettingManager().get( DocumentSettingId::PROTECT_FORM ) && (pA || pB) ) + if( !bRet && pDoc->GetDocumentSettingManager().get( DocumentSettingId::PROTECT_FORM ) ) { // Form protection case bRet = ( pA == nullptr ) || ( pB == nullptr ) || bAtStartA || bAtStartB; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits