[Libreoffice-commits] core.git: 2 commits - sw/inc sw/sdi sw/source ucb/qa

Caolán McNamara caolanm at redhat.com
Sat Feb 22 11:51:59 PST 2014


 sw/inc/editsh.hxx                |    2 
 sw/sdi/_basesh.sdi               |    2 
 sw/sdi/_textsh.sdi               |    3 -
 sw/source/core/crsr/crsrsh.cxx   |   19 +++++---
 sw/source/core/crsr/pam.cxx      |   77 +++++++++++++++++++++-------------
 sw/source/core/edit/eddel.cxx    |    2 
 sw/source/core/edit/edfcol.cxx   |    6 +-
 sw/source/core/edit/ednumber.cxx |   35 ++++++++-------
 sw/source/ui/docvw/edtwin.cxx    |   88 +++++++++++++++++++--------------------
 sw/source/ui/shells/basesh.cxx   |    7 ++-
 sw/source/ui/shells/textsh1.cxx  |   10 ++++
 ucb/qa/complex/ucb/UCB.java      |    2 
 12 files changed, 149 insertions(+), 104 deletions(-)

New commits:
commit b3d153528a13807d2f5347ec83c7a8d483454a75
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Feb 22 19:29:19 2014 +0000

    my upc router automatically adds .net to the domain search path
    
    i.e. I get handed an /etc/resolv.conf of
    
      domain net
      search net ...
    
    and so "nohost" resolves to "nohost.net" which actually exists, so I get an
    authentication request which is unexpected by this test which therefore falls
    over. "nohost.invalid.net" also exists btw, as are other various foo.net forms
    where foo is one of the reserved tld which don't themselves exist.
    
    So lets shove a "*" into the name which is definitely invalid, sigh.
    
    Change-Id: I8627ced9199f339ad6cca8f27752d883ebe74aad

diff --git a/ucb/qa/complex/ucb/UCB.java b/ucb/qa/complex/ucb/UCB.java
index d937638..815209a 100644
--- a/ucb/qa/complex/ucb/UCB.java
+++ b/ucb/qa/complex/ucb/UCB.java
@@ -179,7 +179,7 @@ public class UCB  {
 
     @Test public void checkWrongFtpConnection() {
         try {
-            String acountUrl = "ftp://noname:nopasswd@nohost";
+            String acountUrl = "ftp://noname:nopasswd@*nohost.invalid";
             System.out.println(acountUrl);
             init();
             Object content = getContent(acountUrl);
commit 961315f0838197e71e9bd49169afe673466e5eb8
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Thu Feb 20 11:01:04 2014 +0000

    Resolves: #i124243# allow in-place editing of Input Fields...
    
    in protected areas (e.g. protected sections)
    
    (cherry picked from commit 1708b9bee77ab0e8762bbb6886b778b93428a2b0)
    
    Conflicts:
    	sw/inc/pam.hxx
    	sw/source/core/crsr/crsrsh.cxx
    	sw/source/core/crsr/pam.cxx
    	sw/source/core/edit/edfcol.cxx
    	sw/source/core/edit/ednumber.cxx
    	sw/source/ui/docvw/edtwin.cxx
    
    Change-Id: Iedcb31a824a9147bccb14314608749121c70d952

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 58bf231..b90c626 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -487,7 +487,7 @@ public:
     bool MoveNumParas( bool bUpperLower, bool bUpperLeft );
 
     /// Switch on/off of numbering via Delete/Backspace.
-    bool NumOrNoNum( sal_Bool bDelete = sal_False, bool bChkStart = true);
+    bool NumOrNoNum(bool bDelete = false, bool bChkStart = true);
 
     // #i23726#
     // #i90078#
diff --git a/sw/sdi/_basesh.sdi b/sw/sdi/_basesh.sdi
index 060ec16..66ab3fb 100644
--- a/sw/sdi/_basesh.sdi
+++ b/sw/sdi/_basesh.sdi
@@ -32,7 +32,6 @@ interface BaseTextSelection
         ExecMethod = ExecDelete ;
         StateMethod = GetState ;
         FastCall = FALSE ;
-        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
     FN_BACKSPACE  // status(final|play)
@@ -40,7 +39,6 @@ interface BaseTextSelection
         ExecMethod = ExecDelete ;
         StateMethod = GetState ;
         FastCall = FALSE ;
-        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
     FN_SHIFT_BACKSPACE // status()
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 0fb5cdb..d799209 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -235,12 +235,13 @@ interface BaseText
         StateMethod = GetState ;
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
+
     FN_INSERT_BREAK // status(final|play)
     [
         ExecMethod = ExecInsert ;
         StateMethod = GetState ;
-        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
+
     FN_INSERT_PAGEBREAK // status(final|play)
     [
         ExecMethod = ExecInsert ;
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index e24ea01..8103f11 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2977,19 +2977,26 @@ void SwCrsrShell::SetReadOnlyAvailable( sal_Bool bFlag )
 sal_Bool SwCrsrShell::HasReadonlySel(bool bAnnotationMode) const
 {
     sal_Bool bRet = sal_False;
-    if( IsReadOnlyAvailable() || GetViewOptions()->IsFormView() )
+    if ( IsReadOnlyAvailable() || GetViewOptions()->IsFormView() )
     {
-        if( m_pTblCrsr )
-            bRet = m_pTblCrsr->HasReadOnlyBoxSel() ||
-                   m_pTblCrsr->HasReadonlySel( GetViewOptions()->IsFormView() );
+        if ( m_pTblCrsr != NULL )
+        {
+            bRet = m_pTblCrsr->HasReadOnlyBoxSel()
+                   || m_pTblCrsr->HasReadonlySel( GetViewOptions()->IsFormView() );
+        }
         else
         {
             const SwPaM* pCrsr = m_pCurCrsr;
 
-            do {
+            do
+            {
                 if( pCrsr->HasReadonlySel( GetViewOptions()->IsFormView(), bAnnotationMode ) )
+                {
                     bRet = sal_True;
-            } while( !bRet && m_pCurCrsr != ( pCrsr = (SwPaM*)pCrsr->GetNext() ));
+                }
+
+                pCrsr = (SwPaM*)pCrsr->GetNext();
+            } while ( !bRet && pCrsr != m_pCurCrsr );
         }
     }
     return bRet;
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 59e2dbc..09e8ea7 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -572,57 +572,77 @@ static const SwFrm* lcl_FindEditInReadonlyFrm( const SwFrm& rFrm )
 bool SwPaM::HasReadonlySel( bool bFormView, bool bAnnotationMode ) const
 {
     bool bRet = false;
-    Point aTmpPt;
-    const SwCntntNode *pNd;
-    const SwCntntFrm *pFrm;
 
-    if( 0 != ( pNd = GetPoint()->nNode.GetNode().GetCntntNode() ))
-        pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetPoint(), sal_False );
-    else
-        pFrm = 0;
-
-    // Will be set if point/mark are inside edit-in-readonly environment
-    const SwFrm* pSttEIRFrm = 0;
-    const SwFrm* pEndEIRFrm = 0;
+    const SwCntntNode* pNd = GetPoint()->nNode.GetNode().GetCntntNode();
+    const SwCntntFrm *pFrm = NULL;
+    if ( pNd != NULL )
+    {
+        Point aTmpPt;
+        pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetPoint(), false );
+    }
 
-    if( pFrm && ( pFrm->IsProtected() ||
-                  ( bFormView && 0 == ( pSttEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) )
+    // Will be set if point are inside edit-in-readonly environment
+    const SwFrm* pPointEditInReadonlyFrm = NULL;
+    if ( pFrm != NULL
+         && ( pFrm->IsProtected()
+              || ( bFormView
+                   && 0 == ( pPointEditInReadonlyFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) )
+    {
         bRet = true;
-    else if( pNd )
+    }
+    else if( pNd != NULL )
     {
         const SwSectionNode* pSNd = pNd->GetSectionNode();
-        if( pSNd && ( pSNd->GetSection().IsProtectFlag() ||
-                      (bFormView && !pSNd->GetSection().IsEditInReadonlyFlag()) ) )
+        if ( pSNd != NULL
+             && ( pSNd->GetSection().IsProtectFlag()
+                  || ( bFormView
+                       && !pSNd->GetSection().IsEditInReadonlyFlag()) ) )
+        {
             bRet = true;
+        }
     }
 
-    if( !bRet && HasMark() && GetPoint()->nNode != GetMark()->nNode )
+    if ( !bRet
+         && HasMark()
+         && GetPoint()->nNode != GetMark()->nNode )
     {
-        if( 0 != ( pNd = GetMark()->nNode.GetNode().GetCntntNode() ))
-            pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetMark(), sal_False );
-        else
-            pFrm = 0;
+        pNd = GetMark()->nNode.GetNode().GetCntntNode();
+        pFrm = NULL;
+        if ( pNd != NULL )
+        {
+            Point aTmpPt;
+            pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetMark(), false );
+        }
 
-        if( pFrm && ( pFrm->IsProtected() ||
-                  ( bFormView && 0 == ( pEndEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) )
+        const SwFrm* pMarkEditInReadonlyFrm = NULL;
+        if ( pFrm != NULL
+             && ( pFrm->IsProtected()
+                  || ( bFormView
+                       && 0 == ( pMarkEditInReadonlyFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) )
+        {
             bRet = true;
-        else if( pNd )
+        }
+        else if( pNd != NULL )
         {
             const SwSectionNode* pSNd = pNd->GetSectionNode();
-            if( pSNd && ( pSNd->GetSection().IsProtectFlag() ||
-                          (bFormView && !pSNd->GetSection().IsEditInReadonlyFlag()) ) )
+            if ( pSNd != NULL
+                 && ( pSNd->GetSection().IsProtectFlag()
+                      || ( bFormView
+                           && !pSNd->GetSection().IsEditInReadonlyFlag()) ) )
+            {
                 bRet = true;
+            }
         }
 
         if ( !bRet && bFormView )
         {
            // Check if start and end frame are inside the _same_
            // edit-in-readonly-environment. Otherwise we better return 'true'
-           if ( pSttEIRFrm != pEndEIRFrm )
+           if ( pPointEditInReadonlyFrm != pMarkEditInReadonlyFrm )
                 bRet = true;
         }
 
-        // protected section in selection
+        // check for protected section inside the selection
         if( !bRet )
         {
             sal_uLong nSttIdx = GetMark()->nNode.GetIndex(),
@@ -659,6 +679,7 @@ bool SwPaM::HasReadonlySel( bool bFormView, bool bAnnotationMode ) const
             }
         }
     }
+
     //FIXME FieldBk
     // TODO: Form Protection when Enhanced Fields are enabled
     const SwDoc *pDoc = GetDoc();
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index a5d7904..9f90348 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -102,7 +102,7 @@ long SwEditShell::Delete()
 {
     SET_CURR_SHELL( this );
     long nRet = 0;
-    if( !HasReadonlySel() )
+    if ( !HasReadonlySel() || CrsrInsideInputFld() )
     {
         StartAllAction();
 
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 3ca8e67..0bc3fd8 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -60,10 +60,10 @@ void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt,
     GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_SETFMTCOLL, &aRewriter);
     FOREACHPAM_START(GetCrsr())
 
-        if( !PCURCRSR->HasReadonlySel(
-                    // Formular view
-                    GetViewOptions()->IsFormView() ) )
+        if ( !PCURCRSR->HasReadonlySel( GetViewOptions()->IsFormView() ) )
+        {
             GetDoc()->SetTxtFmtColl( *PCURCRSR, pLocal, true, bResetListAttrs );
+        }
 
     FOREACHPAM_END()
     GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_SETFMTCOLL, &aRewriter);
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index da1f030..c3c002e 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -647,34 +647,37 @@ sal_Bool SwEditShell::IsOutlineCopyable( sal_uInt16 nIdx ) const
     return lcl_IsOutlineMoveAndCopyable( GetDoc(), nIdx, true );
 }
 
-bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, bool bChkStart )
+bool SwEditShell::NumOrNoNum(
+    bool bNumOn,
+    bool bChkStart )
 {
     bool bRet = false;
-    SwPaM* pCrsr = GetCrsr();
-    if( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark() &&
-        ( !bChkStart || !pCrsr->GetPoint()->nContent.GetIndex()) )
+
+    if ( !IsMultiSelection()
+         && !HasSelection()
+         && ( !bChkStart || IsSttPara() ) )
     {
-        StartAllAction();       // Klammern fuers Updaten !!
-        bRet = GetDoc()->NumOrNoNum( pCrsr->GetPoint()->nNode, !bNumOn ); // #i29560#
+        StartAllAction();
+        bRet = GetDoc()->NumOrNoNum( GetCrsr()->GetPoint()->nNode, !bNumOn );
         EndAllAction();
     }
     return bRet;
 }
 
+
 sal_Bool SwEditShell::IsNoNum( sal_Bool bChkStart ) const
 {
     // a Backspace in the paragraph without number becomes a Delete
     sal_Bool bResult = sal_False;
-    SwPaM* pCrsr = GetCrsr();
 
-    if (pCrsr->GetNext() == pCrsr && !pCrsr->HasMark() &&
-        (!bChkStart || !pCrsr->GetPoint()->nContent.GetIndex()))
+    if ( !IsMultiSelection()
+         && !HasSelection()
+         && ( !bChkStart || IsSttPara() ) )
     {
-        const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
-
-        if (pTxtNd)
+        const SwTxtNode* pTxtNd = GetCrsr()->GetNode()->GetTxtNode();
+        if ( pTxtNd != NULL )
         {
-            bResult =  ! pTxtNd->IsCountedInList();
+            bResult =  !pTxtNd->IsCountedInList();
         }
     }
 
@@ -690,11 +693,11 @@ sal_uInt8 SwEditShell::GetNumLevel() const
     const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
 
     OSL_ENSURE( pTxtNd, "GetNumLevel() without text node" );
-    if ( !pTxtNd )
+    if ( pTxtNd == NULL )
         return nLevel;
 
     const SwNumRule* pRule = pTxtNd->GetNumRule();
-    if(pRule)
+    if ( pRule != NULL )
     {
         const int nListLevelOfTxtNode( pTxtNd->GetActualListLevel() );
         if ( nListLevelOfTxtNode >= 0 )
@@ -721,7 +724,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
     GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
 
     SwPaM* pCrsr = GetCrsr();
-    if( pCrsr->GetNext() != pCrsr )         // multiple selection ?
+    if( IsMultiSelection() )
     {
         SwPamRanges aRangeArr( *pCrsr );
         SwPaM aPam( *pCrsr->GetPoint() );
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 1d2aa2c..d52a9af 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -329,7 +329,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
     if( m_pApplyTempl )
     {
         PointerStyle eStyle = POINTER_FILL;
-        if( rSh.IsOverReadOnlyPos( rLPt ))
+        if ( rSh.IsOverReadOnlyPos( rLPt ) )
         {
             delete m_pUserMarker;
             m_pUserMarker = 0L;
@@ -1896,7 +1896,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
                 break;
                 case KEY_BACKSPACE:
                 case KEY_BACKSPACE | KEY_SHIFT:
-                    if( !rSh.HasReadonlySel() )
+                    if ( !rSh.HasReadonlySel()
+                         && !rSh.CrsrInsideInputFld() )
                     {
                         bool bDone = false;
                         // try to add comment for code snip:
@@ -1906,12 +1907,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
                         // Also try to remove indent, if current paragraph
                         // has numbering rule, but isn't counted and only
                         // key <backspace> is hit.
-                        const bool bOnlyBackspaceKey(
-                                    KEY_BACKSPACE == rKeyCode.GetFullCode() );
-                        if ( rSh.IsSttPara() &&
-                             !rSh.HasSelection() &&
-                             ( NULL == rSh.GetCurNumRule() ||
-                               ( rSh.IsNoNum() && bOnlyBackspaceKey ) ) )
+                        const bool bOnlyBackspaceKey( KEY_BACKSPACE == rKeyCode.GetFullCode() );
+                        if ( rSh.IsSttPara()
+                             && !rSh.HasSelection()
+                             && ( rSh.GetCurNumRule() == NULL
+                                  || ( rSh.IsNoNum() && bOnlyBackspaceKey ) ) )
                         {
                             bDone = rSh.TryRemoveIndent();
                         }
@@ -1920,8 +1920,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
                             eKeyState = KS_End;
                         else
                         {
-                            if (rSh.IsSttPara() &&
-                                ! rSh.IsNoNum())
+                            if ( rSh.IsSttPara() && !rSh.IsNoNum() )
                             {
                                 if (m_nKS_NUMDOWN_Count > 0 &&
                                     0 < rSh.GetNumLevel())
@@ -1939,7 +1938,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
                             }
 
                             // If the cursor is in an empty paragraph, which has
-                            // a numbering, but not the oultine numbering, and
+                            // a numbering, but not the outline numbering, and
                             // there is no selection, the numbering has to be
                             // deleted on key <Backspace>.
                             // Otherwise method <SwEditShell::NumOrNoNum(..)>
@@ -1949,35 +1948,34 @@ KEYINPUT_CHECKTABLE_INSDEL:
                             // on <shift-backspace> it is set to <true>.
                             // Thus, assure that method <SwEditShell::NumOrNum(..)>
                             // is only called for the intended purpose.
-                            bool bCallNumOrNoNum( false );
+                            if ( !bDone && rSh.IsSttPara() )
                             {
-                                if ( !bDone )
+                                bool bCallNumOrNoNum( false );
+                                if ( bOnlyBackspaceKey && !rSh.IsNoNum() )
                                 {
-                                    if ( bOnlyBackspaceKey && !rSh.IsNoNum() )
-                                    {
-                                        bCallNumOrNoNum = true;
-                                    }
-                                    else if ( !bOnlyBackspaceKey && rSh.IsNoNum() )
+                                    bCallNumOrNoNum = true;
+                                }
+                                else if ( !bOnlyBackspaceKey && rSh.IsNoNum() )
+                                {
+                                    bCallNumOrNoNum = true;
+                                }
+                                else if ( bOnlyBackspaceKey
+                                          && rSh.IsSttPara()
+                                          && rSh.IsEndPara()
+                                          && !rSh.HasSelection() )
+                                {
+                                    const SwNumRule* pCurrNumRule( rSh.GetCurNumRule() );
+                                    if ( pCurrNumRule != NULL
+                                         && pCurrNumRule != rSh.GetOutlineNumRule() )
                                     {
                                         bCallNumOrNoNum = true;
                                     }
-                                    else if ( bOnlyBackspaceKey &&
-                                              rSh.IsSttPara() && rSh.IsEndPara() &&
-                                              !rSh.HasSelection() )
-                                    {
-                                        const SwNumRule* pCurrNumRule( rSh.GetCurNumRule() );
-                                        if ( pCurrNumRule &&
-                                             pCurrNumRule != rSh.GetOutlineNumRule() )
-                                        {
-                                            bCallNumOrNoNum = true;
-                                        }
-                                    }
                                 }
-                            }
-                            if ( bCallNumOrNoNum &&
-                                 rSh.NumOrNoNum( !bOnlyBackspaceKey, true ) )
-                            {
-                                eKeyState = KS_NumOrNoNum;
+                                if ( bCallNumOrNoNum
+                                     && rSh.NumOrNoNum( !bOnlyBackspaceKey, sal_True ) )
+                                {
+                                    eKeyState = KS_NumOrNoNum;
+                                }
                             }
                         }
                     }
@@ -2009,9 +2007,9 @@ KEYINPUT_CHECKTABLE_INSDEL:
                         GetView().GetViewFrame()->GetDispatcher()->Execute( FN_GOTO_NEXT_INPUTFLD );
                         eKeyState = KS_End;
                     }
-                    else
-                    if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
-                        !rSh.HasReadonlySel() )
+                    else if( rSh.GetCurNumRule()
+                             && rSh.IsSttOfPara()
+                             && !rSh.HasReadonlySel() )
                     {
                         if ( rSh.IsFirstOfNumRule() &&
                              numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
@@ -2060,8 +2058,9 @@ KEYINPUT_CHECKTABLE_INSDEL:
                         GetView().GetViewFrame()->GetDispatcher()->Execute( FN_GOTO_PREV_INPUTFLD );
                         eKeyState = KS_End;
                     }
-                    else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
-                         !rSh.HasReadonlySel() )
+                    else if( rSh.GetCurNumRule()
+                             && rSh.IsSttOfPara()
+                             && !rSh.HasReadonlySel() )
                     {
 
                         if ( rSh.IsFirstOfNumRule() &&
@@ -2353,10 +2352,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
                 }
                 eKeyState = KS_End;
             }
-            else if(!rSh.HasReadonlySel())
+            else if ( !rSh.HasReadonlySel()
+                      || rSh.CrsrInsideInputFld() )
             {
-                sal_Bool bIsNormalChar = GetAppCharClass().isLetterNumeric(
-                                                            OUString( aCh ), 0 );
+                const sal_Bool bIsNormalChar =
+                    GetAppCharClass().isLetterNumeric( OUString( aCh ), 0 );
                 if( bAppendSpace && bIsNormalChar &&
                     (!m_aInBuffer.isEmpty() || !rSh.IsSttPara() || !rSh.IsEndPara() ))
                 {
@@ -2365,8 +2365,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
                     m_aInBuffer += " ";
                 }
 
-                sal_Bool bIsAutoCorrectChar =  SvxAutoCorrect::IsAutoCorrectChar( aCh );
-                bool bRunNext = pACorr && pACorr->HasRunNext();
+                const sal_Bool bIsAutoCorrectChar =  SvxAutoCorrect::IsAutoCorrectChar( aCh );
+                const bool bRunNext = pACorr != NULL && pACorr->HasRunNext();
                 if( !aKeyEvent.GetRepeat() && pACorr && ( bIsAutoCorrectChar || bRunNext ) &&
                         pACfg->IsAutoFmtByInput() &&
                     (( pACorr->IsAutoCorrFlag( ChgWeightUnderl ) &&
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index c50b594..75b25a3 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -1462,11 +1462,16 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
                 rSet.Put(SfxBoolItem(nWhich, bDisable));
             }
             break;
+
             case FN_BACKSPACE:
             case SID_DELETE:
-                if (rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0)
+                if ( ( rSh.HasReadonlySel() && !rSh.CrsrInsideInputFld() )
+                     || rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0 )
+                {
                     rSet.DisableItem( nWhich );
+                }
                 break;
+
             case SID_CONTOUR_DLG:
             {
                 sal_Bool bParentCntProt = 0 != rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT );
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 59df37e..2010708 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -1568,6 +1568,16 @@ void SwTextShell::GetState( SfxItemSet &rSet )
             }
             break;
 
+
+        case FN_INSERT_BREAK:
+            if ( rSh.HasReadonlySel()
+                 && !rSh.CrsrInsideInputFld() )
+            {
+                rSet.DisableItem( nWhich );
+            }
+            break;
+
+
         case FN_INSERT_BREAK_DLG:
         case FN_INSERT_COLUMN_BREAK:
         case FN_INSERT_PAGEBREAK:


More information about the Libreoffice-commits mailing list