summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-27 17:47:11 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-31 09:24:27 +0100
commit011d5bbd068f00c9477b1fd68e8ba297d4e6998a (patch)
treeea49b0e8dd945af88d73a0ad339d7b69874a1076 /sw
parent774275231294b8b8f41024cb1d5216bbe3f23aba (diff)
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.mcnamara@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/doc.cxx11
1 files changed, 2 insertions, 9 deletions
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;