[Libreoffice-commits] .: sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Mar 8 07:33:42 PST 2011


 sw/source/core/crsr/bookmrk.cxx |    2 +-
 sw/source/core/inc/bookmrk.hxx  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3ea3d60bf64a0d2127c420ad9eb595b3425e77ec
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Mar 8 16:32:57 2011 +0100

    n#663622: Fix the positions of imported fields to avoid crashes

diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index b4e0635..d91787a 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -82,7 +82,7 @@ namespace
         SwTxtNode const * const pStartTxtNode = io_pDoc->GetNodes()[rStart.nNode]->GetTxtNode();
         SwTxtNode const * const pEndTxtNode = io_pDoc->GetNodes()[rEnd.nNode]->GetTxtNode();
         const sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(rStart.nContent.GetIndex());
-        xub_StrLen nEndPos = rEnd.nContent.GetIndex() == 0 ? 0 : rEnd.nContent.GetIndex() - 1;
+        xub_StrLen nEndPos = rEnd == rStart ? rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1;
         const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar( nEndPos );
         SwPaM aStartPaM(rStart);
         SwPaM aEndPaM(rEnd);
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index 88683ca..8878dbe 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -77,7 +77,7 @@ namespace sw { namespace mark
             virtual SwPosition& GetMarkEnd() const
             {
                 if( !IsExpanded() ) return GetMarkPos();
-                if ( GetMarkPos( ) > GetOtherMarkPos( ) )
+                if ( GetMarkPos( ) >= GetOtherMarkPos( ) )
                     return GetMarkPos( );
                 else
                     return GetOtherMarkPos( );


More information about the Libreoffice-commits mailing list