diff options
-rw-r--r-- | vcl/source/edit/texteng.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/textview.cxx | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 12731dfc3305..f1f3a408afc1 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -1012,7 +1012,7 @@ const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, sal_uInt1 { const TextCharAttrib* pAttr = nullptr; TextNode* pNode = mpDoc->GetNodes()[ rPaM.GetPara() ]; - if ( pNode && ( rPaM.GetIndex() < pNode->GetText().getLength() ) ) + if (pNode && (rPaM.GetIndex() <= pNode->GetText().getLength())) pAttr = pNode->GetCharAttribs().FindAttrib( nWhich, rPaM.GetIndex() ); return pAttr; } diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 40e2a99caa23..b19ad1767043 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -596,10 +596,12 @@ bool TextView::KeyInput( const KeyEvent& rKeyEvent ) if(pStartAttr && pStartAttr->GetStart() < mpImpl->maSelection.GetStart().GetIndex()) { mpImpl->maSelection.GetStart().GetIndex() = pStartAttr->GetStart(); + aOldSel = mpImpl->maSelection; // update to deleted! } if(pEndAttr && pEndAttr->GetEnd() > mpImpl->maSelection.GetEnd().GetIndex()) { mpImpl->maSelection.GetEnd().GetIndex() = pEndAttr->GetEnd(); + aOldSel = mpImpl->maSelection; // update to deleted! } } aCurSel = ImpDelete( nDel, nMode ); |