sw/source/core/doc/doc.cxx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
New commits: commit 011d5bbd068f00c9477b1fd68e8ba297d4e6998a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Oct 27 17:47:11 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Oct 31 09:24:27 2024 +0100 cid#1607883 Overflowed constant Change-Id: Ib01a9c72b2e5684552af22e3ef64a33358eacb9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175804 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index e19cfa10dc71..c70929b65953 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -999,15 +999,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // just one page is special ... if ( 1 == aVec.size() ) { -#if defined __GNUC__ && !defined __clang__ && __GNUC__ <= 14 && __cplusplus == 202002L -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Warray-bounds" -#pragma GCC diagnostic ignored "-Wstringop-overflow" -#endif - aVec.insert( aVec.begin() + 1, nullptr ); // insert a second empty page -#if defined __GNUC__ && !defined __clang__ && __GNUC__ <= 14 && __cplusplus == 202002L -#pragma GCC diagnostic pop -#endif + aVec.push_back( nullptr ); // insert a second empty page } else { @@ -1021,6 +1013,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // make sure that all pages are in correct order std::vector< const SwPageFrame * >::size_type nSPg = 0; std::vector< const SwPageFrame * >::size_type nEPg = aVec.size(); + assert(nEPg >= 2); sal_Int32 nStep = 1; if ( 0 == (nEPg & 1 )) // there are no uneven ones! --nEPg;