[Libreoffice-commits] .: Branch 'ooo-build-3-2-1' - patches/dev300

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Dec 21 06:26:35 PST 2010


 patches/dev300/apply               |    1 
 patches/dev300/field-keyinput.diff |  105 +++++++++++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+)

New commits:
commit ea4cab53de62e813cb22d8de52839e1c3038b61b
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Dec 21 15:11:28 2010 +0100

    n#657135: Enhanced fields fixes (key inputs, and 0-length fields import)
    
    * patches/dev300/apply:
    * patches/dev300/field-keyinput.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index bb00532..ddb1158 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3052,6 +3052,7 @@ fields-double-click.diff, n#639288, cbosdo
 sw-ww8-colbreak-import.diff, n#652364, cbosdo
 sw-font-color-gui-fix.diff, n#652204, cbosdo
 sw-table-web-layout.diff, n#636367, cbosdo
+field-keyinput.diff, n#657135, cbosdo
 
 [ IxionUse ]
 fields-table-formula.diff, n#631912, cbosdo
diff --git a/patches/dev300/field-keyinput.diff b/patches/dev300/field-keyinput.diff
new file mode 100644
index 0000000..2dc426b
--- /dev/null
+++ b/patches/dev300/field-keyinput.diff
@@ -0,0 +1,105 @@
+diff --git sw/source/core/crsr/bookmrk.cxx sw/source/core/crsr/bookmrk.cxx
+index 4b72389..5b9ab9e 100644
+--- sw/source/core/crsr/bookmrk.cxx
++++ sw/source/core/crsr/bookmrk.cxx
+@@ -84,7 +84,7 @@ namespace
+         SwPaM aStartPaM(rStart);
+         SwPaM aEndPaM(rEnd);
+         io_pDoc->StartUndo(UNDO_UI_REPLACE, NULL);
+-        if( ( ch_start != aStartMark ) && ( rStart != rEnd ) )
++        if( ( ch_start != aStartMark ) && ( aEndMark != CH_TXT_ATR_FORMELEMENT ) )
+         {
+             io_pDoc->InsertString(aStartPaM, aStartMark);
+             rStart.nContent--;
+diff --git sw/source/core/crsr/pam.cxx sw/source/core/crsr/pam.cxx
+index de1dd08..65e4028 100644
+--- sw/source/core/crsr/pam.cxx
++++ sw/source/core/crsr/pam.cxx
+@@ -850,8 +850,10 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
+         else
+         {
+             // Form protection case
+-            bRet = ( pA != pB );
+-            bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
++            bool bAtStartA = pA != NULL && pA->GetMarkStart() == *GetPoint();
++            bool bAtStartB = pB != NULL && pB->GetMarkStart() == *GetMark();
++            bRet = ( pA != pB ) || bAtStartA || bAtStartB;
++             bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
+             if ( bProtectForm )
+                 bRet |= ( pA == NULL || pB == NULL );
+         }
+diff --git sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/wrtw8nds.cxx
+index 33d0b51..9dabf9f 100644
+--- sw/source/filter/ww8/wrtw8nds.cxx
++++ sw/source/filter/ww8/wrtw8nds.cxx
+@@ -1716,7 +1716,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
+             IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
+             if ( ch == CH_TXT_ATR_FIELDSTART )
+             {
+-                SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos + 1 ) );
++                SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos ) );
+                 ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
+                 OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
+ 
+@@ -1749,9 +1749,9 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
+             }
+             else if ( ch == CH_TXT_ATR_FIELDEND )
+             {
+-                SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos ) );
++                SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos - 1 ) );
+                 ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
+-                OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
++                OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDEND??" );
+                 
+                 ww::eField eFieldId = lcl_getFieldId( pFieldmark );
+                 if ( pFieldmark->GetFieldname().equalsAscii( FIELD_UNHANDLED ) )
+diff --git sw/source/filter/ww8/ww8scan.hxx sw/source/filter/ww8/ww8scan.hxx
+index 42ae5df..c734e2e 100644
+--- sw/source/filter/ww8/ww8scan.hxx
++++ sw/source/filter/ww8/ww8scan.hxx
+@@ -685,7 +685,7 @@ public:
+     long Count() const { return ( pRef ) ? pRef->GetIMax() : 0; }
+ };
+ 
+-/// Iterator for footnotes and endnotes
++/// Iterator for fields
+ class WW8PLCFx_FLD : public WW8PLCFx
+ {
+ private:
+diff --git sw/source/ui/docvw/edtwin.cxx sw/source/ui/docvw/edtwin.cxx
+index ce150dd..e33a025 100644
+--- sw/source/ui/docvw/edtwin.cxx
++++ sw/source/ui/docvw/edtwin.cxx
+@@ -1715,9 +1715,17 @@ KEYINPUT_CHECKTABLE_INSDEL:
+                     break;
+ 
+                 case KEY_DELETE:
+-                    if (rSh.IsInFrontOfLabel() &&
+-                        rSh.NumOrNoNum(FALSE))
+-                        eKeyState = KS_NumOrNoNum;
++					if( !rSh.HasReadonlySel() )
++                    {
++                        if (rSh.IsInFrontOfLabel() &&
++                            rSh.NumOrNoNum(FALSE))
++                            eKeyState = KS_NumOrNoNum;
++                    }
++                    else
++                    {
++                        InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute();
++                        eKeyState = KS_Ende;
++                    }
+                     break;
+ 
+                 case KEY_DELETE | KEY_MOD2:
+@@ -1889,6 +1897,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
+                             // <--
+                         }
+                     }
++                    else
++                    {
++                        InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute();
++                        eKeyState = KS_Ende;
++                    }
+                     break;
+ 
+                 case KEY_RIGHT:


More information about the Libreoffice-commits mailing list