[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sw/source

Michael Stahl mstahl at redhat.com
Mon Feb 18 02:09:55 PST 2013


 sw/source/core/doc/docedt.cxx |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 00967d738e02155d793830e23e5c33696f3a759a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Feb 14 23:34:16 2013 +0100

    SwDoc::Overwrite: probably a bad idea to overwrite fieldmarks
    
    Change-Id: Iba94df67c21514cf4f5361bab28629c6d5d9d3e8
    (cherry picked from commit 447bb5b5006051672ec526b75bec7db02d2db82e)
    Reviewed-on: https://gerrit.libreoffice.org/2175
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
    Tested-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 693e2bf..47829ea 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -159,8 +159,18 @@ typedef boost::ptr_vector< _SaveRedline > _SaveRedlines;
 static bool lcl_MayOverwrite( const SwTxtNode *pNode, const xub_StrLen nPos )
 {
     sal_Unicode cChr = pNode->GetTxt().GetChar( nPos );
-    return !( ( CH_TXTATR_BREAKWORD == cChr || CH_TXTATR_INWORD == cChr ) &&
-              (0 != pNode->GetTxtAttrForCharAt( nPos ) ) );
+    switch (cChr)
+    {
+        case CH_TXTATR_BREAKWORD:
+        case CH_TXTATR_INWORD:
+            return !pNode->GetTxtAttrForCharAt(nPos);// how could there be none?
+        case CH_TXT_ATR_FIELDSTART:
+        case CH_TXT_ATR_FIELDEND:
+        case CH_TXT_ATR_FORMELEMENT:
+            return false;
+        default:
+            return true;
+    }
 }
 
 static void lcl_SkipAttr( const SwTxtNode *pNode, SwIndex &rIdx, xub_StrLen &rStart )


More information about the Libreoffice-commits mailing list