vcl/source/gdi/print.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 1a8ac2e1004f1753f117982aca8baa1512b11522 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Nov 2 21:32:58 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Nov 3 09:51:23 2021 +0100 can use static_assert for compile time check here Change-Id: Ib1b350068bf80431bf0be3263a1a87523066996b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124621 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index e728edf1dca3..2e2a6505ed8f 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1404,7 +1404,7 @@ OUString Printer::GetPaperName( Paper ePaper ) PAPER_ARCHE, PAPER_SCREEN_16_9, PAPER_SCREEN_16_10, PAPER_16K_195x270, PAPER_16K_197x273, PAPER_WIDESCREEN, PAPER_ONSCREENSHOW_4_3, PAPER_ONSCREENSHOW_16_9, PAPER_ONSCREENSHOW_16_10 }; - assert(SAL_N_ELEMENTS(PaperIndex) == SAL_N_ELEMENTS(RID_STR_PAPERNAMES) && "localized paper name count wrong"); + static_assert(SAL_N_ELEMENTS(PaperIndex) == SAL_N_ELEMENTS(RID_STR_PAPERNAMES)); // ensure localized paper name count is correct for (size_t i = 0; i < SAL_N_ELEMENTS(PaperIndex); ++i) pSVData->maPaperNames[PaperIndex[i]] = VclResId(RID_STR_PAPERNAMES[i]); }