[Libreoffice-commits] .: sw/source

Michael Stahl mst at kemper.freedesktop.org
Fri Jul 6 13:37:22 PDT 2012


 sw/source/core/crsr/bookmrk.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit f2b6d71ccd04f41a849a0e5386f6619bfcc211da
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jul 6 22:25:44 2012 +0200

    fdo#38071: roll back change to MarkBase::IsCoveringPosition:
    
    This change seems wrong as the end position is actually behind the
    CH_TXT_ATR_FIELDEND; fortunately it is also unnecessary because
    the change in MSWordExportBase::OutputTextNode is sufficient to
    fix the crash.
    
    Change-Id: I79d508b13ecc8d85c4e09149b44695436416ba6d

diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 211b559..6801d34 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -116,11 +116,12 @@ namespace sw { namespace mark
         }
     }
 
-    //We consider the CH_TXT_ATR_FIELDSTART and CH_TXT_ATR_FIELDEND
-    //themselves to be part of the covered range
+    // For fieldmarks, the CH_TXT_ATR_FIELDSTART and CH_TXT_ATR_FIELDEND
+    // themselves are part of the covered range. This is guaranteed by
+    // TextFieldmark::InitDoc/lcl_AssureFieldMarksSet.
     bool MarkBase::IsCoveringPosition(const SwPosition& rPos) const
     {
-        return rPos >= GetMarkStart() && rPos <= GetMarkEnd();
+        return GetMarkStart() <= rPos && rPos < GetMarkEnd();
     }
 
     void MarkBase::SetMarkPos(const SwPosition& rNewPos)


More information about the Libreoffice-commits mailing list