diff options
Diffstat (limited to 'sw/source/core/crsr/pam.cxx')
-rw-r--r-- | sw/source/core/crsr/pam.cxx | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index ec30b5aefbe0..6de3089cb3ca 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -825,21 +825,27 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const } //FIXME FieldBk // TODO: Form Protection when Enhanced Fields are enabled - if (!bRet) { - const SwDoc *pDoc = GetDoc(); - sw::mark::IMark* pA = NULL; - sw::mark::IMark* pB = NULL; - if ( pDoc ) - { - const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( ); - pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL; - pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA; - bRet = ( pA != pB ); - } + const SwDoc *pDoc = GetDoc(); + sw::mark::IMark* pA = NULL; + sw::mark::IMark* pB = NULL; + if ( pDoc ) + { + const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( ); + pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL; + pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA; + } + + if (!bRet) + { + bRet = ( pA != pB ); bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM ); if ( bProtectForm ) bRet |= ( pA == NULL || pB == NULL ); } + else + { + bRet = !( pA == pB && pA != NULL ); + } return bRet; } |