summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-24 09:18:41 +0000
committerXisco Fauli <xiscofauli@libreoffice.org>2021-12-09 17:23:52 +0100
commit433c91206991c10b4ce2d7149dafa018f50e39dd (patch)
treed02865f344975b6f729469e9fa521cbcb897dcf1
parentofz: Use-of-uninitialized-value (diff)
downloadcore-433c91206991c10b4ce2d7149dafa018f50e39dd.tar.gz
core-433c91206991c10b4ce2d7149dafa018f50e39dd.zip
ofz#41345 Negative-size-param
Change-Id: I7398fc39c84670f455993c80ea6c9defbcf911d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125724 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--editeng/source/uno/unotext.cxx12
-rw-r--r--include/editeng/unotext.hxx4
2 files changed, 8 insertions, 8 deletions
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index cae30b9eaa99..fb11be5baf5a 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1329,13 +1329,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;
@@ -1367,15 +1367,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();
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 8a029b72a1b1..6e100d27e1c3 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -313,8 +313,8 @@ public:
void CollapseToStart() noexcept;
void CollapseToEnd() noexcept;
bool IsCollapsed() noexcept;
- bool GoLeft(sal_Int16 nCount, bool Expand) noexcept;
- bool GoRight(sal_Int16 nCount, bool Expand) noexcept;
+ bool GoLeft(sal_Int32 nCount, bool Expand) noexcept;
+ bool GoRight(sal_Int32 nCount, bool Expand) noexcept;
void GotoStart(bool Expand) noexcept;
void GotoEnd(bool Expand) noexcept;