sw/source/core/crsr/pam.cxx | 3 +++ sw/source/core/doc/docnum.cxx | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-)
New commits: commit c31a897f33fdce43b3392909feb0d8b82131e268 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Oct 28 10:54:28 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Oct 28 14:06:44 2024 +0100 cid#1607622 Overflowed constant Change-Id: Ibc60439cd74d00b574d58df89058be625957dd02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175720 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index a81a9d736b9d..9230666f2e71 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -1164,7 +1164,10 @@ void GoEndSection( SwPosition * pPos ) SwNodes& rNodes = pPos->GetNodes(); sal_uInt16 nLevel = SwNodes::GetSectionLevel( pPos->GetNode() ); if( pPos->GetNode() < *rNodes.GetEndOfContent().StartOfSectionNode() ) + { + assert(nLevel > 0); nLevel--; + } do { SwNodes::GoEndOfSection( &pPos->nNode ); } while( nLevel-- ); // now on an EndNode, thus to the previous ContentNode commit d34249a8749bfac5c192b9a74d3580f030caf420 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Oct 28 10:06:06 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Oct 28 14:06:28 2024 +0100 cid#1606790 Overflowed constant Change-Id: I2fbfefb47abb752bba609f2373c237ef39bd4e2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175717 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index a415c7247d5c..ed1a6ab64335 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2670,10 +2670,12 @@ OUString SwDoc::GetUniqueNumRuleName( const OUString* pChkStr, bool bAutoNum ) c if( nullptr != pNumRule ) { const OUString sNm = pNumRule->GetName(); - if( sNm.startsWith( aName ) ) + std::u16string_view aSuffix; + if( sNm.startsWith( aName, &aSuffix ) && aSuffix.size() > 0 ) { // Determine Number and set the Flag - nNum = o3tl::narrowing<sal_uInt16>(o3tl::toInt32(sNm.subView( nNmLen ))); + nNum = o3tl::narrowing<sal_uInt16>(o3tl::toInt32(aSuffix)); + assert(nNum > 0); if( nNum-- && nNum < mpNumRuleTable->size() ) pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 )); }