diff options
-rw-r--r-- | sw/source/core/crsr/bookmrk.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/bookmrk.hxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 1f9f14adfc..3989ac5bc8 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -83,7 +83,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 88683ca2e8..8878dbe638 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( ); |