1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/ArrayUtils.h"
14 using namespace mozilla
;
16 const nsPaperSizePS_
nsPaperSizePS::mList
[] =
18 #define SIZE_MM(x) (x)
19 #define SIZE_INCH(x) ((x) * MM_PER_INCH_FLOAT)
20 { "A5", SIZE_MM(148), SIZE_MM(210), true },
21 { "A4", SIZE_MM(210), SIZE_MM(297), true },
22 { "A3", SIZE_MM(297), SIZE_MM(420), true },
23 { "Letter", SIZE_INCH(8.5), SIZE_INCH(11), false },
24 { "Legal", SIZE_INCH(8.5), SIZE_INCH(14), false },
25 { "Tabloid", SIZE_INCH(11), SIZE_INCH(17), false },
26 { "Executive", SIZE_INCH(7.5), SIZE_INCH(10), false },
31 const unsigned int nsPaperSizePS::mCount
= ArrayLength(mList
);
34 nsPaperSizePS::Find(const char *aName
)
36 for (int i
= mCount
; i
--; ) {
37 if (!PL_strcasecmp(aName
, mList
[i
].name
)) {