summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-24 09:18:41 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-24 20:19:16 +0100
commitcd198a34113e8fa8d1060c815b0320a52b089059 (patch)
tree85a8a3b73646ff15350c70ae733f69090f8e11dd /editeng
parent51c735d5109c487fcb876379a16f170c19a98f93 (diff)
ofz#41345 Negative-size-param
Change-Id: I7398fc39c84670f455993c80ea6c9defbcf911d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125752 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/uno/unotext.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 92620d1951d3..5ae3ffac7522 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1327,13 +1327,13 @@ bool SvxUnoTextRangeBase::IsCollapsed() noexcept
maSelection.nStartPos == maSelection.nEndPos );
}
-bool SvxUnoTextRangeBase::GoLeft(sal_Int16 nCount, bool Expand) noexcept
+bool SvxUnoTextRangeBase::GoLeft(sal_Int32 nCount, bool Expand) noexcept
{
CheckSelection( maSelection, mpEditSource.get() );
// #75098# use end position, as in Writer (start is anchor, end is cursor)
- sal_uInt16 nNewPos = maSelection.nEndPos;
- sal_Int32 nNewPar = maSelection.nEndPara;
+ sal_Int32 nNewPos = maSelection.nEndPos;
+ sal_Int32 nNewPar = maSelection.nEndPara;
bool bOk = true;
SvxTextForwarder* pForwarder = nullptr;
@@ -1365,15 +1365,15 @@ bool SvxUnoTextRangeBase::GoLeft(sal_Int16 nCount, bool Expand) noexcept
return bOk;
}
-bool SvxUnoTextRangeBase::GoRight(sal_Int16 nCount, bool Expand) noexcept
+bool SvxUnoTextRangeBase::GoRight(sal_Int32 nCount, bool Expand) noexcept
{
SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
if( pForwarder )
{
CheckSelection( maSelection, pForwarder );
- sal_Int32 nNewPos = maSelection.nEndPos + nCount; //! Overflow???
- sal_Int32 nNewPar = maSelection.nEndPara;
+ sal_Int32 nNewPos = maSelection.nEndPos + nCount;
+ sal_Int32 nNewPar = maSelection.nEndPara;
bool bOk = true;
sal_Int32 nParCount = pForwarder->GetParagraphCount();