summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-02 21:32:58 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-03 09:51:23 +0100
commit1a8ac2e1004f1753f117982aca8baa1512b11522 (patch)
tree35771d4eb7e67da8d65a5dd100fe5ddb48d17995
parent895918b07da8fbe5603b3a96b3c58a8dc2d066e5 (diff)
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 <caolanm@redhat.com>
-rw-r--r--vcl/source/gdi/print.cxx2
1 files changed, 1 insertions, 1 deletions
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]);
}