[Libreoffice-commits] .: 2 commits - sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Jan 11 11:26:35 PST 2011


 sw/source/core/crsr/bookmrk.cxx    |    2 +-
 sw/source/core/crsr/pam.cxx        |    5 +++--
 sw/source/filter/ww8/wrtw8nds.cxx  |    6 +++---
 sw/source/filter/ww8/ww8scan.hxx   |    2 +-
 sw/source/ui/dbui/mmoutputpage.cxx |    5 +----
 sw/source/ui/docvw/edtwin.cxx      |   19 ++++++++++++++++---
 6 files changed, 25 insertions(+), 14 deletions(-)

New commits:
commit 0921bd5dc88dfd212fc5a332e0902347377be119
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Jan 11 20:18:26 2011 +0100

    n#657135: Enhanced fields fixes (key inputs, and 0-length fields import)

diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 94db595..c032664 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -88,7 +88,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 a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index e1527b4..28d706e 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -838,8 +838,9 @@ 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;
             if ( bProtectForm )
                 bRet |= ( pA == NULL || pB == NULL );
         }
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 94f044e..bafc7aa 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1827,7 +1827,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??" );
 
@@ -1879,9 +1879,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( ODF_UNHANDLED ) )
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index af19986..c4226ef 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -683,7 +683,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 a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 4d4b28a..b9d1f5a 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1694,9 +1694,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:
@@ -1852,6 +1860,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
                             }
                         }
                     }
+                    else
+                    {
+                        InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute();
+                        eKeyState = KS_Ende;
+                    }
                     break;
 
                 case KEY_RIGHT:
commit 3b627b964c0877d72fdd24d2303810647aaebd76
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Jan 11 17:40:02 2011 +0100

    Fixed one DBG_UTIL fantom in sw

diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 5b428cc..99bc4a5 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -1205,10 +1205,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
         }
         xTempDocShell->DoClose();
 
-#if OSL_DEBUG_LEVEL > 0
-        sal_Int32 nTarget =
-#endif
-            rConfigItem.MoveResultSet(rInfo.nDBRow);
+        sal_Int32 nTarget = rConfigItem.MoveResultSet(rInfo.nDBRow);
         OSL_ENSURE( nTarget == rInfo.nDBRow, "row of current document could not be selected");
         OSL_ENSURE( sEMailColumn.Len(), "No email column selected");
         ::rtl::OUString sEMail = lcl_GetColumnValueOf(sEMailColumn, xColAccess);


More information about the Libreoffice-commits mailing list